Legemiddel - API
API-name | Legemiddel |
---|---|
API-version and publish date | v1 Mar 10, 2021 |
Status | I Drift |
Technology | REST |
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: 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: |
utvidet-oppslag | Query string | Yes |
Can be one of the following values:
|
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:
|
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:
|
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:
|
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. |
Request example:
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:
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
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:
Integration Guide: Kjernejournal REST API using HelseID as authenticator
© Norsk helsenett - kjernejournal