Overview
This document should hopefully help you when you need to make changes to the scenarios. I've broken it down into different types of changes and certain steps that need to be taken.
Keep track of the String IDs you add or make changes to. You can send this list to the translations team so they only have to focus on the content that's changed.
Test changes on the go by using the Health Bot's editors 'Run' button
Keep at least two tabs open: 1 of localization tool to quickly make text changes and 1 for the scenario you are currently editing.
Types of Changes
- Purely text changes (often a 'decimal' version, 65.1, etc)
- Structural changes
- Adding a new question
- Adding new symptoms / changing question answer choices
Unique Scenario Blocks
Scenario Breakdown
Wrapper Scenario
The wrapper scenario is the beginning scenario and holds just a few / statements and questions:
This is the best place to put information that is of interest to US Citizen and/or the CDC, but not necessary for core guidance. That way the cores can be used by other countries or other departments without much modification.
- Disclaimer
- US or outside US
- State / US Jurisdiction location
- Zipcode
- User Experience questions (at the end after the core scenarios execute)
Core Scenario
Pathways
The scenarios / algorithms are broken into four files for adult symptomatic questions, adult asymptomatic questions, questions for people who are vaccinated against Covid-19, and pediatric questions. The pathways within the pediatric and vaccinated cores tend to have three major pathways: Asymptomatic, COVID-19 Exposure, and No Exposure. The adult pathway has the asymptomatic pathway broken out into it's own file. Those pathways are broken down even further depending on symptoms and COVID test results. In the image below (from a much earlier version of the bot), the 3 major paths are labeled. Any questions that come before these questions in the scenario determine which scenario the user will take and which options are show. The documents from the Health Bot team are split in the exact same way so it makes it easy to determine where the changes are made.
(Please note, the pathways are much more complicated than this now, but still follow these groupings, as shown in this screenshots from the adult and juvenile cores from January, 2021)
Exposure Pathway
The Exposure Pathway is broken down into three further paths: 1+ primary COVID symptom, only secondary COVID symptoms, and only "Other symptoms". See the image below that defines those breakdowns within the scenario. The symptoms are selected in the "COV" question that happens before either pathway. The primary and secondary symptoms change depending on CDC guidance and are defined in the algorithm that you receive from the Health Bot team.
No Exposure Pathway
The No Exposure Pathway is broken down into four further paths: 2+ primary COVID symptoms, 1+ primary COVID symptom, only secondary COVID symptoms, and only "Other symptoms". See the image below that defines those breakdowns within the scenario. The symptoms are selected in the "COV" question that happens before either pathway. The primary and secondary symptoms change depending on CDC guidance and are defined in the algorithm that you receive from the Health Bot team.
Question and Message IDs
The messages that are presented to the user have now been marked with IDs in the documentation. This makes it very easy for debugging when a tester finds a certain path is not yielding the correct responses.
Text Changes
If the changes that need to be made a purely text changes to existing text, you can make those changes directly in the localization tool. Open the localization tool and search for the string ID of the content you want to change.
If you are not sure of the string ID you want to change, then open the 'DICT' block and look within there. The string ID should be named appropriately for their purpose. For example, the intro message's string ID is CDC/messages/intro_msg. Another way of finding the string ID of the text you want to change is by figuring out the block it is used in. The names of the scenario blocks describe their content. Open the block for edit and see which scenario variable is being used in it. You can then go to the 'DICT' object and search for that variable.
Structural Changes
Structural changes happen when content is added, removed, and/or moved around. These types of changes typically only happen when there's a new algorithm version from the Health Bot team.
Adding a new question
If you need to add a new question, first figure out which scenario it should go in and where in the scenario. The way I do that is by determining if the question falls within a 'pathway', or if it's a beginning question (like Age) before there are any algorithm pathways. Use the information in the Scenario Breakdown section of this page to determine in which scenario to make the change. Further determine in which pathway the question should go or if it's a beginning question (like age or gender).
- Add all text content to the Localization tool.
- Import the text string in the DICT block and set that to an appropriately named variable. If it's a question that needs both 3rd person and 2nd person then make sure to add it to both questions objects.
- Add the question to the scenario in the appropriate place.
- Test that the question is reachable and the answer choices are displayed and function correctly.
- Add the question property and answer to the Outcome block.
- Test that the Outcome log data looks correctly in PowerBI. (I usually wait until I've finished all visual changes and then do full end-to-end tests with the data Team). More information about this can be found here.
- Copy the new Outcome block code to all Outcome blocks in the scenario you are changing. (You will send this new block to Ravi & the Data Team eventually). There are a lot of Outcome blocks. I usually wait until I'm sure the new block is working with the data team before I update all of them. If you have to make a change to it, then you'd have to make a change to all of them again.
Adding a new symptom to an existing question
Because the symptoms list changes often, there are special steps you have to take to make sure the bot displays information correctly and the information from bot sessions comes out correctly.
- First figure out which question you want to change and determine the name of the symptoms variable you want to change.
- Add the new symptom to localization tool. Since it's an existing question, find search for the question in the tool and add the new string in the same format. For ex. if the question we are working on is the COVID symptoms question. The new string ID would be CDC/covid_symptoms/new_symptom, where new_symptom is a string that is unique enough to know what answer choice / symptom it's referring to.
- Import the new symptom in the DICT block in the appropriate object.
- Add the new symptom and it's index to the Index Lookup block. The index is typically just the last index number + 1.
- Add the new symptom to the Symptoms block in the position it should appear in the bot UI.
- Go through texts and make sure that the symptom appears in the correct position in the list.
- Follow the steps in adding and new question for making sure that the data looks correct.
Changing non-symptoms type question answer options
Changing non-symptoms type answer options can sometimes just mean updating the string in the Localization tool. If the string is used for more than one question, however, you may need to create a new variable.
- First figure out the string ID you want to change in the Localization tool.
- Figure out which question you want to change and determine the name of the variable you want to change.
- You can do that by finding the prompt scenario block and looking at the 'Choices Array' field. It will say something like scenario.dictionary.responses.<something>
- Go to the DICT block and look for the variable. Next to it, it will say customLocalizedString["<stringID>"]. That string ID is what you will search for in the Localization tool
- Search for that string ID in the localization tool. If this variable is used for another question that doesn't need the new option, then you need to create a new string.
- If you don't need to create a new string, then the string is most likely an array.
- Add the new option in the correct position to the variable array
- Test to make sure the option appears in the correct position in the scenario
- If you need to create a new string,
- Choose an appropriate string ID label and add an array with all of the options needed
- Import the new string in the DICT block in the scenario, most likely in the "responses" object
- Update the question block to use the new variable you just defined in the DICT block
- Test to make sure the option appears in the correct position in the scenario
Changing comorbidities
Because the comorbidities list changes often, there are special steps you have to take to make sure the bot displays information correctly and the information from bot sessions comes out correctly. Extra care needs to be taken if comorbidites are added or the order is changed because there is some special handling of the "Pregnancy" comorbidity based on age and sex.
- For comorbidities that just need a text change, figure out which comorbidity you want to change and determine the name of the comorbidity variable you want to change, and change as needed
- If you need to add comorbidities, add the new comorbidity to localization tool. Since it's an existing question, find search for a comorbidty in the tool and add the new string in the same format. The new string ID would be CDC/comorbidity/new_comorbidity, where new_comorbidity is a string that is unique enough to know what answer choice / symptom it's referring to.
- Import the new symptom in the DICT block in the comorbidity object.
- Add the new symptom and it's index to the Index Lookup block. The index is typically just the last index number + 1.
- Add the new symptom to the Symptoms block in the position it should appear in the bot UI.
- If the order of the comorbidities was adjusted, you'll need to adjust some question logic
- Make a note of the index at which the "pregnancy" string exists in the Symptoms code, starting count with 0.
- find the "Risk List" block and adjust the index in the if-statement to the new index of the "pregnancy" string.
- Go through texts and make sure that the symptom appears in the correct position in the list.
- Go through the texts and make sure that "Pregnancy" comorbidity option is not shown for males or women older than 60