Mutations
Start a pathway and create a session to redirect to the Awell Hosted Pathway page
This page documents the startHostedPathwaySession
mutation but we recommend reading the "What are Awell Hosted Pages" page first and the full guide on how to get started with Awell in less than a day via the Awell Hosted Pathway integration.
- graphql
01mutation StartHostedPathwaySession($input: StartHostedPathwaySessionInput!) {02 startHostedPathwaySession(input: $input) {03 session_id04 session_url05 pathway_id06 stakeholder {07 id08 type09 name10 }11 }12}
pathway_definition_id
specifies what pathway definition needs to be started.
01{02 "input": {03 "pathway_definition_id": "{{PATHWAY_DEFINITION_ID}}",04 "success_url": "https://yourdomain.com/success.html",05 "cancel_url": "https://yourdomain.com/cancel.html"06 }07}
The success_url
and cancel_url
specify where the stakeholder should be redirected to when the care flow/pathway session is completed or canceled/interrupted respectively. If success_url
and cancel_url
are not specified, then static success and cancel pages will be shown in the Hosted Pages application.
01{02 "input": {03 "pathway_definition_id": "{{PATHWAY_DEFINITION_ID}}",04 "success_url": "https://yourdomain.com/success.html",05 "cancel_url": "https://yourdomain.com/cancel.html",06 "patient_id": "{{PATIENT_ID}}",07 "data_points": [],08 "language": "en"09 }10}
Languages should be passed as an ISO 639-1 shortcode.If no language is passed, it defaults to English.
Awell Hosted Pages is currently available in the following languages:
Every pathway is linked to a patient resource in our system. We automatically create an anonymous patient resource if patient_id
is left blank.
If you want to create a patient first, you will have to do an a priori API call to create the patient and use the id returned by that API call as the value for the patient_id
field. See the createPatient mutation for more information on how to create a patient.
You have the ability to pass some initial data when starting a pathway. What data you can pass on pathway start needs to be configured in Awell Studio via the settings (see Pathway > Settings > General
).
When your baseline data points are configured and your pathway is published, you can query the available baseline data points via the publishedPathwayDefinitions query.
There are
required
andoptional
baseline data points. A pathway will not be started until all required baseline data points have a value.
Passing baseline info is as easy as providing an array of objects in the following format
- json
01{02 "data_points": [03 {04 "data_point_definition_id": "{{DATA_POINT_DEFINITION_ID}}",05 "value": "{{DATA_POINT_VALUE}}"06 }07 ]08}
A session expires after 60 minutes but the timer is reset after every completion of an activity. A session also expires when there are no pending activities left in a pathway.