Created
April 17, 2018 20:10
-
-
Save nhz-io/9dc03beaf06687e2259970c7f408a148 to your computer and use it in GitHub Desktop.
serverMessages.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"state": "welcome.0", | |
"rule": { | |
"condition": "function greeting_logic(){var timeSinceLastLogin=persona.timeSinceLastLogin();var openCounter=persona.openAppCountToday();var deviceTime=persona.deviceTime();if(timeSinceLastLogin<=600){return{'nextState':'welcome.5'};}else if(openCounter==4){return{'nextState':'welcome.6'};}else if(deviceTime>=14400&&deviceTime<37800){return{'nextState':'welcome.1'};}else if(deviceTime>=37800&&deviceTime<54000){return{'nextState':'welcome.2'};}else if(deviceTime>=54000&&deviceTime<61200){return{'nextState':'welcome.3'};}else{return{'nextState':'welcome.4'};}} greeting_logic();" | |
} | |
}, | |
{ | |
"state": "welcome.1", | |
"cards": [ | |
{ | |
"id": "message", | |
"dynamicText": [ | |
{ | |
"token": "first_name", | |
"value": "user.firstName" | |
} | |
], | |
"text": [ | |
"Good morning %first_name%. π" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "drm_convo" | |
} | |
} | |
], | |
"conversation_start": true | |
} | |
] | |
}, | |
{ | |
"state": "welcome.2", | |
"cards": [ | |
{ | |
"id": "message", | |
"dynamicText": [ | |
{ | |
"token": "first_name", | |
"value": "user.firstName" | |
} | |
], | |
"text": [ | |
"Hi %first_name%. π" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "drm_convo" | |
} | |
} | |
], | |
"conversation_start": true | |
} | |
] | |
}, | |
{ | |
"state": "welcome.3", | |
"cards": [ | |
{ | |
"id": "message", | |
"dynamicText": [ | |
{ | |
"token": "first_name", | |
"value": "user.firstName" | |
} | |
], | |
"text": [ | |
"Good afternoon %first_name%. π" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "drm_convo" | |
} | |
} | |
], | |
"conversation_start": true | |
} | |
] | |
}, | |
{ | |
"state": "welcome.4", | |
"cards": [ | |
{ | |
"id": "message", | |
"dynamicText": [ | |
{ | |
"token": "first_name", | |
"value": "user.firstName" | |
} | |
], | |
"text": [ | |
"Good evening %first_name%. π" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "drm_convo" | |
} | |
} | |
], | |
"conversation_start": true | |
} | |
] | |
}, | |
{ | |
"state": "welcome.5", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"That was quick! Welcome back." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "drm_convo" | |
} | |
} | |
], | |
"conversation_start": true | |
} | |
] | |
}, | |
{ | |
"state": "welcome.6", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"You're on a roll! This is your fourth visit today so far. π" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "drm_convo" | |
} | |
} | |
] | |
} | |
], | |
"conversation_start": true | |
}, | |
{ | |
"state": "bg", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Would you like to provide a recent blood glucose (BG) reading?" | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Yes", | |
"payload": { | |
"nextState": "bg.add" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "No", | |
"payload": { | |
"nextState": "bg.5" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "bg.add", | |
"cards": [ | |
{ | |
"id": "bg.add", | |
"buttons": [ | |
{ | |
"type": "submit", | |
"payload": { | |
"nextState": "bg.submitted", | |
"conversation_shown": "bg" | |
} | |
}, | |
{ | |
"type": "cancel", | |
"payload": { | |
"nextState": "bg.5", | |
"conversation_shown": "bg" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "bg.submitted", | |
"rule": { | |
"condition": "function bgUnit(){if(persona.usesMgdL()){return{'nextState':'bg.4'};}else{return{'nextState':'bg.20'};}} bgUnit();" | |
} | |
}, | |
{ | |
"state": "bg.4", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Thanks! Recording your BG is the best way to track how often you stay in the zone of 80 - 180." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "bg.avgAvailable" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "bg.5", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"No problem! Let us know when you would like to focus on staying in your BG zone by reporting a BG reading." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "bg.13" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "bg.6", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Here's your BG readings so far today." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "bg.insights" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "bg.7", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Thank you!" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"conversation_ended": "bg" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "bg.20", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Thanks! Recording your BG is the best way to track how often you stay in the zone of 4 - 9." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "bg.avgAvailable" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "bg.avgAvailable", | |
"rule": { | |
"condition": "function avgAvailable() {var average = persona.bgAverage(7);if (average == -1) {return {'nextState': 'bg.7'};}else {return {'nextState': 'bg.6'}}}avgAvailable()" | |
} | |
}, | |
{ | |
"state": "bg.insights", | |
"cards": [ | |
{ | |
"id": "bg.insights", | |
"message_data": "bg.insight", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "bg.healthyZone" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "bg.averageTest", | |
"rule": { | |
"condition": "function checkBGAverage(){var average=persona.bgAverage(7);var lastReading=persona.lastBGReading();var threshold=0.1;var context={'average':average,'lastReading':lastReading};if(lastReading<average*(1-threshold)){return{'nextState':'bg.8','server_context':context};}else if(lastReading<=average*(1+threshold)){return{'nextState':'bg.9','server_context':context};}else if(persona.usesMgdL()){return{'nextState':'bg.10','server_context':context};}else{return{'nextState':'bg.21','server_context':context};}} checkBGAverage();" | |
} | |
}, | |
{ | |
"state": "bg.healthyZone", | |
"rule": { | |
"condition": "function bgUnit(){if(persona.usesMgdL()){return{'nextState':'bg.8'};}else{return{'nextState':'bg.10'};}} bgUnit();" | |
} | |
}, | |
{ | |
"state": "bg.8", | |
"cards": [ | |
{ | |
"id": "message", | |
"dynamicText": [ | |
{ | |
"token": "timeOfDay", | |
"value": "timeOfDay" | |
} | |
], | |
"text": [ | |
"The healthy BG range is 80 - 180. You can see all your readings in your dashboard." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Thanks", | |
"payload": { | |
"nextState": "bg.13" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Tell me more π", | |
"payload": { | |
"nextState": "bg.14" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "bg.10", | |
"cards": [ | |
{ | |
"id": "message", | |
"dynamicText": [ | |
{ | |
"token": "timeOfDay", | |
"value": "timeOfDay" | |
} | |
], | |
"text": [ | |
"The healthy BG range is 4 - 9. You can see all your readings in your dashboard." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Thanks", | |
"payload": { | |
"nextState": "bg.13" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Tell me more π", | |
"payload": { | |
"nextState": "bg.14" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "bg.13", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"That's all the BG info for now. π" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"conversation_ended": "bg" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "bg.21", | |
"cards": [ | |
{ | |
"id": "message", | |
"dynamicText": [ | |
{ | |
"token": "timeOfDay", | |
"value": "timeOfDay" | |
} | |
], | |
"text": [ | |
"The healthy BG range is 4 - 9. You can see all your readings in your dashboard." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Thanks", | |
"payload": { | |
"nextState": "bg.13" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Tell me more π", | |
"payload": { | |
"nextState": "bg.14" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "bg.14", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"To better understand your BG, try alternate testing times throughout the day." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "bg.15" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "bg.15", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Readings taken upon waking, before a meal, and 1 - 1.5 hours after a meal may provide different results, letting you know which times of day you are in or out of the range." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Thanks!", | |
"payload": { | |
"nextState": "bg.13" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "More info", | |
"payload": { | |
"nextState": "bg.18" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "bg.18", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"If you have a high reading after a meal, a 15-minute walk can help lower your BG." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "bg.19" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "bg.19", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"To keep post-meal BG in the zone, eat protein and fiber and limit processed starches/sugars. If issues persist, consult your doc about a meds adjustment." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "bg.13" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "meds", | |
"rule": { | |
"condition": "function checkUserTakeMeds(){var takesMeds=persona.takesMedication();if(persona.takesMedication()){return{'nextState':'meds.ask'}}else{return{'nextState':'drm_convo'}}} checkUserTakeMeds();" | |
} | |
}, | |
{ | |
"state": "meds.ask", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Have you taken any meds today?" | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Yes", | |
"payload": { | |
"nextState": "meds.add", | |
"profile": { | |
"takes_medication": true | |
} | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "No", | |
"payload": { | |
"nextState": "meds.cancel.logic", | |
"profile": { | |
"takes_medication": true | |
} | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Not taking meds", | |
"payload": { | |
"nextState": "meds.5", | |
"profile": { | |
"takes_medication": false | |
} | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "meds.add", | |
"cards": [ | |
{ | |
"id": "meds.add", | |
"buttons": [ | |
{ | |
"type": "submit", | |
"payload": { | |
"nextState": "meds.submitted", | |
"payload": { | |
"conversation_shown": "meds" | |
} | |
} | |
}, | |
{ | |
"type": "cancel", | |
"payload": { | |
"nextState": "meds.cancel.logic", | |
"payload": { | |
"conversation_shown": "meds" | |
} | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "meds.5", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Got it!" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"conversation_ended": "meds" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "meds.cancel.logic", | |
"rule": { | |
"condition": "function measurementType(){if(persona.usesMgdL()){return{'nextState':'meds.6'}}else{return{'nextState':'meds.20'}}} measurementType();" | |
} | |
}, | |
{ | |
"state": "meds.6", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"No problem! Add your meds anytime. Taking prescribed meds is key for staying in the BG zone of 80 - 180." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "meds.7" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "meds.7", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"The more meds you add, the better Brook can help you stay on track." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"conversation_ended": "meds" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "meds.20", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"No problem! Add your meds anytime. Taking prescribed meds is key for staying in the BG zone of 4 - 9." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "meds.7" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "meds.submitted", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Thanks!" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "meds.9" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "meds.9", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Want more info about diabetes meds?" | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "No, thanks", | |
"payload": { | |
"nextState": "meds.19" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Sure", | |
"payload": { | |
"nextState": "meds.12" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "meds.12", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"The best way to help your meds control your BG is consistency, taking the prescribed dose at the same time daily." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "meds.13" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "meds.13", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"If you notice your BG control declining, and you haven't changed diet or activity, consult your doc about a meds adjustment." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Got it!", | |
"payload": { | |
"nextState": "meds.19" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Tell me more π", | |
"payload": { | |
"nextState": "meds.16" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "meds.16", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"If you have trouble remembering to take your meds, try using a 7-day pill case kept in plain sight where you eat, log meds in Brook as you take them, and set a reminder notification in Brook." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "meds.17" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "meds.17", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Medication is not a magic band aid for diabetes; a nutrition and exercise plan along with your meds will give you the best control." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Thanks!", | |
"payload": { | |
"nextState": "meds.19" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "meds.19", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"No problem. Continue to log meds to stay on track and keep your BG in the zone." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"conversation_ended": "meds" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "sleep", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Would you like to have a look at your sleep analysis for last night?" | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Sure", | |
"payload": { | |
"nextState": "sleep.review", | |
"conversation_shown": "sleep" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Not now", | |
"payload": { | |
"nextState": "sleep.4", | |
"conversation_shown": "sleep" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "sleep.4", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Your sleep history can be found in the dashboard under historical data. In general, sleeping > 7 hours a night will result in better blood glucose (BG) and appetite control." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "drm_convo" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "sleep.review", | |
"cards": [ | |
{ | |
"id": "sleep.hours", | |
"message_data": "sleep.insight", | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Needs fixing", | |
"payload": { | |
"nextState": "sleep.20" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Looks good", | |
"payload": { | |
"nextState": "sleep.10" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "sleep.submitted", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Thanks, you're good to go! In general, sleeping > 7 hours a night will result in better BG and appetite control." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "sleep.10" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "sleep.10", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"You can see all your sleep history in your dashboard." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "OK", | |
"payload": { | |
"nextState": "drm_convo" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Tell me more π", | |
"payload": { | |
"nextState": "sleep.13" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "sleep.20", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"OK, you can tap directly on the graph to fix it up." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "sleep.10" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "sleep.13", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"When you sleep > 7 hours/night, your body releases more of the hormone leptin, which keeps you full, and less ghrelin, which makes you hungry." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "sleep.14" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "sleep.14", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Good sleep reduces cortisol in your blood. If you sleep < 7 hours/night, this stress hormone increases and can raise BG." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Got it", | |
"payload": { | |
"nextState": "drm_convo" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Anything else?", | |
"payload": { | |
"nextState": "sleep.17" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "sleep.17", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Tips for rest: go to sleep & wake up at similar times each day, limit screen time, darken your screen an hour before bed, and avoid eating within two hours of bedtime." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "sleep.18" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "sleep.18", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"To get to sleep earlier, go to bed 15 minutes earlier each night until you get to a bedtime of at least 7 hours of sleep." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Thanks!", | |
"payload": { | |
"nextState": "drm_convo" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "steps", | |
"rule": { | |
"condition": "function stepsInsight(){var todaySteps=persona.todaySteps();if(todaySteps==0){return{'nextState':'activity.2'}} else{return{'nextState':'activity.1'}}}stepsInsight();" | |
} | |
}, | |
{ | |
"state": "activity.1", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Let's look at today's activity levels..." | |
] | |
}, | |
{ | |
"id": "steps.insight", | |
"message_data": "steps.insight", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "activity.logic", | |
"conversation_shown": "steps" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "activity.2", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Want to hear interesting info about exercise?" | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "OK", | |
"payload": { | |
"nextState": "activity.26" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Not today", | |
"payload": { | |
"nextState": "activity.33" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "activity.logic", | |
"rule": { | |
"condition": "function stepsAverage(){var average=persona.stepsAverage(7);var todaySteps=persona.todaySteps();var server_context={'average':average};if(todaySteps<average*0.9){return{'nextState':'activity.5','server_context':server_context};}else if(todaySteps<average*1.05){return{'nextState':'activity.6','server_context':server_context};}else{return{'nextState':'activity.7','server_context':server_context};}} stepsAverage();" | |
} | |
}, | |
{ | |
"state": "activity.5", | |
"cards": [ | |
{ | |
"dynamicText": [ | |
{ | |
"token": "avg", | |
"value": "serverContext", | |
"serverContext": "average" | |
} | |
], | |
"id": "message", | |
"text": [ | |
"You're currently below your average daily steps of %avg% for this time of day." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "activity.motivate" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "activity.6", | |
"cards": [ | |
{ | |
"dynamicText": [ | |
{ | |
"token": "avg", | |
"value": "serverContext", | |
"serverContext": "average" | |
} | |
], | |
"id": "message", | |
"text": [ | |
"You're pretty close to your average daily steps of %avg%. Keep moving!" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "activity.encourage" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "activity.7", | |
"cards": [ | |
{ | |
"dynamicText": [ | |
{ | |
"token": "avg", | |
"value": "serverContext", | |
"serverContext": "average" | |
} | |
], | |
"id": "message", | |
"text": [ | |
"Well done! You beat your average daily steps for this time of day of %avg%." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Great!", | |
"payload": { | |
"nextState": "activity.10" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "activity.motivate", | |
"rule": { | |
"condition": "function measurementType(){if(persona.usesMgdL()){return{'nextState':'activity.8'};}else{return{'nextState':'activity.34'}}} measurementType();" | |
} | |
}, | |
{ | |
"state": "activity.8", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Keep moving to hit your daily average! Walking burns blood sugar and helps keep you in the BG zone of 80 - 180." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "OK", | |
"payload": { | |
"nextState": "activity.17" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Not today", | |
"payload": { | |
"nextState": "activity.16" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "activity.34", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Keep moving to hit your daily average! Walking burns blood sugar and helps keep you in the BG zone of 4 - 9." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "OK", | |
"payload": { | |
"nextState": "activity.17" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Not today", | |
"payload": { | |
"nextState": "activity.16" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "activity.encourage", | |
"rule": { | |
"condition": "function measurementType(){if(persona.usesMgdL()){return{'nextState':'activity.9'};}else{return{'nextState':'activity.35'}}} measurementType();" | |
} | |
}, | |
{ | |
"state": "activity.9", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Challenge yourself - see if you can beat your average by the end of the day. Walking burns blood sugar and helps keep you in the BG zone of 80 - 180." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "OK", | |
"payload": { | |
"nextState": "activity.19" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Not today", | |
"payload": { | |
"nextState": "activity.16" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "activity.35", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Challenge yourself - see if you can beat your average by the end of the day. Walking burns blood sugar and helps keep you in the BG zone of 4 - 9." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "OK", | |
"payload": { | |
"nextState": "activity.19" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Not today", | |
"payload": { | |
"nextState": "activity.16" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "activity.10", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"The more you move, the more blood sugar you burn. Keep it up!" | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "OK", | |
"payload": { | |
"nextState": "activity.20" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "activity.16", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"No problem! Any amount of activity can help lower blood sugar and move you towards controlling your BG target." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Thanks", | |
"payload": { | |
"nextState": "activity.33" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Tips please! π", | |
"payload": { | |
"nextState": "activity.26" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "activity.17", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Great! Check your activity in the dashboard at any time." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Thanks", | |
"payload": { | |
"nextState": "activity.33" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Tips please! π", | |
"payload": { | |
"nextState": "activity.26" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "activity.19", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Great! We'll provide activity insights throughout the day so you can challenge yourself!" | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Thanks", | |
"payload": { | |
"nextState": "activity.33" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Tips please! π", | |
"payload": { | |
"nextState": "activity.26" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "activity.20", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Check in with Brook to track your activity throughout the day and remember to log any exercise events too." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Thanks", | |
"payload": { | |
"nextState": "activity.33" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Tips please! π", | |
"payload": { | |
"nextState": "activity.26" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "activity.trend", | |
"rule": { | |
"condition": "function activityTrend() {var activityTrend = persona.activityTrend();if (activityTrend == false) {return {'nextState': 'activity.26'}}else {return {'nextState': 'activity.21'}}}activityTrend();" | |
} | |
}, | |
{ | |
"state": "activity.21", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Here's your activity trend for the last few days." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "activity.trend_insight" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "activity.trend_insight", | |
"cards": [ | |
{ | |
"id": "activity.trend", | |
"message_data": "activity.insight_trend", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "activity.trend_logic" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "activity.trend_logic", | |
"rule": { | |
"condition": "function activityGoal() {var trend = persona.activityTrend();var goal = persona.activityGoal();if (trend < goal * .80) {return {'nextState': 'activity.22'};} else if (trend > goal * 1.20) {return {'nextState': 'activity.34'};} else {return {'nextState': 'activity.23'};}}activityGoal();" | |
} | |
}, | |
{ | |
"state": "activity.22", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"You've been trending below your target activity. Try to get moving a bit more if you can. Message the Brook Team for some helpful tips." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Thanks", | |
"payload": { | |
"nextState": "activity.33" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Tips please! π", | |
"payload": { | |
"nextState": "activity.26" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "activity.34", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Your trend is pretty close to your target activity. Good job. Keep it up." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Thanks", | |
"payload": { | |
"nextState": "activity.33" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Tips please! π", | |
"payload": { | |
"nextState": "activity.26" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "activity.23", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Well done, you are trending above your target activity. Keep moving to help with your BG control." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Thanks", | |
"payload": { | |
"nextState": "activity.33" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Activity tips please! π", | |
"payload": { | |
"nextState": "activity.26" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "activity.26", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"A great way to lower post-meal BG is a 15 - 20 minute walk." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "activity.27" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "activity.27", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"When you are active, cells take up sugar from your blood without needing as much insulin to do so. " | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Cool, thanks", | |
"payload": { | |
"nextState": "activity.33" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "More", | |
"payload": { | |
"nextState": "activity.30" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "activity.30", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"To start or increase your walking program, add 500 steps a day for a week." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "activity.31" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "activity.31", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"The next week, add 500 more steps a day, and continue each week until you reach your goal step count. Brook will keep track for you!" | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Thanks!", | |
"payload": { | |
"conversation_ended": "exercise" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "activity.33", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"No problem! Every bit of activity helps." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"conversation_ended": "exercise" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "food", | |
"rule": { | |
"condition": "function food_time_logic(){var deviceTime=persona.deviceTime();if(deviceTime>=14400&&deviceTime<37800){return{'nextState':'food.1','deviceTime':deviceTime};}else if(deviceTime>=37800&&deviceTime<45000){return{'nextState':'food.2','deviceTime':deviceTime};}else if(deviceTime>=45000&&deviceTime<54000){return{'nextState':'food.3','deviceTime':deviceTime};}else if(deviceTime>=54000&&deviceTime<61200){return{'nextState':'food.4','deviceTime':deviceTime};}else{return{'nextState':'food.5','deviceTime':deviceTime};}} food_time_logic();" | |
} | |
}, | |
{ | |
"state": "food.1", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Today is a new day, have you eaten breakfast yet?" | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Yes", | |
"payload": { | |
"nextState": "food.add", | |
"conversation_shown": "food" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Not yet", | |
"payload": { | |
"nextState": "food.cancel", | |
"conversation_shown": "food" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "food.2", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Would you like to log what you've eaten or drank today?" | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Yes", | |
"payload": { | |
"nextState": "food.add", | |
"conversation_shown": "food" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Not yet", | |
"payload": { | |
"nextState": "food.cancel", | |
"conversation_shown": "food" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "food.3", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Have you had something for lunch yet?" | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Yes", | |
"payload": { | |
"nextState": "food.add", | |
"conversation_shown": "food" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Not yet", | |
"payload": { | |
"nextState": "food.cancel", | |
"conversation_shown": "food" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "food.4", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Would you like to log something you've eaten or drank today?" | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Yes", | |
"payload": { | |
"nextState": "food.add", | |
"conversation_shown": "food" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Not yet", | |
"payload": { | |
"nextState": "food.cancel", | |
"conversation_shown": "food" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "food.5", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Would you like to add your evening meal?" | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Yes", | |
"payload": { | |
"nextState": "food.add", | |
"conversation_shown": "food" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Not yet", | |
"payload": { | |
"nextState": "food.cancel", | |
"conversation_shown": "food" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "food.add", | |
"cards": [ | |
{ | |
"id": "food.add", | |
"buttons": [ | |
{ | |
"type": "submit", | |
"payload": { | |
"nextState": "food.submitted" | |
} | |
}, | |
{ | |
"type": "cancel", | |
"payload": { | |
"nextState": "food.cancel" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "food.submitted", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Great! By keeping track of what you eat and drink, you can see how it impacts your BG." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "OK, thanks!", | |
"payload": { | |
"nextState": "food.19" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Tips please π", | |
"payload": { | |
"nextState": "food.12" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "food.cancel", | |
"rule": { | |
"condition": "function measurementType(){if(persona.usesMgdL()){return{'nextState':'food.8'}}else{return{'nextState':'food.20'}}} measurementType();" | |
} | |
}, | |
{ | |
"state": "food.8", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"No problem! Consider recording your food and drink today. It's one of the best tools for keeping your BG in the zone of 80 - 180." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "OK", | |
"payload": { | |
"conversation_ended": "food" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Tell me more", | |
"payload": { | |
"nextState": "food.12" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "food.20", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"No problem! Consider recording your food and drink today. It's one of the best tools for keeping your BG in the zone of 4 - 9." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "OK", | |
"payload": { | |
"conversation_ended": "food" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Tell me more", | |
"payload": { | |
"nextState": "food.12" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "food.12", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Carbohydrates include starches and sugars. This food group raises BG the most." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "food.13" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "food.13", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"However, starches with fiber, such as whole grains and beans, cause a slower rise in BG, giving your body time to burn sugar and prevent a BG spike." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Got it!", | |
"payload": { | |
"nextState": "food.19" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Tell me more", | |
"payload": { | |
"nextState": "food.16" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "food.16", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"BG spikes cause fat storage and overwork your pancreas. Food with fiber and less processed starch and sugar helps with both BG and weight control." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "food.17" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "food.17", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Meals and snacks with protein and fiber helps with BG control. Try nuts or hummus!" | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Cool, thanks!", | |
"payload": { | |
"nextState": "food.19" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "food.19", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Regular meals can help control weight and keep your BG in the safe zone." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"conversation_ended": "food" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "food.endNoInsight", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Let us know when you have more food and drink to log - it helps with both weight and BG control." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"conversation_ended": "food" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "food.insights", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Here's your food and drink history for today so far. You can view other days in the dashboard." | |
] | |
}, | |
{ | |
"id": "food.insights", | |
"message_data": null | |
} | |
] | |
}, | |
{ | |
"state": "exercise", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Today is a new day, have you exercised yet?" | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Not yet", | |
"payload": { | |
"nextState": "exercise.4", | |
"conversation_shown": "exercise" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Yes!", | |
"payload": { | |
"nextState": "exercise.add", | |
"conversation_shown": "exercise" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "exercise.4", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"No problem! Let us know when you do. Even short bursts of activity help you stay in the healthy BG zone." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "exercise.6" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "exercise.add", | |
"cards": [ | |
{ | |
"id": "exercise.add", | |
"buttons": [ | |
{ | |
"type": "submit", | |
"payload": { | |
"nextState": "exercise.submitted" | |
} | |
}, | |
{ | |
"type": "cancel", | |
"payload": { | |
"nextState": "exercise.4" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "exercise.submitted", | |
"rule": { | |
"condition": "function measurementType(){if(persona.usesMgdL()){return{'nextState':'exercise.5'}}else{return{'nextState':'exercise.17'}}} measurementType();" | |
} | |
}, | |
{ | |
"state": "exercise.5", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Great! Activity is one of the best ways to lower BG and stay in the BG zone of 80 - 180." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "exercise.6" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "exercise.17", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Great! Activity is one of the best ways to lower BG and stay in the BG zone of 4 - 9." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "exercise.6" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "exercise.6", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Want to hear interesting info about physical activity? π" | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "No", | |
"payload": { | |
"nextState": "exercise.16" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Yes, please!", | |
"payload": { | |
"nextState": "exercise.9" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "exercise.9", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"When you walk, cells take up sugar from your blood without needing any insulin to do so." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "exercise.10" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "exercise.10", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Activity helps lower BG without making your pancreas work too hard." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Thanks", | |
"payload": { | |
"nextState": "exercise.16" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "More info", | |
"payload": { | |
"nextState": "exercise.13" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "exercise.13", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Moderate physical activity is getting your heart rate up to where you can talk, but not sing." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "exercise.14" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "exercise.14", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"For heart health, aim for 30 minutes a day of moderate activity, or three 10-minute sessions." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Great", | |
"payload": { | |
"nextState": "exercise.16" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "exercise.16", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"You can see your steps and exercise in the dashboard." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"conversation_ended": "exercise" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "demo.bg.add", | |
"cards": [ | |
{ | |
"id": "bg.add", | |
"buttons": [ | |
{ | |
"text": "OK", | |
"value": "ok" | |
}, | |
{ | |
"text": "Cancel", | |
"value": "cancel" | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "demo.1", | |
"cards": [ | |
{ | |
"dynamicText": [ | |
{ | |
"token": "time_of_day", | |
"value": "timeOfDay" | |
} | |
], | |
"id": "message", | |
"text": [ | |
"Good %time_of_day%. Let's have a look at your bg data.", | |
"You've had less than your average for the last three days in a row." | |
] | |
}, | |
{ | |
"id": "sleep.demo.hours", | |
"message_data": "sleep.demo.insight" | |
}, | |
{ | |
"id": "message", | |
"text": [ | |
"Not enough sleep may increase your blood sugar levels." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "How does that work?", | |
"payload": { | |
"nextState": "demo.7" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Makes sense, got it.", | |
"payload": { | |
"nextState": "demo.8" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "demo.7", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Feeling tired makes your body crave more food, leading to higher blood sugar levels." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "OK", | |
"payload": { | |
"nextState": "demo.8" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "demo.8", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"It's Thursday. Are you going for your usual bike ride?" | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Yes", | |
"payload": { | |
"nextState": "demo.11" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Not today", | |
"disabled": true | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "demo.11", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"It's going to be warm out today. Burning more energy may push your blood sugars down. How about taking an extra snack on the trip like a muesli bar?" | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "I will", | |
"disabled": true | |
}, | |
{ | |
"type": "answer", | |
"title": "I'm really tired of muesli", | |
"payload": { | |
"nextState": "demo.14" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "demo.14", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Understood. It can be hard to eat the same thing every time.", | |
"Brook bike riders like you recommend the following snack options." | |
] | |
}, | |
{ | |
"id": "demo.insight.community", | |
"data": null, | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Thanks for the tip!", | |
"payload": { | |
"nextState": "demo.18" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "demo.18", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"No problem. Talk soon." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"conversation_shown": "demo" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "demo.19", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Thanks for that. You're looking good and in your zone for this time of day." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Great!", | |
"payload": { | |
"nextState": "demo.21" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "demo.21", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Did you take your usual meds today?" | |
] | |
}, | |
{ | |
"id": "demo.insight.meds", | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Yes", | |
"payload": { | |
"nextState": "demo.23" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "No", | |
"payload": { | |
"nextState": "demo.23" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "demo.23", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Thanks", | |
"You've had a great day today for BG as well." | |
] | |
}, | |
{ | |
"id": "bg.insights", | |
"message_data": "bg.demo.insight" | |
}, | |
{ | |
"id": "message", | |
"text": [ | |
"Keep up the good work" | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "OK", | |
"payload": { | |
"conversation_shown": "demo_2" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "demo.27", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"OK, thanks.", | |
"That is your highest reading today." | |
] | |
}, | |
{ | |
"id": "bg.insights", | |
"message_data": "bg.demo.insight" | |
}, | |
{ | |
"id": "message", | |
"text": [ | |
"Activity usually helps you get back in your zone. Would you like a tip for getting some extra activity before lunch?" | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Sure", | |
"payload": { | |
"nextState": "demo.33" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Not now", | |
"disabled": true | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "demo.33", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Here is a walking route to lunch. It will only take an extra 20 minutes and this much exercise usually helps drop your sugar levels." | |
] | |
}, | |
{ | |
"id": "demo.insight.route", | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Sounds good!", | |
"payload": { | |
"nextState": "demo.37" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Not today", | |
"disabled": true | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "demo.37", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Great, enjoy!" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"conversation_shown": "demo_3" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "onboarding_0_7.1", | |
"onboarding": true, | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Welcome to Brook, your Intelligent Diabetes Assistant! Providing simple, savvy, data driven support to help you stay in a healthy blood sugar zone.", | |
"Brook talks to you through chat like this π¬. You are able to respond by tapping the buttons at the screen bottom π. Have a try." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Like this?", | |
"payload": { | |
"nextState": "onboarding_0_7.4" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "onboarding_0_7.4", | |
"onboarding": true, | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Exactly! π. We need a little info from you to get you setup. We will show you a card for you to enter some details for your account." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "I already have an account", | |
"payload": { | |
"nextState": "onboarding_0_7.login", | |
"serverContext": { | |
"action": "signIn" | |
} | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "OK", | |
"payload": { | |
"nextState": "onboarding_0_7.login", | |
"serverContext": { | |
"action": "register" | |
} | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "onboarding_0_7.login", | |
"onboarding": true, | |
"cards": [ | |
{ | |
"id": "user.register", | |
"buttons": [ | |
{ | |
"type": "login", | |
"payload": { | |
"nextState": "onboarding_0_7.6", | |
"action": "login" | |
} | |
}, | |
{ | |
"type": "register", | |
"payload": { | |
"nextState": "onboarding_0_7.6", | |
"action": "register" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "onboarding_0_7.6", | |
"rule": { | |
"condition": "function onboardingStep() { return {'nextState' : persona.onboardingStep() } } onboardingStep();" | |
} | |
}, | |
{ | |
"state": "onboarding_0_7.14", | |
"onboarding": true, | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Hi, welcome back. You have been signed out of Brook.\nYou can sign in again now." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Yes please", | |
"payload": { | |
"nextState": "onboarding_0_7.login", | |
"serverContext": { | |
"action": "signIn" | |
} | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "I'm a new user", | |
"payload": { | |
"nextState": "onboarding_0_7.login", | |
"serverContext": { | |
"action": "register" | |
} | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "onboarding_0_7.7", | |
"onboarding": true, | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Welcome back to Brook, your Intelligent Diabetes Companion! Providing simple, savvy, data driven support to help you stay in a healthy blood sugar zone.", | |
"Brook talks to you through chat like this π¬. You are able to respond by tapping the buttons at the screen bottom π. Have a try." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Like this?", | |
"payload": { | |
"nextState": "onboarding_0_7.11" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "onboarding_0_7.11", | |
"onboarding": true, | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Exactly! π" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "onboarding_0_7.26" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "onboarding_0_7.26", | |
"onboarding": true, | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Let's get started. We need a little info from you to get you setup. We will show you a card for you to enter some details for your account." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "OK", | |
"payload": { | |
"nextState": "onboarding_0_7.profile" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "onboarding_0_7.profile", | |
"onboarding": true, | |
"cards": [ | |
{ | |
"id": "input.profile", | |
"buttons": [ | |
{ | |
"type": "submit", | |
"payload": { | |
"nextState": "onboarding_0_7.10" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "onboarding_0_7.10", | |
"onboarding": true, | |
"cards": [ | |
{ | |
"id": "message", | |
"dynamicText": [ | |
{ | |
"token": "first_name", | |
"value": "user.firstName" | |
} | |
], | |
"text": [ | |
"Thanks %first_name%, your account and profile is all setup. π We can now personalize the experience just for you." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "onboarding_0_7.12" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "onboarding_0_7.12", | |
"onboarding": true, | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Brook lets you add your data as well as auto-managing some collection like steps and sleep. Let's give it a try.", | |
"Tell Brook what you last ate π² by tapping on the + icon in the bottom right of the screen βοΈ" | |
], | |
"buttons": [ | |
{ | |
"type": "report_activity", | |
"activity": "food", | |
"payload": { | |
"nextState": "onboarding_0_7.reportedFood", | |
"conversation_shown": "food" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "onboarding_0_7.reportedFood", | |
"rule": { | |
"condition": "function foodCarbSize(){var carbSize=persona.lastCarbSize(); var state; if(carbSize=='small'){state='onboarding_0_7.16';}else if(carbSize=='medium'){state='onboarding_0_7.17';}else{state='onboarding_0_7.18';} return{'nextState':state}} foodCarbSize();" | |
} | |
}, | |
{ | |
"state": "onboarding_0_7.16", | |
"onboarding": true, | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Thanks and good job on keeping the carbs down. The more you log with Brook, the better we'll be able to help you get better control. You can see your logged data in the dashboards and will be providing you great insights as you log more data." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "onboarding_0_7.19" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "onboarding_0_7.17", | |
"onboarding": true, | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Thanks and good job on keeping the carbs to medium. The more you log with Brook, the better we'll be able to help you get better control. You can see all your logged data in the dashboards and will be providing you great insights as you log more data." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "onboarding_0_7.19" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "onboarding_0_7.18", | |
"onboarding": true, | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Great thanks. High carb meals like this have a big impact on your blood glucose control. Remember to get some exercise to balance it out. You can see all your logged logged data in the dashboards and will be providing you great insights as you log more data." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "onboarding_0_7.19" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "onboarding_0_7.19", | |
"rule": { | |
"condition": "function permissions(){if(persona.usingAndroid()){return{'nextState':'onboarding_0_7.19_android'};}else{return{'nextState':'onboarding_0_7.19_ios'};}} permissions();" | |
} | |
}, | |
{ | |
"state": "onboarding_0_7.19_android", | |
"onboarding": true, | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Nearly ready to get going. We just need permission for a few devices features so Brook can give you more personal insights and help. Brook never shares info without your permission - promise. " | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "OK", | |
"payload": { | |
"nextState": "onboarding_0_7.permissions" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "onboarding_0_7.19_ios", | |
"onboarding": true, | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Nearly ready to get going. We just need permission for a few iPhone features so Brook can give you more personal insights and help. Brook never shares info without your permission - promise. " | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "OK", | |
"payload": { | |
"nextState": "onboarding_0_7.permissions" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "onboarding_0_7.permissions", | |
"onboarding": true, | |
"cards": [ | |
{ | |
"id": "user.permissions", | |
"buttons": [ | |
{ | |
"type": "submit", | |
"payload": { | |
"nextState": "onboarding_0_7.21" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "onboarding_0_7.21", | |
"onboarding": true, | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Thanks. You can modify permissions in your device's settings." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "onboarding_0_7.31" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "onboarding_0_7.31", | |
"onboarding": true, | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Would you like to see a tutorial for getting the most out of Brook?" | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Not now", | |
"payload": { | |
"nextState": "onboarding_0_7.24" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "OK", | |
"payload": { | |
"nextState": "onboarding_0_7.23" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "onboarding_0_7.23", | |
"onboarding": true, | |
"cards": [ | |
{ | |
"id": "tutorial", | |
"title": [ | |
"Welcome to Brook", | |
"Log data to stay in the zone", | |
"Connect with diabetes specialists", | |
"Become an active community member" | |
], | |
"text": [ | |
"Your assistant to help you get you in the safe zone", | |
"Share your day with Brook for better insights and recommendations", | |
"Brook experts help you build your plan and manage your diabetes", | |
"Share your insights and help your community" | |
], | |
"buttons": [ | |
{ | |
"type": "submit", | |
"payload": { | |
"nextState": "onboarding_0_7.24" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "onboarding_0_7.24", | |
"onboarding": true, | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Questions about anything and everything? Message the Brook Team anytime under your chat contacts. We're here for you! π¬", | |
"Woohoo! π You're now all setup and good to go." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "OK", | |
"payload": { | |
"conversation_shown": "onboarding", | |
"nextState": "drm_convo", | |
"profile": { | |
"firstUse": false | |
} | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "init.17", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": "Would you like to provide your medications routine?", | |
"buttons": [ | |
{ | |
"text": "Yes", | |
"value": "yes" | |
}, | |
{ | |
"text": "No thanks", | |
"value": "no" | |
}, | |
{ | |
"text": "Later", | |
"value": "later" | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "init.17.1", | |
"cards": [ | |
{ | |
"id": "meds.routine.setup", | |
"buttons": [ | |
{ | |
"text": "OK", | |
"value": "ok" | |
}, | |
{ | |
"text": "Cancel", | |
"value": "cancel" | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "init.17.2", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"OK Thanks." | |
] | |
} | |
] | |
}, | |
{ | |
"state": "init.17.3", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"OK. You can set it up later in the settings." | |
] | |
} | |
] | |
}, | |
{ | |
"state": "init.17.4", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Thanks. Will ask to confirm at routine times." | |
] | |
} | |
] | |
}, | |
{ | |
"state": "init.19", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Looks like you are all done and ready to go. Talk soon!" | |
] | |
} | |
] | |
}, | |
{ | |
"state": "mood.0", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Knowing how you're feeling is like is very helpful for managing your diabetes.", | |
"Would you like to provide some data on how you are feeling?" | |
], | |
"buttons": [ | |
{ | |
"text": "Sure", | |
"value": "yes" | |
}, | |
{ | |
"text": "Not now, thanks", | |
"value": "no" | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "mood.1", | |
"cards": [ | |
{ | |
"id": "mood.add", | |
"buttons": [ | |
{ | |
"text": "OK", | |
"value": "ok" | |
}, | |
{ | |
"text": "Cancel", | |
"value": "cancel" | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "mood.2", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": "Thanks!" | |
} | |
], | |
"response_message": { | |
"state": "mood.2" | |
} | |
}, | |
{ | |
"state": "mood.5", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": "OK. You can add your mood and any other data at any time. Talk soon." | |
} | |
] | |
}, | |
{ | |
"state": "mood.6", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": "That's great for now. Remember to log all your data in Brook - the more you log, the better your management." | |
} | |
] | |
}, | |
{ | |
"state": "a1c", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Looking at your A1c", | |
"Your A1c is < 7%. The ADA recommendation for A1c goal is < 7%, so you are at goal." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Got it, thanks", | |
"payload": { | |
"nextState": "a1c.cancel" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Tell me more", | |
"payload": { | |
"nextState": "a1c.1" | |
} | |
} | |
] | |
}, | |
{ | |
"id": "message", | |
"text": [ | |
"Mantain", | |
"Your A1c is < 7%. The ADA recommendation for A1c goal is < 7%, so you are at goal." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Got it, thanks", | |
"payload": { | |
"nextState": "a1c.cancel" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Tell me more", | |
"payload": { | |
"nextState": "a1c.1" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "conversation.end", | |
"cards": [ | |
{ | |
"id": "markdown", | |
"data": { | |
"textTokens": [ | |
"%unreadMessages%" | |
] | |
}, | |
"text": [ | |
"You currently have %unreadMessages% unread messages from your contacts" | |
], | |
"unreadMessage": true, | |
"image": "server.png" | |
} | |
] | |
}, | |
{ | |
"state": "generalTip", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Tip of the day for you!" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "generalTip.2" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "generalTip.2", | |
"cards": [ | |
{ | |
"id": "markdown", | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Got it!", | |
"payload": { | |
"nextState": "generalTip.4", | |
"conversation_shown": "generalTip" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "generalTip.4", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"If you have any questions, ping us a message in the Brook Team channel." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"conversation_ended": "generalTip" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "reportActivity", | |
"nextState": { | |
"bg": "bg.submitted", | |
"food": "food.submitted", | |
"exercise": "exercise.submitted", | |
"meds": "meds.submitted", | |
"sleep": "sleep.submitted", | |
"a1c": "a1c.submitted" | |
} | |
}, | |
{ | |
"state": "steps.daily.notification", | |
"text": "Brook update! #TOTAL_STEPS# steps so far today", | |
"time": "16:00", | |
"range": 180 | |
}, | |
{ | |
"state": "rate_brook", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Are you enjoying Brook? If so, please consider giving us a rating in the App Store. It helps a lot." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Rate Brook", | |
"payload": { | |
"nextState": "rate_brook.review", | |
"rated_app": true, | |
"rated_ask": true | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Not now", | |
"payload": { | |
"nextState": "rate_brook.later", | |
"rated_ask": true | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Give feedback", | |
"payload": { | |
"nextState": "rate_brook.feedback", | |
"rated_ask": true | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "rate_brook.feedback", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"We would love to hear your views on Brook, both good and not-so-good. Please message the Brook Team in your contact chat on the left. Thanks." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"conversation_shown": "rate_brook", | |
"nextState": "drm_convo" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "rate_brook.later", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"You can rate Brook in the App Store at any time. Thanks." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"conversation_shown": "rate_brook", | |
"nextState": "drm_convo" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "rate_brook.review", | |
"cards": [ | |
{ | |
"id": "rate_brook_app", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"conversation_shown": "rate_brook", | |
"nextState": "drm_convo" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "socialConvo", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"you have reached social convo test" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "tier4" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "first_insight", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Brook is always looking to provide you with helpful insights both in chat and your Dashboards." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "first_insight.2" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "first_insight.2", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Working on your first insight...." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "first_insight.logic" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "first_insight.logic", | |
"rule": { | |
"condition": "function firstInsight(){return{'nextState':persona.firstInsight()}}firstInsight();" | |
} | |
}, | |
{ | |
"state": "latest_version", | |
"rule": { | |
"condition": "" | |
} | |
}, | |
{ | |
"state": "update_version", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"There is a new Brook app version available. Please update now to get all the new features and improvements." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Update now", | |
"payload": { | |
"nextState": "linkToStoreForUpdate", | |
"conversation_shown": "latest_version" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Update later", | |
"payload": { | |
"id": "message", | |
"text": [ | |
"You can update the Brook app in the iPhone App Store when you're ready." | |
], | |
"conversation_shown": "latest_version", | |
"nextState": "drm_convo" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "latest_features", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"You're on the latest Brook version. Thanks for downloading the update." | |
] | |
}, | |
{ | |
"id": "message", | |
"text": [ | |
"We have a load of new features. Would you like a quick run through?" | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Yes", | |
"payload": { | |
"nextState": "latest_features.tips" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "No", | |
"payload": { | |
"nextState": "latest_features.end" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "latest_features.tips", | |
"cards": [ | |
{ | |
"id": "latest_features", | |
"payload": { | |
"nextState": "latest_features.end" | |
} | |
} | |
] | |
}, | |
{ | |
"state": "latest_features.end", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"You can see all Brook features in the Help section or ask the Brook Team in you contact chat." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"conversation_shown": "latest_version", | |
"nextState": "drm_convo" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "done", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"You're all caught up!", | |
"If you have more to share, please add the data card via the bottom right button. Thanks!" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"conversation_ended": "done" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "goodbye", | |
"rule": { | |
"condition": "function convoEnder() {var runTipOfTheDay = persona.timeBetweenConvos('last_tip_date', 1);var deviceTime = persona.deviceTime();if (runTipOfTheDay){return {'nextState': 'generalTip'};}else if (deviceTime >= 14400 && deviceTime < 37800) {return {'nextState': 'goodbye.1'};} else if (deviceTime >= 37800 && deviceTime < 54000) {return {'nextState': 'goodbye.2'};} else if (deviceTime >= 54000 && deviceTime < 61200) {return {'nextState': 'goodbye.3'};} else {return {'nextState': 'goodbye.4'};}}convoEnder();" | |
} | |
}, | |
{ | |
"state": "goodbye.1", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"That's all for now. Have a good morning." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"conversation_shown": "goodbye", | |
"conversation_ended": "goodbye" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "onboarding_0_7.19", | |
"rule": { | |
"condition": "function permissions(){if(persona.usingAndroid()){return{'nextState':'onboarding_0_7.19_android'};}else{return{'nextState':'onboarding_0_7.19_ios'};}} permissions();" | |
} | |
}, | |
{ | |
"state": "onboarding_0_7.19_android", | |
"onboarding": true, | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Nearly ready to get going. We just need permission for a few device features so Brook can give you more personal insights and help. Brook never shares info without your permission - promise. " | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "OK", | |
"payload": { | |
"nextState": "onboarding_0_7.permissions" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "goodbye.2", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"That's great for now. Hope you enjoy your day. Bye." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"conversation_shown": "goodbye", | |
"conversation_ended": "goodbye" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "goodbye.3", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Be sure to log any additional food or other data. The more the better for lowering BG! Thanks." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"conversation_shown": "goodbye", | |
"conversation_ended": "goodbye" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "goodbye.4", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Let us know if you have any other data to report from today. Have a good evening." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"conversation_shown": "goodbye", | |
"conversation_ended": "goodbye" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "test", | |
"rule": { | |
"condition": "function loginSetup() {persona.testSetup(); persona.tier3Setup(); { return {'nextState': 'test.setup'};}}loginSetup();" | |
} | |
}, | |
{ | |
"state": "test.setup", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Test tier 2 and 3 setup complete" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "tier2Logic" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "tier2", | |
"rule": { | |
"condition": "function tier2() {var loginTotal = persona.totalLoginCount();var contactTutorial = persona.isConversationCompleted('contact_tutorial_convo');var ratingConvo = persona.isConversationCompleted('rating_convo');var feedbackConvo = persona.isConversationCompleted('feedback_convo');var healthPermissions = persona.isConversationCompleted('perm_health_accepted');var motionPermissions = persona.isConversationCompleted('perm_motion_accepted');var locationPermissions = persona.isConversationCompleted('perm_location_accepted');var notificationPermissions = persona.isConversationCompleted('perm_notification_accepted');var permissionsConvo = persona.isConversationCompleted('permissions_convo');var howWeDoIt = persona.isConversationCompleted('how_we_do_it_convo');var socialConvo = persona.isConversationCompleted('social_convo');if (loginTotal == 5 && !contactTutorial) {persona.conversationCompleted('contact_tutorial_convo');return {'nextState': 'test.contact'};} else if (loginTotal == 7 && !ratingConvo) {persona.conversationCompleted('rating_convo');return {'nextState': 'test.rate'};} else if (loginTotal == 10 && !feedbackConvo) {persona.conversationCompleted('feedback_convo');return {'nextState': 'test.feedback'};} else if (loginTotal == 15 && !socialConvo) {persona.conversationCompleted('social_convo');return {'nextState': 'socialConvo'};} else if ((!healthPermissions || !motionPermissions || !locationPermissions || !notificationPermissions) && !permissionsConvo) {persona.conversationCompleted('permissions_convo');return {'nextState': 'test.permissionRequest'};} else if (!howWeDoIt) {persona.conversationCompleted('how_we_do_it_convo');return {'nextState': 'test.howWedoIt'};} else {return {'nextState': 'tier4'};}}tier2();" | |
} | |
}, | |
{ | |
"state": "test.contact", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"you have reached contact form test" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "tier4" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "test.rate", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"you have reached rate brook test" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "tier4" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "test.feedback", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"you have reached feedback convo test" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "tier4" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "test.permissionRequest", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"you have reached permission request convo test" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "test.permissionRequest.data" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "test.permissionRequest.data", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Brook works with data to help give you insights" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "test.permissionRequest.maximise" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "test.permissionRequest.maximise", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"we need permissions to maximise the ways we can help you" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "tier4" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "test.how_we_do_it", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"you have reached how we do it convo test" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "tier4" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "test.how_we_do_it.intro", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Brook is always working. Want to see how?" | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Yes", | |
"payload": { | |
"nextState": "test.how_we_do_it.education1" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "No", | |
"payload": { | |
"nextState": "test.how_we_do_it.cancel" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "test.how_we_do_it.cancel", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"No prob in help or ask" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "tier4" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "test.how_we_do_it.education1", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"No prob in help or ask" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "ttest.how_we_do_it.education2" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "test.how_we_do_it.education2", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"No prob in help or ask" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "tier4" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "test.how_we_do_it.intro", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Brook is always working. Want to see how?" | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Yes", | |
"payload": { | |
"nextState": "test.how_we_do_it.education1" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "No", | |
"payload": { | |
"nextState": "test.how_we_do_it.cancel" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "test.how_we_do_it.cancel", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"No prob in help or ask" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "tier4" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "test.how_we_do_it.education1", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"No prob in help or ask" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "ttest.how_we_do_it.education2" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "test.how_we_do_it.education2", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"No prob in help or ask" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "tier4" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "tier3", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"you have reached tier3 test" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "tier3Logic" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "tier3Logic", | |
"rule": { | |
"condition": "function tier3Logic() {var socialConvoEligible = persona.timeBetweenConvos('last_social_date', 84);if (socialConvoEligible) {return {'nextState': 'socialConvo'};} else {return {'nextState': 'tier4'};}}tier3Logic();" | |
} | |
}, | |
{ | |
"state": "socialConvo", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"you have reached social convo test" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "tier4" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "tier4", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"you have reached tier4 test" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"conversation_shown": "tier4" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "request_permissions", | |
"rule": { | |
"condition": "function permissions(){if(persona.usingAndroid()){return{'nextState':'request_permissions_android'};}else{return{'nextState':'request_permissions_ios'};}} permissions();" | |
} | |
}, | |
{ | |
"state": "request_permissions_android", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Hi, Brook needs to ask for your device permissions." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "OK", | |
"payload": { | |
"nextState": "request_permissions.1" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "request_permissions_ios", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Hi, Brook needs to ask for your iPhone permissions." | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "OK", | |
"payload": { | |
"nextState": "request_permissions.1" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "request_permissions.1", | |
"onboarding": true, | |
"cards": [ | |
{ | |
"id": "user.permissions", | |
"buttons": [ | |
{ | |
"type": "submit", | |
"payload": { | |
"nextState": "drm_convo" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "diabetes", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Brook works best when we understand a bit about your diabetes. We'd like to ask you a few question so we know how best to help you get better control. " | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "OK", | |
"payload": { | |
"nextState": "diabetes.5" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Later", | |
"payload": { | |
"nextState": "diabetes.4" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "diabetes.4", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"No problem. You can set you diabetes infromation inside the Profile section of the app." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "drm_convo", | |
"conversation_shown": "diabetes", | |
"conversation_ended": "diabetes" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "diabetes.5", | |
"cards": [ | |
{ | |
"id": "init.disease.add", | |
"buttons": [ | |
{ | |
"type": "submit", | |
"payload": { | |
"nextState": "diabetes.6" | |
} | |
}, | |
{ | |
"type": "cancel", | |
"payload": { | |
"nextState": "diabetes.7" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "diabetes.6", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Fantastic, thank you! We can now optimize your program just for you." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "diabetes.7" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "diabetes.7", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Have you had a recent A1c reading that you'd like to log?" | |
], | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Yes", | |
"payload": { | |
"nextState": "a1c.add" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "No", | |
"payload": { | |
"nextState": "diabetes.12" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "a1c.add", | |
"cards": [ | |
{ | |
"id": "a1c.add", | |
"buttons": [ | |
{ | |
"type": "submit", | |
"payload": { | |
"nextState": "diabetes.11" | |
} | |
}, | |
{ | |
"type": "cancel", | |
"payload": { | |
"nextState": "diabetes.12" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "diabetes.11", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"Thanks" | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "diabetes.12" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "diabetes.12", | |
"cards": [ | |
{ | |
"id": "message", | |
"text": [ | |
"You can log your A1c readings and see your trend graphs in the Profile section of the app." | |
], | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "drm_convo", | |
"profile": { | |
"diabetes_conversation_completed": true | |
}, | |
"conversation_shown": "diabetes", | |
"conversation_ended": "diabetes" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "resetter", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"dynamicText": [ | |
{ | |
"token": "%name%", | |
"value": "user.firstName" | |
} | |
], | |
"text": [ | |
"Would you like to reset your persona winter holiday flags?" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Yes", | |
"payload": { | |
"nextState": "34a34930e10211e780d1e756dd5fd5a0" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "No", | |
"payload": { | |
"nextState": "continue" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "34a34930e10211e780d1e756dd5fd5a0", | |
"_modeler": true, | |
"rule": { | |
"condition": "function resetter() { ; if ((function(){ persona.setModeler({ });return true;})()) { return {\"nextState\":\"continue\"} } }; resetter();" | |
} | |
}, | |
{ | |
"state": "Winter Holiday Recipes", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Do you prefer Brussels sprouts or greens?" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Sprouts", | |
"payload": { | |
"nextState": "857455a0-d560-11e7-a048-bd4d130335f7" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Greens", | |
"payload": { | |
"nextState": "1acc68f0-d560-11e7-a048-bd4d130335f7" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "857455a0-d560-11e7-a048-bd4d130335f7", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Give this a taste:" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "9ad7a550-d560-11e7-a048-bd4d130335f7" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "9ad7a550-d560-11e7-a048-bd4d130335f7", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Whisk together olive oil, balsamic vinegar, minced garlic, salt and pepper in a large bowl" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "ae621650-d560-11e7-a048-bd4d130335f7" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "ae621650-d560-11e7-a048-bd4d130335f7", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Toss halved Brussels sprouts in oil mixture and roast at 450Β°F for 20-25 minutes" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "bb784e90-d560-11e7-a048-bd4d130335f7" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "bb784e90-d560-11e7-a048-bd4d130335f7", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"After roasting, sprinkle with additional balsamic vinegar to taste and serve warm. Yum π" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "Winter Holiday Question 3" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "1acc68f0-d560-11e7-a048-bd4d130335f7", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Test out this simple greens recipe" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "3461a280-d560-11e7-a048-bd4d130335f7" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "3461a280-d560-11e7-a048-bd4d130335f7", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Bring reduced sodium chicken or veggie broth to a boil in a large saucepan" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "49c9fb40-d560-11e7-a048-bd4d130335f7" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "49c9fb40-d560-11e7-a048-bd4d130335f7", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Add red pepper flakes and greens (spinach, kale, collards, etc.) cut into 1-inch strips" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "5e04f790-d560-11e7-a048-bd4d130335f7" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "5e04f790-d560-11e7-a048-bd4d130335f7", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Reduce heat to a simmer and cook covered, stirring occasionally, for about 1 hour or until tender" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "71bc1de0-d560-11e7-a048-bd4d130335f7" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "71bc1de0-d560-11e7-a048-bd4d130335f7", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Serve as a delicious and nutritious side to any holiday meal" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "Winter Holiday Question 3" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "Winter Holiday Question 0", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Would you like to chat about the Winter Holidays?" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Sure π", | |
"payload": { | |
"nextState": "Winter Holiday Question 1" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "No thanks", | |
"payload": { | |
"nextState": "Winter Holiday End" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "Winter Holiday Question 3", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Hungry for a sweet potato recipe? π " | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "No thanks", | |
"payload": { | |
"nextState": "Winter Holiday End" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Sure π", | |
"payload": { | |
"nextState": "Winter Holiday Sweet Potato Recipe" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "not-welcome", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"REMOVE THIS ON PRODUCTION" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "resetter" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "Winter Holiday Question 2", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Want to chat more about holiday eating?" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "No thanks", | |
"payload": { | |
"nextState": "Winter Holiday End" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Yes π", | |
"payload": { | |
"nextState": "169f4bf0-d55e-11e7-a048-bd4d130335f7" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "169f4bf0-d55e-11e7-a048-bd4d130335f7", | |
"_modeler": true, | |
"rule": { | |
"condition": "function winter_holiday_portion_logic() { var flags = persona.getModeler() || { };\nvar winter = flags.winter_1z || { };\nvar seen = winter.seenWinterHolidayPortions || false;\nwinter.seenWinterHolidayPortions = true;\nflags.winter_1z = winter;\npersona.setModeler(flags);; if (!seen) { return {\"nextState\":\"Winter Holiday Portions\"} };if (seen) { return {\"nextState\":\"00afa550-d55f-11e7-a048-bd4d130335f7\"} } }; winter_holiday_portion_logic();" | |
} | |
}, | |
{ | |
"state": "00afa550-d55f-11e7-a048-bd4d130335f7", | |
"_modeler": true, | |
"rule": { | |
"condition": "function winter_holiday_food_choice_logic() { var flags = persona.getModeler() || { };\nvar winter = flags.winter_1z || { };\nvar seen = winter.seenWinterHolidayFoodChoiceLogic || false;\nwinter.seenWinterHolidayFoodChoiceLogic = true;\nflags.winter_1z = winter;\npersona.setModeler(flags);; if (seen) { return {\"nextState\":\"5b5c6240-d55f-11e7-a048-bd4d130335f7\"} };if (!seen) { return {\"nextState\":\"Winter Holiday Food Choices\"} } }; winter_holiday_food_choice_logic();" | |
} | |
}, | |
{ | |
"state": "5b5c6240-d55f-11e7-a048-bd4d130335f7", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Great! Let's chat recipes ποΈ" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "Winter Holiday Recipes" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "Winter Holiday Convo", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Winter is coming βοΈ brr!" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "a7103020-d552-11e7-b93e-d7af467434a9" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "a7103020-d552-11e7-b93e-d7af467434a9", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"...but with winter comes holidays. Hooray! π" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "bfac63b0-d552-11e7-b93e-d7af467434a9" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "bfac63b0-d552-11e7-b93e-d7af467434a9", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"...and with many holidays comes food choices galore! So let's chat about food π²" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "Winter Holiday Question 1" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "Winter Holiday Eating", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Holiday foods are yummy...but making a healthy plate can be challenging" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "2ad925e0-d555-11e7-a048-bd4d130335f7" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "2ad925e0-d555-11e7-a048-bd4d130335f7", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Do you want to chat about portion sizes or food choices?" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Portions π±", | |
"payload": { | |
"nextState": "Winter Holiday Portions" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Food choices βοΈ", | |
"payload": { | |
"nextState": "Winter Holiday Food Choices" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "Winter Holiday Cooking", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Want some holiday cooking tips or do you want to skip to the recipes?" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Recipes ποΈ", | |
"payload": { | |
"nextState": "Winter Holiday Recipes" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Tips π", | |
"payload": { | |
"nextState": "Winter Holiday Cooking Tips" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "Winter Holiday End", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Enjoy the holiday season βοΈ " | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "a53b4660e04511e7bc8b930ebed4a010" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "a53b4660e04511e7bc8b930ebed4a010", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Remember, the Brook Experts are standing by if you want to chat" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "drm_convo" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "Winter Holiday Sweet Potato Recipe", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Great! Do you like your sweet potatoes on the sweet or savory side?" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Savory", | |
"payload": { | |
"nextState": "c1274610-d561-11e7-a048-bd4d130335f7" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Sweet", | |
"payload": { | |
"nextState": "13feb3a0-d562-11e7-a048-bd4d130335f7" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "c1274610-d561-11e7-a048-bd4d130335f7", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"For a savory spin, toss diced sweet potatoes with olive oil, red pepper flakes, thyme, salt and pepper" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "d4d4f680-d561-11e7-a048-bd4d130335f7" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "d4d4f680-d561-11e7-a048-bd4d130335f7", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Or try them with olive oil, cayenne pepper, garlic, and salt" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "e4d49310-d561-11e7-a048-bd4d130335f7" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "e4d49310-d561-11e7-a048-bd4d130335f7", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Roast in the oven at 400 Β°F until tender and browned" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "f6027670-d561-11e7-a048-bd4d130335f7" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "f6027670-d561-11e7-a048-bd4d130335f7", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Sweet and savory. Yes please!" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "Winter Holiday End" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "13feb3a0-d562-11e7-a048-bd4d130335f7", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Traditional holiday recipes often have you add sugar to sweet potatoes...sugar overload!" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "2bda2f40-d562-11e7-a048-bd4d130335f7" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "2bda2f40-d562-11e7-a048-bd4d130335f7", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Instead, try swapping out some sugar for spices like cinnamon, nutmeg and cloves to ramp up the natural sweetness" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "3f33a530-d562-11e7-a048-bd4d130335f7" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "3f33a530-d562-11e7-a048-bd4d130335f7", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Ditch the marshmallow topping for pecans to add some crunch and healthy fat!" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "53c68580-d562-11e7-a048-bd4d130335f7" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "53c68580-d562-11e7-a048-bd4d130335f7", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Voila! A little crunch, a little spice, a lot of yum π" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "Winter Holiday End" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "Winter Holiday Portions", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"With the bounty of foods at holiday meals, it's a good idea to think about portion sizes π±" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "79b69ac0-d55b-11e7-a048-bd4d130335f7" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "79b69ac0-d55b-11e7-a048-bd4d130335f7", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Start with non-starchy veggies, like carrots, collard greens, and Brussels sprouts, and make these about half your plate π½οΈ" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "What next?", | |
"payload": { | |
"nextState": "bda029e0-d55b-11e7-a048-bd4d130335f7" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "bda029e0-d55b-11e7-a048-bd4d130335f7", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Next, carbohydrates (carbs) like bread, sweet potatoes and corn should fill about a quarter of your plate. The remaining quarter of your plate is for protein" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "d9bf90c0-d55b-11e7-a048-bd4d130335f7" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "d9bf90c0-d55b-11e7-a048-bd4d130335f7", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"If you choose to have a holiday treat, keep the portion small and savor every bite" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "3c8d2500-d55c-11e7-a048-bd4d130335f7" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "3c8d2500-d55c-11e7-a048-bd4d130335f7", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Remember to eat regular meals throughout the day for more steady blood glucose (BG) and hunger levels" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "Winter Holiday Question 2.1" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "Winter Holiday Question 1", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"During the holidays are you more interested in eating or cooking?" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Cooking π©βπ³", | |
"payload": { | |
"nextState": "Winter Holiday Cooking" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "Eating π΄", | |
"payload": { | |
"nextState": "Winter Holiday Eating" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "Winter Holiday Food Choices", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Holiday gatherings come with a lot of tasty food choices βοΈ How to decide?!" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "6343a440-d565-11e7-a048-bd4d130335f7" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "6343a440-d565-11e7-a048-bd4d130335f7", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"It's a good idea to choose foods that keep blood sugar (BG) steady - think non-starchy veggies, high-fiber carbs & healthy fats" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Tell me more", | |
"payload": { | |
"nextState": "83b9bb10-d565-11e7-a048-bd4d130335f7" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "83b9bb10-d565-11e7-a048-bd4d130335f7", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"At holiday meals, find non-starchy veggies like broccoli, kale, and green beans" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "9d11eba0-d565-11e7-a048-bd4d130335f7" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "9d11eba0-d565-11e7-a048-bd4d130335f7", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Choose high-fiber carbs like winter squash, black eyed peas, and brown rice over white bread or Russet potatoes" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "ac3272d0-d565-11e7-a048-bd4d130335f7" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "ac3272d0-d565-11e7-a048-bd4d130335f7", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"and don't forget to include foods with healthy fats, like pecans, walnuts, or olive oil. Delicious!" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "Winter Holiday Question 2.1" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "Winter Holiday Convo Manager", | |
"_modeler": true, | |
"rule": { | |
"condition": "function winter_holiday_convo_logic_1() { var flags = persona.getModeler() || { };\nvar winter = flags.winter_1z || { };\nvar seen = winter.seenWinterHolidayConvo || false;\nwinter.seenWinterHolidayConvo = true;\nflags.winter_1z = winter;\npersona.setModeler(flags);; if (!seen) { return {\"nextState\":\"Winter Holiday Convo\"} };if (seen) { return {\"nextState\":\"4e0517f0e05811e7b006c3140db6db26\"} } }; winter_holiday_convo_logic_1();" | |
} | |
}, | |
{ | |
"state": "4e0517f0e05811e7b006c3140db6db26", | |
"_modeler": true, | |
"rule": { | |
"condition": "function winter_holiday_convo_logic_2() { var flags = persona.getModeler() || { };\nvar winter = flags.winter_1z || { };\nvar seen = winter.seenWinterHolidayQuestion0 || false;\nwinter.seenWinterHolidayQuestion0 = true;\nflags.winter_1z = winter;\npersona.setModeler(flags);; if (seen) { return {\"nextState\":\"welcome.0\"} };if (!seen) { return {\"nextState\":\"Winter Holiday Question 0\"} } }; winter_holiday_convo_logic_2();" | |
} | |
}, | |
{ | |
"state": "Winter Holiday Cooking Tips", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Holiday foods are fun to cook, share, and they can easily be part of a healthy plate π½οΈ" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "d40363c0-d563-11e7-a048-bd4d130335f7" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "d40363c0-d563-11e7-a048-bd4d130335f7", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"If you're doing some of the cooking, try to include some healthy fats" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "e37c6b30-d563-11e7-a048-bd4d130335f7" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "e37c6b30-d563-11e7-a048-bd4d130335f7", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"If you're making a sweet potato casserole, add walnuts or pecans. Try roasting veggies in olive oil instead of whipping them up with butter" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "fe3f9d70-d563-11e7-a048-bd4d130335f7" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "fe3f9d70-d563-11e7-a048-bd4d130335f7", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"How about some recipe ideas for winter veggies?" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Sure π", | |
"payload": { | |
"nextState": "Winter Holiday Recipes" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "No thanks", | |
"payload": { | |
"nextState": "e3bdbc10e4dc11e79c09cb45e510343f" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "e3bdbc10e4dc11e79c09cb45e510343f", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"OK π" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "drm_convo" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "Winter Holiday Question 2.1", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"Want to chat more about holiday eating?" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "answer", | |
"title": "Yes π", | |
"payload": { | |
"nextState": "Winter Holiday Recipes" | |
} | |
}, | |
{ | |
"type": "answer", | |
"title": "No thanks", | |
"payload": { | |
"nextState": "74a18550e4dc11e79c09cb45e510343f" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "74a18550e4dc11e79c09cb45e510343f", | |
"_modeler": true, | |
"cards": [ | |
{ | |
"text": [ | |
"OK π" | |
], | |
"id": "message", | |
"buttons": [ | |
{ | |
"type": "messageReceived", | |
"payload": { | |
"nextState": "drm_convo" | |
} | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"state": "welcome", | |
"_modeler": true, | |
"rule": { | |
"condition": "function convo_manager() { ; if (true) { return {\"nextState\":\"Winter Holiday Convo Manager\"} };if (false) { return {\"nextState\":\"welcome.0\"} } }; convo_manager();" | |
} | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment