Doctorlink has joined HealthHerohealthheroLearn More



Questions arrive in the response on a node. These, along with the answers, are the data points that all algorithms require to identify the next question.

	"answers": Answer[],
	"data": JSONObject,
	"displayText": "string",
	"explanation": "string",
	"nodeId": int,
	"questionId": int,
	"title": "string"

Answers : An array of answers to the question.

Data : A JSON object of data for this question. This can be used to tell the UI any special requirements, or simply as a system notification.

DisplayText : A message to the user.

Explanation : A more in-depth message to the user usually shown as a clickable information icon (:information_source:).

NodeId : Unique identifier of the node you're currently on.

QuestionId : Unique identifier of the question you're currently on.

Title : The title of the question.

Question Types

Mixed-answer | Grouped | Table

There are a few different types of questions that may pop up on your journey. These will be fairly obvious by the ControlType on the answers. For example, a question with the answer type Checkbox should allow the user to select more than one answer before responding. An answer type of Radio should, obviously, only let the user pick one from the list.

Note: Grouped and Table questions won't occur if you are using the ChatTraversals endpoints. These endpoints serve all questions one at a time.

Mixed answer Questions

Sometimes a combination of answer types will emerge, and you'll need to remember to handle those differently on the UI. If one were to recieve a mixture of Checkbox and Radio the UI should allow the user to pick either: many from the checkbox options, or one from the radio options. You should never be able to choose both a checkbox and a radio.

Likewise, a combination of Text and Radio - the user can fill out the textbox, or select a radio. Never both.

This could look something like this:


Grouped Questions

A response with multiple nodes is refered to as "grouped questions". They are displayed on the screen at the same time; usually because they are relevant to each other. These could look something like this:


Table Questions

A single node with multiple questions is usually displayed as a table where the answer's DisplayText are the column headers and the questions themselves are the rows. This could look something like this: