Awell Health Developer Hub
Dev Hub

This query lets us fetch all of the pathway activities of any status for a specific orchestrated pathway, including system activities such as calculations or activations.

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

Request

Query

01

Variables

01

How to use

Get all pending user activities

An orchesrated care flow consists of system activities and user actionable activities (forms, messages, checklists, ...). System activities are activities related to the Orchestration of the care flow whereas user actionable activities are the actual activities a stakeholder (eg: patient) needs to interact with.

In most cases, you're only interested in the user actionable activities which you can get by filtering the activities array by the isUserActivity field.

Additionally, you can filter the results by status === 'ACTIVE' to only get the pending activities.

The query doesn't support server-side filtering yet so the filters have to be applied on the response of the query.

Filter activities by stakeholder

User actionable activities need to be completed by a certain stakeholder. The stakeholder who needs to complete an activity is determined by the stakeholder you assigned to an action in Awell Studio. To get all pending activities for a given stakeholder, you can filter on the activity.indirect_object.type and the activity.indirect_object.name field.

Example:
If you'd like to get all pending activities for the patient, you can filter the activities array by activity.indirect_object.type === PATIENT.

The table below can help you with filtering activities for the right stakeholder:

Stakeholder type
(activity.indirect_object.type)

Stakeholder name
(activity.indirect_object.name)

PATIENT

Name of the actual patient as stored in the Awell patient profile

STAKEHOLDER

Nurse

STAKEHOLDER

Physician

STAKEHOLDER

Dietician

STAKEHOLDER

(any other stakeholder that is not the patient)

Including Form Content in Form Activities

To simplify obtaining the content of a form for a form activity, there are two options:

  • as with all actions, you can use the activity.object.id and the related getter query (e.g. GetForm, GetMessage) to fetch the content you need
  • expand this query by including the form field at the activity root (see ...Form in the query above), along with the form fields you are interested in. The schema of a form is identical to what you would use in the GetForm query:
01

For non-Form activities, this field will return null. Currently, the form field is only available on this activity query.

Form and question metadata is returned in all form queries as a JSON string rather than a JSON object. This is because the metadata is defined in Studio as a JSON string and we want to avoid any potential parsing errors. You can parse the metadata string into a JSON object in your application (for example, using JSON.parse in JavaScript/TypeScript, json.loads in Python or json_decode in PHP or Ruby).

Example:
If you'd like to get all pending activities for the patient, you can filter the activities array by activity.indirect_object.type === PATIENT.

Examples