Awell Health Developer Hub
Developer Hub

We suggest reading the page on our domain model first to get an understanding of the pathway model.

Query

  • graphql
01query GetPathways(
02 $pathway_definition_id: String
03 $status: [String!]
04 $start_date_earliest: String
05 $start_date_latest: String
06 $patient_id: [String!]
07 $release_id: [String!]
08 $count: Float!
09 $offset: Float!
10 $sort_field: String!
11 $sort_direction: String!
12) {
13 pathways(
14 filters: {
15 pathway_definition_id: { eq: $pathway_definition_id }
16 status: { in: $status }
17 start_date: { gte: $start_date_earliest, lte: $start_date_latest }
18 patient_id: { in: $patient_id }
19 release_id: { in: $release_id }
20 }
21 pagination: { count: $count, offset: $offset }
22 sorting: { field: $sort_field, direction: $sort_direction }
23 ) {
24 success
25 pagination {
26 count
27 offset
28 total_count
29 }
30 sorting {
31 field
32 direction
33 }
34 pathways {
35 id
36 title
37 pathway_definition_id
38 patient_id
39 status
40 status_explanation
41 version # version number
42 start_date
43 stop_date # if pathway is stopped
44 complete_date # if pathway is completed
45 }
46 }
47}

Variables

Required parameters

There are no required parameters for this query. However, you should provide pagination and sorting parameters. See Pagination and Sorting below.

Filters

The filter is optional: if you don't provide one, an unfiltered list of pathways will be returned.

  • graphql
01query GetPathways(
02 $count: Float!
03 $offset: Float!
04 $sort_field: String!
05 $sort_direction: String!
06) {
07 pathways(
08 pagination: { count: $count, offset: $offset }
09 sorting: { field: $sort_field, direction: $sort_direction }
10 ) {
11 pagination {
12 count
13 offset
14 total_count
15 }
16 sorting {
17 field
18 direction
19 }
20 pathways {
21 ...Pathway
22 }
23 }
24}

All in filter type accepts a list of values and results in an is any of search criteria. The eq filter accepts a single string and results in is exact match search criteria.

When specifying multiple filters, the resulting criteria is the conjunction of all filters.

  • json
01{
02 "pathway_definition_id": "{{ PATHWAY_DEFINITION_ID }}",
03 "patient_id": ["{{ PATIENT_ID_1 }}", "{{ PATIENT_ID_2 }}"],
04 "start_date_earliest": '2022-01-01', // ISO8601 date string
05 "start_date_latest": '2022-01-01', // ISO8601 date string
06 "release_id": ["{{ RELEASE_ID_1 }}", "{{ RELEASE_ID_2 }}"],
07 "status": ["active", "completed", "stopped"], // See PathwayStatus enum
08 "offset": 0,
09 "count": 20,
10 "sort_field": "start_date",
11 "sort_direction": "DESC"
12 }

Pagination and sorting

Pagination and sorting are required for this query. If no pagination values are supplied, the API will return only the first 100 care flows, or 100 care flows from any specified offset. There is an upper limit of 100 records per query. Please be aware that setting count greater than 100 will successfully execute but return only 100 records.

Default sorting is based on the start_date field, sorted from newest to oldest (i.e. descending).

  • json
01{
02 "count": 100, // max 100
03 "offset": 0,
04 "sort_field": "start_date",
05 "sort_direction": "DESC"
06}