Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
Page Properties

API-name

Legemiddel

API-version and publish date

v1

Status

Status
colourGreen
titleI Drift

Technology

Status
titleREST

Purpose of the API

The API is used to retrieve medicines (prescriptions) from kjernejournal, including medicines in use (M25 messages). Medicines are medicines that are on prescription, received from pharmacies in Norway (from paper, telephone and e-prescriptions). History up to 3 years. Authenticated end user is required. The prescription objects are on the same format as “Reseptformidleren” uses. See message definitions for e-prescription: https://www.nhn.no/nasjonale-e-helselosninger/e-resept/dokumentasjon-for-e-resept

The API offers an overview of the patient's drug history for the last 3 years. The API gives healthcare professionals who do not have the right to prescribe medicines the opportunity ton obtain information about the patient's drug history.

Information about the API

Type API

REST

Methods and parameters of the endpoint

GET

Input:

Field

Location

Required

Description

ticket

Query string

Yes

A ticket from the health indicator service.

fra

Query string

Yes

Example: 2015-11-29T13:37:19.003Z

utvidet-oppslag

Query string

Yes

Can be one of the following values:

  • true

  • false

samtykke-sperret-legemidler

Query string

No

Consent for opening the patient’s kjernejournal (used if the ticket from the response is later used to access the patient’s kjernejournal).

Can be one of the following values:

  • HPMOTTATTSAMTYKKE

  • HPAKUTT

samtykke-laste-resepter

Query string

No

Consent for opening the patient’s kjernejournal (used if the ticket from the response is later used to access the patient’s kjernejournal).

Can be one of the following values:

  • HPMOTTATTSAMTYKKE

  • HPAKUTT

samtykke-bruk-api

Query string

No

Consent for opening the patient’s kjernejournal (This is only needed if this is NOT specified in the ticket used).

Can be one of the following values:

  • HPMOTTATTSAMTYKKE

  • HPAKUTT

  • HPUNNTAK

Authorization

HTTP Header

Yes

A token from HelseID sent as a bearer token.

X-EPJ-System

HTTP Header

Yes

Which EHR system, and which version, the request originated from.

Output in case of successful request:

Field

Location

Description

hentetTidspunkt

Body

harLegemidler

Body

harLaste

Body

 

legemidlerIBruk

Body

reseptliste

Body

X-EVENT-ID

Header

The ID of the request in kjernejournal. Can be used for debugging and correlation between the systems.

Info


Request example:

Code Block
GET /v1/legemiddel/?ticket=GzF5DoSLhbJjujkePqyie...&fra=2019-10-28T09%3A37%3A48Z&utvidet-oppslag=False&samtykke-sperret-legemidler=HPAKUTT HTTP/1.1
Host: api.kjernejournal.no:8000
Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZ...GMhENGy76Is1FFND1b-Q
Accept: application/json; charset=utf-8
X-EPJ-system: ACME EHR system versjon 42.01

Response example:

Code Block
HTTP/1.1 200 OK
Cache-Control: no-cache, must-revalidate
Pragma: no-cache
Content-Type: application/json
 
{
    "hentetTidspunkt" : "2019-10-28T09:39:21.541Z",
    "harLegemidler" : true,
    "harLaste" : false,
    "legemidlerIBruk" : ["Legemidler i bruk/LIB-message in XML"],
    "reseptliste" : ["Prescription drugs in XML"],
    "massadapibusridiculus" : "Ukjent felt skal støttes av konsument"
}

Error response example

Code Block
HTTP/1.1 403 FORBIDDEN
Cache-Control: no-cache, must-revalidate, private, s-maxage=0
Pragma: no-cache
Content-Type: application/json; charset=utf-8

{
    "status" : 403,
    "utviklermelding" : "A more technical text that helps developers of the integration with Kjernejournal identify the problem",
    "brukermelding" : "An error message that can be shown to the user",
    "feilkode" : "KJF-000198"
}

Swagger

https://api.st2.kjernejournal-test.no:8000/v1/legemiddel/swagger-ui.html  

Authentication

Authentication with HelseID, only healthcare professionals with valid HPR authorization can use the API.

Versioning and changes

Versioning is indicated in the API URL: / v1 /

Norsk helsenett plans to support at least 2-3 versions of an API. Details of their release schedule, support and documentation will be published later.

Integration guide

See integration guide for Rest API for all details, includes information about errorcodes and messages:

https://kjernejournal.atlassian.net/wiki/spaces/KJERNEJOUR/pages/595919048/Integration%2BGuide%2BKjernejournal%2BREST%2BAPI%2Busing%2BHelseID%2Bas%2BauthenticatorIntegration Guide: Kjernejournal REST API using HelseID as authenticator