Examples of calls to the Pasientens måledata (PMD) API (TEST environments)

This page shows examples of API calls to Pasientens måledata (PMD). Please note that PMD 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 PMD's FHIR profile on (link comes here).

Last updated June 07, 2023

Basic

BaseURL

PMD 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.pmd.nhn.no/fhir/

Endpoint 2 - https://test.pmd.nhn.no/

Headers for Endpoint 1

NOTE: Headers do not apply to /metadata.

Pasientens måledata (skip proxy) headers

  • x-pmd-patient with the patient's fnr
  • x-pmd-requester with the requester's fnr/hpr
  • x-pmd-requestertype with the requester's type
  • x-pmd-organisation with the organization id from which the requester operates
  • x-pmd-reason with consent code - default 0
  • x-pmd-correlation-id with correlation id for the request

Headers for Endpoint 2

Pasientens måledata (via proxy) requires headers

  • person-id with the patient's fnr
  • correlation-id with correlation id for the request

Body

x-www-form-urlencoded

Metadata

GET BaseURL/metadata

  • body empty

Examples

Note: The description refers to "resource" as this i a generic format for searching resources in Fhir. The only relevant resource in this api is Observation, which is reflected in the actual examples.

  1. All resources of given type

  2. All resources in a date range

  3. Resources filtered on code values

A. All resources of given type

A.1. Format

POST baseUrl/resourceType/_search

  • body empty

A.1.1. Eksempel Endepunkt 1 - Alle Observasjoner for Gry Telokk outside proxy

POST https://test.pmd.nhn.no/fhir/Observation/_search

  • header x-pmd-patient: 12057900499
  • header x-pmd-requester: 4128168
  • body tom

A.1.2. Eksempel Endepunkt 2 - Alle Observation for Gry Telokk via proxy

POST https://test.pmd.nhn.no/Observation/_search

  • header Person-Id: 12057900499
  • header Authorization: Bearer token
  • body tom

B. All resources in a date range

B.1. Format

POST baseUrl/resourceType/_search

  • body
    • date: geFrom
    • date: leTo

The dates can be specified with camparators such as lt, le, eq etc. and the format is yyyy-mm-dd, e.g. "ge2023-01-01".

The examples uses two dates, giving e double-sided range. Single dates or single sided ranges can be used.

B.1.1. Eksempel Endepunkt 1 - Specific Observasjoner for Gry Telokk outside proxy

POST https://test.pmd.nhn.no/fhir/Observation/_search

  • header x-pmd-patient: 12057900499
  • header x-pmd-requester: 4128168
  • body
    • date: ge2022-06-01
    • date: le2023-06-01

B.1.2. Eksempel Endepunkt 2 - Specific Observation for Gry Telokk via proxy

POST https://test.pmd.nhn.no/Observation/_search

  • header Person-Id: 12057900499
  • header Authorization: Bearer token
  • body
    • date: ge2022-06-01
    • date: le2023-06-01

C. Resources filtered on code value

C.1. Format

POST baseUrl/resourceType/_search

  • body
    • code: string

C.1.1. Eksempel Endepunkt 1 - Heart rate for Gry Telokk outside proxy

POST https://test.pmd.nhn.no/fhir/Observation/_search

  • header x-pmd-patient: 12057900499
  • header x-pmd-requester: 4128168
  • body
    • code: 8867-4

C.1.2. Eksempel Endepunkt 2 - Specific Observation for Gry Telokk via proxy

POST https://test.pmd.nhn.no/Observation/_search

  • header Person-Id: 12057900499
  • header Authorization: Bearer token
  • body
    • code: 8867-4