Doctorlink has joined HealthHerohealthheroLearn More
doctorlink
  • Home
  • Authentication
  • Traversal API
  • Example Responses
  • Traversal Client
  • Health Risk Assessment API
  • Advanced Techniques

Grouped Questions

Grouped Questions

A Grouped Question's response will depend on which API you are using:

Traversal API

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:

Figure 1: a group of two questions, displayed at the same time
Figure 1: a group of two questions, displayed at the same time

1{
2  "traversalId": "...",
3  "algoId": 4550,
4  "nodes": [
5    {
6      "nodeId": 532,
7      "assetId": 0,
8      "errors": [],
9      "displayText": null,
10      "title": null,
11      "explanation": null,
12      "data": null,
13      "questions": [
14        {
15          "nodeId": 532,
16          "questionId": 70,
17          "displayText": "What is your sex at birth?",
18          "title": null,
19          "answers": [
20            {
21              "nodeId": 532,
22              "questionId": 70,
23              "answerId": 88,
24              "controlType": "Radio",
25              "controlValue": null,
26              "controlChecked": false,
27              "displayText": "Male",
28              "explanation": "",
29              "data": {}
30            },
31            {
32              "nodeId": 532,
33              "questionId": 70,
34              "answerId": 89,
35              "controlType": "Radio",
36              "controlValue": null,
37              "controlChecked": false,
38              "displayText": "Female",
39              "explanation": "",
40              "data": {}
41            }
42          ],
43          "explanation": "This refers to your sex at birth. Many problems relate specifically to genetically male and female organs.",
44          "data": {}
45        }
46      ],
47      "isTable": false
48    },
49    {
50      "nodeId": 533,
51      "assetId": 0,
52      "errors": [],
53      "displayText": null,
54      "title": null,
55      "explanation": null,
56      "data": null,
57      "questions": [
58        {
59          "nodeId": 533,
60          "questionId": 19063,
61          "displayText": "How old are you?",
62          "title": null,
63          "answers": [
64            {
65              "nodeId": 533,
66              "questionId": 19063,
67              "answerId": 16309,
68              "controlType": "Number",
69              "controlValue": null,
70              "controlChecked": false,
71              "displayText": "years",
72              "explanation": "",
73              "data": {
74                "Properties": { "Align": "AnswerLeft", "NumericKeypad": "" }
75              }
76            }
77          ],
78          "explanation": "",
79          "data": {}
80        }
81      ],
82      "isTable": false
83    }
84  ],
85  "assessmentType": 0,
86  "algoName": "Age & Gender",
87  "errors": [],
88  "previousDisabled": true,
89  "nextDisabled": false,
90  "language": "DEFAULT"
91}

Chat Traversal API

The response for a grouped question on the Chat Traversal API will* only contain one question at a time. The next response will be the next question in the same group.

Step 1

For example, the first response for the above group (see Figure 1) will simply be the first question:

Figure 2a: first question of a group
Figure 2a: first question of a group

1{
2    "traversalId": "...",
3    "algoId": 4550,
4    "nodeId": 532,
5    "questions": [{
6            "algoId": 4550,
7            "nodeId": 532,
8            "questionId": 70,
9            "displayText": "What is your sex at birth?",
10            "title": null,
11            "answers": [{
12                    "nodeId": 532,
13                    "questionId": 70,
14                    "answerId": 88,
15                    "controlType": "Radio",
16                    "controlValue": null,
17                    "controlChecked": false,
18                    "displayText": "Male",
19                    "explanation": "",
20                    "data": {}
21                }, {
22                    "nodeId": 532,
23                    "questionId": 70,
24                    "answerId": 89,
25                    "controlType": "Radio",
26                    "controlValue": null,
27                    "controlChecked": false,
28                    "displayText": "Female",
29                    "explanation": "",
30                    "data": {}
31                }
32            ],
33            "explanation": "This refers to your sex at birth. Many problems relate specifically to genetically male and female organs.",
34            "data": {}
35        }
36    ],
37    "assessmentType": 0,
38    "errors": [],
39    "completed": false
40}

Step 2

The second response, once the first has been answered, will be :

Figure 2b: second question of a group
Figure 2b: second question of a group

1{
2    "traversalId": "...",
3    "algoId": 4550,
4    "nodeId": 533,
5    "questions": [{
6            "algoId": 4550,
7            "nodeId": 533,
8            "questionId": 19063,
9            "displayText": "How old are you?",
10            "title": null,
11            "answers": [{
12                    "nodeId": 533,
13                    "questionId": 19063,
14                    "answerId": 16309,
15                    "controlType": "Number",
16                    "controlValue": null,
17                    "controlChecked": false,
18                    "displayText": "years",
19                    "explanation": "",
20                    "data": {
21                        "Properties": {
22                            "Align": "AnswerLeft",
23                            "NumericKeypad": ""
24                        }
25                    }
26                }
27            ],
28            "explanation": "",
29            "data": {}
30        }
31    ],
32    "assessmentType": 0,
33    "errors": [],
34    "completed": false
35}

*Except in cases where footers (e.g. copyright, etc) and headers (e.g. titles) are present.