Queries
Search pathways by status, type, patient and other criteria
We suggest reading the page on our domain model first to get an understanding of the pathway model.
- graphql
01query GetPathways(02 $pathway_definition_id: String03 $status: [String!]04 $start_date_earliest: String05 $start_date_latest: String06 $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 success25 pagination {26 count27 offset28 total_count29 }30 sorting {31 field32 direction33 }34 pathways {35 id36 title37 pathway_definition_id38 patient_id39 status40 status_explanation41 version # version number42 start_date43 stop_date # if pathway is stopped44 complete_date # if pathway is completed45 }46 }47}
There are no required parameters for this query. However, you should provide pagination and sorting parameters. See Pagination and Sorting
below.
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 count13 offset14 total_count15 }16 sorting {17 field18 direction19 }20 pathways {21 ...Pathway22 }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.
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 string05 "start_date_latest": '2022-01-01', // ISO8601 date string06 "release_id": ["{{ RELEASE_ID_1 }}", "{{ RELEASE_ID_2 }}"],07 "status": ["active", "completed", "stopped"], // See PathwayStatus enum08 "offset": 0,09 "count": 20,10 "sort_field": "start_date",11 "sort_direction": "DESC"12 }
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 10003 "offset": 0,04 "sort_field": "start_date",05 "sort_direction": "DESC"06}