...
An API-integration with kjernejournal requires:
Integration with Healt indicator APIRest service that indicates whether the patient has kjernejournal or not.
Development of dialogs where the information requested from kjernejournal is presented to the end user.
Development of dialogs where end user registers the information that is uploaded to kjernejournal (Alert information).
...
In these steps, tokens are issued by HelseID, while the ticket is issued by kjernejournal in step 2. Tokens are in jwt format and signed by HelseID, while the ticket is an encrypted base64 stringopaque string only useful for kjernejournal.
Authentication of health personell
...
The user access token must have the scope nhn:kjernejournal/api
and have the audience nhn:kjernejournal
. The token must also have the claims https://nhn.no/claims/identity/pid
and https://nhn.no/claims/identity/security_level
. Only tokens with security level 4 will the accepted.
...
It’s a POST
to /v1/helseindikator
, with a JSON body (Content-type: application/json
) with the following input:
Input:
Field | Location | Required | Description |
---|---|---|---|
fnr | Body | Yes | Patient identifier (Norwegian national identity number). |
legemiddelFraDato | Body | No | Optional parameter for information about prescriptions. Example: 2021-06-11 |
samtykke | Body | 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:
|
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 |
---|---|---|
eksistererBlokkertHelsepersonell | Body | Boolean. Because Kjernejournal does not control the information once it is shared, no clinical information will be shared if the patient has blocked at least one person. Only useful for API integration. |
harLasteResepter | Body | Boolean. Indicates if the patient has |
status | Body | One of the following values:
Is to be used to determine what icon should be shown to the user. |
sistEndretKritiskInfo | Body | Shows a timestamp for last change for each category of critical information for patients with status 4. Only present if the status is 4. |
sistEndretKritiskInfoDato | Body | Timestamp for last change in information for patients with status 4. Only present if the status is 4. |
returTekst | Body | Description of the response status. Is to be used in the tooltip of the icon. |
ticket | Body | An opaque string which represents:
Is to be used in the subsequent opening of the portal. Only present if the status is 2 or higher. |
eksistererBlokkertHelsepersonell | Body | Boolean. Because Kjernejournal does not control the information once it is shared, no clinical information will be shared if the patient has blocked at least one person. Only useful for API integration. |
harLasteResepter | Body | Boolean. Indicates if the patient has locked prescriptions. |
sperringDetaljer | Body | Indicates which modules of kjernejournal that the patient has locked. |
X-EVENT-ID | Header | The ID of the request in kjernejournal. Can be used for debugging and correlation between the systems. |
Info |
---|
All API responses from kjernejournal may have an arbitrary gibberish extra field. This is to ensure that consumers can handle new fields in the response. |
See Health Indicator API for swagger documentation.
Request header:
...
Field
...
Description
...
Example
...
Authorization
...
Authorization
...
swagger documentation: https://api.st2.kjernejournal-test.no:8000/v1/helseindikator/swagger-ui.html
Request example
Code Block |
---|
POST /v1/helseindikator/ HTTP/1.1 Host: api.kjernejournal.no:8000 Content-Type: application/json;charset=UTF-8 Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IkE4...u_UjgeTxzxI2g X-EPJ-System: ACME EHR system versjon 42.01 {"fnr":"13116900216"} |
Successful response example
Code Block |
---|
HTTP/1.1 200 OK Cache-Control: no-cache, must-revalidate, private, s-maxage=0 Pragma: no-cache Content-Type: application/json; charset=utf-8 { "returTekst": "OBS: Kritisk informasjon i kjernejournal", "sistEndretKritiskInfoDato": "2017-11-29T16:35:19.003Z", "status": 4, "ticket": "ca2gveFcW%2BdZqO2Fx7EG773Lh0TUvO2gtz45gQCbbUrKpXBJf8yS3ROacFn%2Bq" } |
Advcanced request and response
Typically used for API integration
Code Block |
---|
POST /v1/helseindikator/ HTTP/1.1 Host: api.kjernejournal.no:8000 Content-Type |
...
: application/json;charset=UTF-8 |
...
Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IkE4...u_UjgeTxzxI2g X-EPJ-System |
...
Which EHR the request originated and which version of the system was used
...
ACME EHR system version 42.01
...
name | Helseindikator request eks |
---|
...
: ACME EHR system versjon 42.01
{
"fnr": "13116900216",
"legemiddelFraDato": "2021-06-11",
"samtykke": "HPMOTTATTSAMTYKKE"
} |
Note. The request should include the HTTP header "X-EPJ-System" that describes which EHR the request originated from and which version of the system was used. Table excerpt
Successful response example Table excerpt
name | Helseindikator error eks |
---|
Code Block |
---|
HTTP/1.1 200 OK
Cache-Control: no-cache, must-revalidate, private, s-maxage=0
Pragma: no-cache
Content-Type: application/json; charset=utf-8
{
"eksistererBlokkertHelsepersonell": false,
"harLasteResepter": true,
"harLegemidler": true,
"returTekst": "OBS: Kritisk informasjon i kjernejournal",
"sistEndretKritiskInfo": [
{
"kategori": "OVER_REAK",
"sistEndret": "2017-11-29T16:35:19.003Z"
}
],
"sistEndretKritiskInfoDato": "2017-11-29T16:35:19.003Z",
"sperringDetaljer": [
{
"erSperret": false,
"modul": "KRITISKINFO"
}
],
"status": 4,
"ticket": "ca2gveFcW%2BdZqO2Fx7EG773Lh0TUvO2gtz45gQCbbUrKpXBJf8yS3ROacFn%2Bq"
} |
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" : "Her kan det stå en mer spesifikk tekst som hjelper utvikler av API-klient litt mer enn feilmeldingen som kan vises til bruker",
"brukermelding" : "Virksomheten har ikke tilgang til kjernejournal",
"feilkode" : "KJF-000227"
} |
Security
The Health indicator service requires a system access token (JWT) from HelseID.
...
Ask specifically for the scope
https://ehelse.no/nhn:kjernejournal/kj_api
Use either an enterprise certificate or RSA key (not client secret)
...
It is a simple GET
to /v1/ping
. The authentication and error responses are identical to the health indicator service.
Input:
Field | Location | Required | Description |
---|---|---|---|
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 |
---|---|---|
Pong | Body | Timestamp |
X-EVENT-ID | Header | The ID of the request in kjernejournal. Can be used for debugging and correlation between the systems. |
Request example
|
Response example
|
Info |
---|
All API responses from kjernejournal may have an arbitrary gibberish extra field. This is to ensure that consumers can handle new fields in the response. |
Activation
The kjernejournal integration Integration must be placed behind a toggle function, so that it can be (de)activated on an installation basis. It should also be possible to choose which user group or users that have access to the kjernejournal integration.
Endpoints
Service | Environment | URL |
---|---|---|
API | Test | |
API | Prod |