The OAuth 2.0 Authorization Code grant flow with PKCE is used to issue Access, Refresh, and ID tokens.
The Patient authorization code is generated by the server and then shared out-of-band as a secret link with the user.
OAuth is configured from the Django Admin page (See Getting Started above).
Endpoints and configuration details can be discovered from the OIDC metadata endpoint:
/o/.well-known/openid-configuration
The returned Access Token should be included in the Authorization header for all API requests with the prefix Bearer .
Because the Patient authorization code is generated by the server, the PKCE code challenge and code verifier must be static values and set by the env vars (example below). The client then sends this code_verifier along with the authorization code to obtain tokens.
The Admin API is used by the Web UI SPA for Practitioner/Patient/Organization/Study management and Patient data provider apps/clients to manage Patient consents.
The consents endpoint returns the studies that are pending and consented for the specified Patient. In this example, the Patient has been invited to Demo Study 2 and has already consented to sharing blood glucose data with Demo Study 1.
The FHIR Patient endpoint returns a list of Patients as a FHIR Bundle for a given Study ID passed as query parameter_has:Group:member:_id or alternatively a single Patient matching the query parameter identifier=<system>|<value>
Query Parameter
Example
Description
_has:Group:member:_id
30001
Filter by Patients that are in the Study with ID 30001
The FHIR Observation endpoint returns a list of Observations as a FHIR Bundle
At least one of Study ID, passed as patient._has:Group:member:_id or Patient ID, passed as patient or Patient Identifier passed as patient.identifier=<system>|<value> query parameters are required
subject.reference references a Patient ID
device.reference references a Data Source ID
valueAttachment is Base 64 Encoded Binary JSON
Query Parameter
Example
Description
patient._has:Group:member:_id
30001
Filter by Patients that are in the Study with ID 30001