Examples of calls to the Pasientens prøvesvar(PPS) API (TEST environments)
This page shows examples of API calls to Pasientens prøvesvar (PPS). Please note that PPS is under development and the examples may not be up-to-date.
NOTE: This is a selection of example queries to support developers in the startup phase. See PPS's FHIR profile on HL7 Github.
Last updated January 06, 2023
Basic
BaseURL
Pasientens prøvesvar (PPS) exposes two endpoint for test so that it is possible to implement against the solution without a Helse-ID token. In production, only endpoint 2 is available.
Endpoint 1 (skip proxy - without Helse-ID) - https://test.nilar.nhn.no/fhir/
Endpoint 2 - https://test.nilar.nhn.no/
Headers for Endpoint 1
NOTE: Headers do not apply to /metadata.
Pasientens prøvesvar (skip proxy) headers
x-nilar-patient with the patient's fnr,
x-nilar-requester-hpr with the requester's hpr,
x-nilar-reason with consent code - default 0,
Headers for Endpoint 2
Pasientens prøvesvar (via proxy) requires headers
person-id with the patient's fnr,
Authorization with helse-id token
Grunnlag with consent code - default 0,
Consent Codes
default - 0
samtykke - 1 (Overstyrer sperring)
akutt - 2 (Overstyrer sperring)
Body
x-www-form-urlencoded
Metadata
GET BaseURL/metadata body empty
Examples
Resource Type
Specific resource
Skip and count
Include related resources
Date and date intervals
Search on meta tag
DiagnosticReport with related ServiceRequest
PractitionerRole for DiagnosticReport
A. Resource Type
A.1. Format
POST baseUrl/resourceType/_search
body empty
A.1.1. Eksempel Endepunkt 1 - Alle DiagnosticReport for Gry Telokk utenfor proxy
POST https://test.nilar.nhn.no/fhir/DiagnosticReport/_search
header x-nilar-patient: 12057900499
header x-nilar-requester-hpr: 4128168
body tom
A.1.2. Eksempel Endepunkt 2 - Alle Observation for Gry Telokk via proxy
POST https://test.nilar.nhn.no/Observation/_search
header Person-Id: 12057900499
header Authorization: Bearer token
body tom
B. Specific resource
B.1. Format
POST baseUrl/resourceType/_search
body _id: guid
B.1.1. Eksempel Endepunkt 1 - Spesifikk Specimen for Gry Telokk utenfor proxy
POST https://test.nilar.nhn.no/fhir/Specimen/_search
header x-nilar-patient: 12057900499
header x-nilar-requester-hpr: 4128168
body _id: guid
B.1.2. Eksempel Endepunkt 2 - Spesifikk DiagnosticReport for Gry Telokk via proxy
POST https://test.nilar.nhn.no/DiagnosticReport/_search
header Person-Id: 12057900499
header Authorization: Bearer token
body _id: guid
C. Skip and count
C.1. Format
POST baseUrl/resourceType/_search
body _count: int + _skip: int
C.1.1. Eksempel Endepunkt 1 - Hopp over 50 DiagnosticReport og vis 10 for Gry Telokk utenfor proxy
POST https://test.nilar.nhn.no/fhir/DiagnosticReport/_search
header x-nilar-patient: 12057900499
header x-nilar-requester-hpr: 4128168
body _count: 10 + _skip: 50
NOTE: "Total" vil fortsatt vise totalt antall DN for Gry Telokk. "Link>Self" vil reflektere spørringen. "Link" kan brukes til å navigere gjennom ressursene.
D. Include related resources
D.1. Format
POST baseUrl/resourceType/_search
body _include: relation (string)
D.1.1. Eksempel Endepunkt 1 - Alle DiagnosticReport for Gry Telokk med tilhørende Observations utenfor proxy
POST https://test.nilar.nhn.no/fhir/DiagnosticReport/_search
header x-nilar-patient: 12057900499
header x-nilar-requester-hpr: 4128168
body _include: DiagnosticReport:result
D.1.1. Eksempel Endepunkt 1 - Alle DiagnosticReport for Gry Telokk med tilhørende Specimen utenfor proxy
POST https://test.nilar.nhn.no/fhir/DiagnosticReport/_search
header x-nilar-patient: 12057900499
header x-nilar-requester-hpr: 4128168
body _include: DiagnosticReport:specimen
E. Date and date intervals
Støtter modifiers eq, lt og gt, se: https://www.hl7.org/fhir/search.html#modifiers
E.1. Format Dato
POST baseUrl/resourceType/_search
body date: string(modifier+dato)
E.1.1 Eksempel Endepunt 1 - Alle Observations for Gry Telokk f.o.m 14.01.2017
POST https://test.nilar.nhn.no/fhir/Observation/_search
header x-nilar-patient: 12057900499
header x-nilar-requester-hpr: 4128168
body date: gt2017-01-14
E.2. Format Datointervall
POST baseUrl/resourceType/_search
body date: gt+dato + date: lt+dato
E.2.1 Eksempel Endepunt 1 - Alle Observations for Gry Telokk i en fem dagers periode i 2017
POST https://test.nilar.nhn.no/fhir/Observation/_search
header x-nilar-patient: 12057900499
header x-nilar-requester-hpr: 4128168
body date: gt2017-09-20 + date: lt2017-09-24
F. Search on meta tag
F.1. Format
POST baseUrl/resourceType/_search
body _tag: string(code)
F.1.1 Eksempel Endepunkt 1 - Søk på Observasjoner for Gry Telokk som inneholde Meta Tag "Funn og undersøkelsesresultater"
POST https://test.nilar.nhn.no/fhir/Observation/_search
header x-nilar-patient: 12057900499
header x-nilar-requester-hpr: 4128168
body _tag: FU
G. DiagnosticReport with related ServiceRequest
G.1. Format
POST baseUrl/DiagnosticReport/_search
body _id : guid
body _include : DiagnosticReport:based-on
H. PractitionerRole for DiagnosticReport
H.1. Format
POST baseUrl/DiagnosticReport/_search
body _id : guid
body _include : DiagnosticReport:based-on
body _include:iterate : ServiceRequest:requester