Releasesv0.1.0
Api referenceEndpointsFhir

The Patient and all their records, as FHIR R4 resources

GET
/v1/users/{id}/fhir/Patient/{patient_id}/$everything

One page of a searchset Bundle: on the first page the Patient, then the page's Observations (search.mode match, the list and the cursor of the Observation search), then the Devices they reference (each once per page) and the Provenance of each Observation (include). Follow the next link until there is none: no Observation is skipped or repeated. limit counts the Observations. See docs/fhir.md.

Authorization

tenantKey
headerAuthorizationBearer <token>

Tenant API key, ohs_sk_ + 43 base62 characters.

Path Parameters

id*string
Formatuuid
patient_id*string

The Patient id, which is the user id; any other value is a 404.

Query Parameters

start?|

Inclusive lower bound, RFC 3339 or YYYY-MM-DD.

end?|

Exclusive upper bound, RFC 3339 or YYYY-MM-DD. Must not be before start.

cursor?string

The next_cursor of the previous page.

limit?integer
Range1 <= value <= 1000
Default100
view?string

merged (the default): when several sources recorded the same thing (a ring and a watch the same night, a phone and a watch the same steps, one sample directly and through an aggregator), only the best ranked source's record is listed, so nothing counts twice. The order of sources is the user's (see source-priorities). all: every stored record of every source.

Default"merged"
Value in"merged""all"

Header Parameters

Authorization*string

The tenant API key, as a bearer secret.

Response Body

One page.

application/fhir+json
  1. response

One page of a Patient's $everything: a FHIR R4 searchset Bundle of the Patient (first page), Observations, Devices and Provenance.

resourceType*string
type*string
link*array<>
entry?array<>

Absent on an empty page after the first.

curl -X GET 'http://localhost:8080/v1/users/497f6eca-6276-4993-bfeb-53cbbbba6f08/fhir/Patient/string/$everything' \  -H 'Authorization: Bearer ohs_sk_...'
{  "resourceType": "Bundle",  "type": "searchset",  "link": [    {      "relation": "self",      "url": "http://example.com"    }  ],  "entry": [    {      "fullUrl": "http://example.com",      "resource": {        "resourceType": "Patient",        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",        "identifier": [          {            "system": "http://example.com",            "value": "string"          }        ],        "active": true      },      "search": {        "mode": "match"      }    }  ]}
Edit on GitHub