🧬 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 for more details on the Fhir output.
📅 Last updated June 19, 2024
🛠 Basic
🌐 BaseUrl
Pasientens prøvesvar (PPS) exposes two endpoints for testing so that it is possible to implement against the solution without a Helse-ID token. Bypassing Helse-ID is not possible in production.
Endpoints, see the environment section
- Endpoint 1 (skip proxy - without Helse-ID) -
<base-url>/fhir/
- Endpoint 2 -
<base-url>/
📬 Headers for Endpoint 1
NOTE: Headers do not apply to /metadata.
Name | Value |
---|---|
x-nilar-patient | patient's public id |
x-nilar-requester-hpr | requester's hpr |
x-nilar-requester-hpr-role | requester's hpr role |
x-nilar-requester-name | requester's name |
x-nilar-organisation | requester's organisation |
x-nilar-reason | consent code (OBSOLETE) |
x-nilar-access-basis | consent code |
x-nilar-correlation-id | correlation id |
📬 Headers for Endpoint 2
Name | Value |
---|---|
person-id | patient's fnr |
authorization | helse-id token |
grunnlag | consent code (OBSOLETE) |
access-basis | consent code |
requester-hpr-role | requester's hpr role |
🔐 Consent Codes
LEGACY
- default - 0
- samtykke - 1 (overrides general block)
- akutt - 2 (overrides general block)
NEW CODES (🚨NOT YET ACTIVE!🚨)
New consent codes are being implemented, and are now provided using the access-basis header.
More details are found in the authorization section
HPR Role
The requester's HPR role is going to be required moving forwards, but is currently not required.
More details are found in the authorization section
📦 Body
x-www-form-urlencoded
📑 Metadata
Method: POST
URL: {baseUrl}/metadata
Body: (empty)
🌟 Examples
- A. Get resource(s) of specified type
- B. Get specific resource by id
- C. Skip and count
- D. Include related resources
- E. Date and date intervals
- F. Search on meta tag
- G. DiagnosticReport with related ServiceRequest
- H. PractitionerRole for DiagnosticReport
A. Get resource of specified type
📝 A.1. Format
Method: POST
URL: {baseUrl}/{resourceType}/_search
Body: (empty)
🔍 A.1.1. Example Endpoint 1 - All DiagnosticReport for Gry Telokk outside proxy
Method: POST
URL: https://test.nilar.nhn.no/fhir/DiagnosticReport/_search
📬Headers:
Name | Value |
---|---|
x-nilar-patient | 12057900499 |
x-nilar-requester-hpr | 4128168 |
📦Body: (empty)
🔍 A.1.2. Example Endpoint 2 - All Observation for Gry Telokk via proxy
Method: POST
URL: https://test.nilar.nhn.no/Observation/_search
📬Headers:
Name | Value |
---|---|
Person-Id | 12057900499 |
Authorization | Bearer {token} |
📦Body: (empty)
B. Get specific resource by id
📝 B.1. Format
Method: POST
URL: {baseUrl}/{resourceType}/_search
Body (x-www-form-urlencoded): _id: {guid}
🔍 B.1.1. Example Endpoint 1 - Specific Specimen for Gry Telokk outside proxy
Method: POST
URL: https://test.nilar.nhn.no/fhir/Specimen/_search
📬Headers:
Name | Value |
---|---|
x-nilar-patient | 12057900499 |
x-nilar-requester-hpr | 4128168 |
📦Body (x-www-form-urlencoded):
Key | Value |
---|---|
_id | {guid} |
🔍 B.1.2. Example Endpoint 2 - Specific DiagnosticReport for Gry Telokk via proxy
Method: POST
URL: https://test.nilar.nhn.no/DiagnosticReport/_search
📬Headers:
Name | Value |
---|---|
Person-Id | 12057900499 |
Authorization | Bearer {token} |
📦Body (x-www-form-urlencoded):
Key | Value |
---|---|
_id | {guid} |
C. Skip and count
🔍 C.1.1. Example Endpoint 1 - Skip 50 DiagnosticReport and show 10 for Gry Telokk outside proxy
Method: POST
URL: https://test.nilar.nhn.no/fhir/DiagnosticReport/_search
📬Headers:
Name | Value |
---|---|
x-nilar-patient | 12057900499 |
x-nilar-requester-hpr | 4128168 |
📦Body (x-www-form-urlencoded):
Key | Value |
---|---|
_count | 10 |
_skip | 50 |
D. Include related resources
📝 D.1. Format
Method: POST
URL: {baseUrl}/{resourceType}/_search
Body (x-www-form-urlencoded): _include: {relation (string)}
🔍 D.1.1. Example Endpoint 1 - All DiagnosticReport for Gry Telokk with associated Observations outside proxy
Method: POST
URL: https://test.nilar.nhn.no/fhir/DiagnosticReport/_search
📬Headers:
Name | Value |
---|---|
x-nilar-patient | 12057900499 |
x-nilar-requester-hpr | 4128168 |
📦Body (x-www-form-urlencoded):
Key | Value |
---|---|
_include | DiagnosticReport:result |
E. Date and date intervals
🔍 E.1.1. Example Endpoint 1 - All Observations for Gry Telokk from 14.01.2017
Method: POST
URL: https://test.nilar.nhn.no/fhir/Observation/_search
📬Headers:
Name | Value |
---|---|
x-nilar-patient | 12057900499 |
x-nilar-requester-hpr | 4128168 |
📦Body (x-www-form-urlencoded):
Key | Value |
---|---|
date | gt2017-01-14 |
F. Search on meta tag
📝 F.1. Format
Method: POST
URL: {baseUrl}/{resourceType}/_search
Body (x-www-form-urlencoded): _tag={string(code)}
🔍 F.1.1 Example Endpoint 1 - Search on Observations for Gry Telokk containing Meta Tag "Findings and examination results"
Method: POST
URL: https://test.nilar.nhn.no/fhir/Observation/_search
📬Headers:
Name | Value |
---|---|
x-nilar-patient | 12057900499 |
x-nilar-requester-hpr | 4128168 |
📦Body (x-www-form-urlencoded):
Key | Value |
---|---|
_tag | FU |
G. DiagnosticReport with related ServiceRequest
📝 G.1. Format
Method: POST
URL: {baseUrl}/DiagnosticReport/_search
Body (x-www-form-urlencoded): _id={guid}&_include=DiagnosticReport:based-on
H. PractitionerRole for DiagnosticReport
📝 H.1. Format
Method: POST
URL: {baseUrl}/DiagnosticReport/_search
Body (x-www-form-urlencoded):
Key | Value |
---|---|
_id | {guid} |
_include | DiagnosticReport:based-on |
_include:iterate | ServiceRequest:requester |