Mutations
Start a new pathway for a given patient
Care flows or pathways can only be started for patients so you need a patient resource first (more specifically the id of the patient) before you can start a pathway. You can create a new patient resource with the createPatient
mutation.
When starting a pathway, Awell Orchestration automatically chooses the most recent published version of the specified pathway definition.
Improved support for versioning is coming soon, with the ability to select a specific version when starting a new pathway and upgrading started pathways to newer version.
You have the ability to pass some initial data when starting a pathway with baseline data points. What data you can pass on pathway start needs to be configured in Awell Studio.
Configure baseline data points
When your baseline data points are configured and your pathway is published, you can query the available baseline data points via the publishedPathwayDefinitions
query (see documentation here).
There are
required
andoptional
baseline data points. A pathway will not be started until all required baseline data points have a value.
- graphql
01query GetPublishedPathwayDefinitions {02 publishedPathwayDefinitions {03 publishedPathwayDefinitions {04 id05 title06 dataPointDefinitions {07 id08 key09 valueType10 optional11 }12 }13 }14}
- graphql
01mutation StartPathway($input: StartPathwayInput!) {02 startPathway(input: $input) {03 pathway_id04 }05}
- json
01{02 "input": {03 "patient_id": "{{PATIENT_ID}}",04 "pathway_definition_id": "{{PATHWAY_DEFINITION_ID}}"05 }06}
- json
01{02 "input": {03 "patient_id": "{{PATIENT_ID}}",04 "pathway_definition_id": "{{PATHWAY_DEFINITION_ID}}",05 "data_points": [06 // Repeat for each input data point07 {08 "data_point_definition_id": "{{DATA_POINT_DEFINITION_ID}}",09 "value": "{{DATA_POINT_VALUE}}"10 }11 ]12 }13}
Given data point values are polymorphic, the value for a data point should always be sent as a string. Values are validated and deserialized on the Awell side and we will throw an error if a value does not match the corresponding data point value type.
In table below you can find an overview of all baseline data point types and the value type you should be sending to the Awell API.
Data point value type | Value type to send | Examples |
---|---|---|
date | ISO8601 string | "2023-01-01" |
number | string | "10" |
string | string | "Awell is great" |