Awell Health Developer Hub
Developer Hub

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

Query

  • graphql
01query GetActivities(
02 $activity_type: [String!]
03 $activity_status: [String!]
04 $pathway_definition_id: [String!]
05 $action: [String!]
06 $patient_id: String
07 $count: Float!
08 $offset: Float!
09 $sort_field: String!
10 $sort_direction: String!
11) {
12 activities(
13 filters: {
14 activity_type: { in: $activity_type }
15 action: { in: $action }
16 pathway_definition_id: { in: $pathway_definition_id }
17 patient_id: { eq: $patient_id }
18 activity_status: { in: $activity_status }
19 }
20 pagination: { count: $count, offset: $offset }
21 sorting: { field: $sort_field, direction: $sort_direction }
22 ) {
23 pagination {
24 offset
25 count
26 total_count
27 }
28 sorting {
29 field
30 direction
31 }
32 activities {
33 id
34 stream_id # pathway id
35 date
36 subject {
37 id
38 name
39 type
40 }
41 action
42 object {
43 id
44 name
45 type
46 }
47 indirect_object {
48 id # typically the stakeholder id
49 name
50 type
51 }
52 resolution
53 status
54 }
55 }
56}

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 GetActivities(
02 $count: Float!
03 $offset: Float!
04 $sort_field: String!
05 $sort_direction: String!
06) {
07 activities(
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 activities {
21 ...Activity
22 }
23 }
24}

All in filters accept a list of values and result 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 conjuction of all filters.

  • json
01{
02 "action": ["ASSIGNED", "ACTIVATE"], // See ActivityAction enum
03 "activity_type": ["FORM", "MESSAGE"], // See ActivityObjectType enum
04 "activity_status": ["DONE", "ACTIVE"], // See ActivityStatus enum
05 "pathway_definition_id": ["{{ PATHWAY_DEFINITION_ID }}"],
06 "patient_id": "{{ PATIENT_ID }}",
07 "offset": 0,
08 "count": 20,
09 "sort_field": "date",
10 "sort_direction": "desc"
11 }

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 activities, or 100 activities from the 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 date field, in descending order (i.e. newest to oldest).

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