Questionnaire

A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection.

https://hl7.org/fhir/R4/questionnaire.html

See our Zendesk article for information about how to create and upload a questionnaire in Canvas.

Understanding Canvas Questionnaires

Codings

All questionnaires must have coding, and all response options within a question on a questionnaire must have codings.

Question Types

Canvas supports 3 different type of questions:

1. Multi select responses allowed questions are denoted with:

"type": "choice", "repeats": true

2. Single select response questions are denoted with:

"type": "choice", "repeats": false

3. Free text responses questions are denoted with:

"type": "text", "repeats": false

Questions can be reused in multiple questionnaires, but any given question code should only appear once within a particular questionnaire.

Attributes

id
string

The identifier of the Questionnaire

name

Name for this questionnaire (computer friendly)

status
string

The status of this questionnaire. Enables tracking the life-cycle of the content.

description
string

Natural language description of the questionnaire. May contain markdown syntax.

code
array[json]

Concept that represents the overall questionnaire

item
array[json]

Questions and sections within the Questionnaire

get
/Questionnaire/{id}

Questionnaire read

Read an Questionnaire resource.

Path Parameters

id required
string
The unique identifier for the Questionnaire

Responses

200 OK
Request was successful.

Errors

401 Unauthorized
The request requires user authentication.
403 Forbidden
The request requires user authorization.
404 Not Found
The requested resource was not found.

Query Parameters

_id
string

The identifier of the Questionnaire

code
string

A code that corresponds to one of its items in the questionnaire

A Questionnaire search of the form /Questionnaire?code=456789 will return Questionnaire resources uploaded to Canvas that have a question with the code 456789.

name
string

Computationally friendly name of the questionnaire

questionnaire-code
string

The questionnaire the answers are provided for

A Questionnaire search of of the form /Questionnaire?questionnaire-code=711013002 will return Questionnaire resources uploaded to Canvas that have the code 711013002.

status
string

The current status of the questionnaire

Supported codes for search interactions are: active, **retired

Responses

200 OK
Request was successful.

Errors

400 Bad Request
The request was invalid or cannot be otherwise served. An accompanying error message will explain further.
401 Unauthorized
The request requires user authentication.
403 Forbidden
The request requires user authorization.
  • curl --request GET \
         --url 'https://fumage-example.canvasmedical.com/Questionnaire/<id>' \
         --header 'Authorization: Bearer <token>' \
         --header 'accept: application/json'
    
  • import requests
    
    url = "https://fumage-example.canvasmedical.com/Questionnaire/<id>"
    
    headers = {
        "accept": "application/json",
        "Authorization": "Bearer <token>"
    }
    
    response = requests.get(url, headers=headers)
    
    print(response.text)
    
  • {
        "resourceType": "Questionnaire",
        "id": "47a408d7-9f1d-4cfd-97c7-aa810df9ed39",
        "name": "Exercise",
        "status": "active",
        "description": "No Description Provided",
        "code": [
            {
                "system": "http://snomed.info/sct",
                "code": "404684003"
            }
        ],
        "item": [
            {
                "linkId": "d82e29db-0cac-4b97-a5aa-9e81749686e2",
                "code": [
                    {
                        "system": "http://snomed.info/sct",
                        "code": "228448000"
                    }
                ],
                "text": "Do you exercise on a regular basis?",
                "type": "choice",
                "repeats": false,
                "answerOption": [
                    {
                        "valueCoding": {
                            "system": "http://snomed.info/sct",
                            "code": "LA33-6",
                            "display": "Yes"
                        }
                    },
                    {
                        "valueCoding": {
                            "system": "http://snomed.info/sct",
                            "code": "LA32-8",
                            "display": "No"
                        }
                    }
                ]
            },
            {
                "linkId": "f2419de1-a208-4a3f-9d55-ba9bd5ed4ec2",
                "code": [
                    {
                        "system": "http://snomed.info/sct",
                        "code": "228449008"
                    }
                ],
                "text": "In an average week, how many days do you exercise?",
                "type": "choice",
                "repeats": false,
                "answerOption": [
                    {
                        "valueCoding": {
                            "system": "http://snomed.info/sct",
                            "code": "228449008-0",
                            "display": "0"
                        }
                    },
                    {
                        "valueCoding": {
                            "system": "http://snomed.info/sct",
                            "code": "38112003",
                            "display": "1"
                        }
                    },
                    {
                        "valueCoding": {
                            "system": "http://snomed.info/sct",
                            "code": "19338005",
                            "display": "2"
                        }
                    },
                    {
                        "valueCoding": {
                            "system": "http://snomed.info/sct",
                            "code": "79605009",
                            "display": "3"
                        }
                    },
                    {
                        "valueCoding": {
                            "system": "http://snomed.info/sct",
                            "code": "9362000",
                            "display": "4"
                        }
                    },
                    {
                        "valueCoding": {
                            "system": "http://snomed.info/sct",
                            "code": "34001005",
                            "display": "5"
                        }
                    },
                    {
                        "valueCoding": {
                            "system": "http://snomed.info/sct",
                            "code": "68244004",
                            "display": "6"
                        }
                    },
                    {
                        "valueCoding": {
                            "system": "http://snomed.info/sct",
                            "code": "65607009",
                            "display": "7"
                        }
                    }
                ]
            },
            {
                "linkId": "93137723-295f-4b28-9f97-fb58825b2cda",
                "code": [
                    {
                        "system": "http://snomed.info/sct",
                        "code": "255257008"
                    }
                ],
                "text": "On the days when you exercised, for how long did you exercise?",
                "type": "choice",
                "repeats": false,
                "answerOption": [
                    {
                        "valueCoding": {
                            "system": "http://snomed.info/sct",
                            "code": "QUES_FINACIAL_STRESS_CODE_Q3_A1",
                            "display": "10-20 min"
                        }
                    },
                    {
                        "valueCoding": {
                            "system": "http://snomed.info/sct",
                            "code": "QUES_FINACIAL_STRESS_CODE_Q3_A2",
                            "display": "20-40 min"
                        }
                    },
                    {
                        "valueCoding": {
                            "system": "http://snomed.info/sct",
                            "code": "QUES_FINACIAL_STRESS_CODE_Q3_A3",
                            "display": "40-60 min"
                        }
                    },
                    {
                        "valueCoding": {
                            "system": "http://snomed.info/sct",
                            "code": "QUES_FINACIAL_STRESS_CODE_Q3_A4",
                            "display": "> 1 hr"
                        }
                    }
                ]
            },
            {
                "linkId": "7eb053cd-cb2d-435f-8f55-f154645b55c4",
                "code": [
                    {
                        "system": "http://snomed.info/sct",
                        "code": "QUES_FINACIAL_STRESS_CODE_Q4"
                    }
                ],
                "text": "What type of exercise do you do?",
                "type": "text",
                "repeats": false,
                "answerOption": [
                    {
                        "valueCoding": {
                            "system": "http://snomed.info/sct",
                            "code": "QUES_FINACIAL_STRESS_CODE_Q4_A1",
                            "display": "What type of exercise do you do?"
                        }
                    }
                ]
            }
        ]
    }
    
  • {
      "resourceType": "OperationOutcome",
      "issue": [
        {
          "severity": "error",
          "code": "unknown",
          "details": {
            "text": "Authentication failed"
          }
        }
      ]
    }
    
  • {
      "resourceType": "OperationOutcome",
      "issue": [
        {
          "severity": "error",
          "code": "forbidden",
          "details": {
            "text": "Authorization failed"
          }
        }
      ]
    }
    
  • {
      "resourceType": "OperationOutcome",
      "issue": [
        {
          "severity": "error",
          "code": "not-found",
          "details": {
            "text": "Unknown Questionnaire resource 'a47c7b0e-bbb4-42cd-bc4a-df259d148ea1'"
          }
        }
      ]
    }
    
  • curl --request GET \
         --url 'https://fumage-example.canvasmedical.com/Questionnaire?name=exercise' \
         --header 'Authorization: Bearer <token>' \
         --header 'accept: application/json'
    
  • import requests
    
    url = "https://fumage-example.canvasmedical.com/Questionnaire?name=exercise"
    
    headers = {
        "accept": "application/json",
        "Authorization": "Bearer <token>"
    }
    
    response = requests.get(url, headers=headers)
    
    print(response.text)
    
  • {
        "resourceType": "Bundle",
        "type": "searchset",
        "total": 1,
        "link": [
            {
                "relation": "self",
                "url": "/Questionnaire?name=exercise&_count=10&_offset=0"
            },
            {
                "relation": "first",
                "url": "/Questionnaire?name=exercise&_count=10&_offset=0"
            },
            {
                "relation": "last",
                "url": "/Questionnaire?name=exercise&_count=10&_offset=0"
            }
        ],
        "entry": [
            {
                "resource": {
                    "resourceType": "Questionnaire",
                    "id": "47a408d7-9f1d-4cfd-97c7-aa810df9ed39",
                    "name": "Exercise",
                    "status": "active",
                    "description": "No Description Provided",
                    "code": [
                        {
                            "system": "http://snomed.info/sct",
                            "code": "404684003"
                        }
                    ],
                    "item": [
                        {
                            "linkId": "d82e29db-0cac-4b97-a5aa-9e81749686e2",
                            "code": [
                                {
                                    "system": "http://snomed.info/sct",
                                    "code": "228448000"
                                }
                            ],
                            "text": "Do you exercise on a regular basis?",
                            "type": "choice",
                            "repeats": false,
                            "answerOption": [
                                {
                                    "valueCoding": {
                                        "system": "http://snomed.info/sct",
                                        "code": "LA33-6",
                                        "display": "Yes"
                                    }
                                },
                                {
                                    "valueCoding": {
                                        "system": "http://snomed.info/sct",
                                        "code": "LA32-8",
                                        "display": "No"
                                    }
                                }
                            ]
                        },
                        {
                            "linkId": "f2419de1-a208-4a3f-9d55-ba9bd5ed4ec2",
                            "code": [
                                {
                                    "system": "http://snomed.info/sct",
                                    "code": "228449008"
                                }
                            ],
                            "text": "In an average week, how many days do you exercise?",
                            "type": "choice",
                            "repeats": false,
                            "answerOption": [
                                {
                                    "valueCoding": {
                                        "system": "http://snomed.info/sct",
                                        "code": "228449008-0",
                                        "display": "0"
                                    }
                                },
                                {
                                    "valueCoding": {
                                        "system": "http://snomed.info/sct",
                                        "code": "38112003",
                                        "display": "1"
                                    }
                                },
                                {
                                    "valueCoding": {
                                        "system": "http://snomed.info/sct",
                                        "code": "19338005",
                                        "display": "2"
                                    }
                                },
                                {
                                    "valueCoding": {
                                        "system": "http://snomed.info/sct",
                                        "code": "79605009",
                                        "display": "3"
                                    }
                                },
                                {
                                    "valueCoding": {
                                        "system": "http://snomed.info/sct",
                                        "code": "9362000",
                                        "display": "4"
                                    }
                                },
                                {
                                    "valueCoding": {
                                        "system": "http://snomed.info/sct",
                                        "code": "34001005",
                                        "display": "5"
                                    }
                                },
                                {
                                    "valueCoding": {
                                        "system": "http://snomed.info/sct",
                                        "code": "68244004",
                                        "display": "6"
                                    }
                                },
                                {
                                    "valueCoding": {
                                        "system": "http://snomed.info/sct",
                                        "code": "65607009",
                                        "display": "7"
                                    }
                                }
                            ]
                        },
                        {
                            "linkId": "93137723-295f-4b28-9f97-fb58825b2cda",
                            "code": [
                                {
                                    "system": "http://snomed.info/sct",
                                    "code": "255257008"
                                }
                            ],
                            "text": "On the days when you exercised, for how long did you exercise?",
                            "type": "choice",
                            "repeats": false,
                            "answerOption": [
                                {
                                    "valueCoding": {
                                        "system": "http://snomed.info/sct",
                                        "code": "QUES_FINACIAL_STRESS_CODE_Q3_A1",
                                        "display": "10-20 min"
                                    }
                                },
                                {
                                    "valueCoding": {
                                        "system": "http://snomed.info/sct",
                                        "code": "QUES_FINACIAL_STRESS_CODE_Q3_A2",
                                        "display": "20-40 min"
                                    }
                                },
                                {
                                    "valueCoding": {
                                        "system": "http://snomed.info/sct",
                                        "code": "QUES_FINACIAL_STRESS_CODE_Q3_A3",
                                        "display": "40-60 min"
                                    }
                                },
                                {
                                    "valueCoding": {
                                        "system": "http://snomed.info/sct",
                                        "code": "QUES_FINACIAL_STRESS_CODE_Q3_A4",
                                        "display": "> 1 hr"
                                    }
                                }
                            ]
                        },
                        {
                            "linkId": "7eb053cd-cb2d-435f-8f55-f154645b55c4",
                            "code": [
                                {
                                    "system": "http://snomed.info/sct",
                                    "code": "QUES_FINACIAL_STRESS_CODE_Q4"
                                }
                            ],
                            "text": "What type of exercise do you do?",
                            "type": "text",
                            "repeats": false,
                            "answerOption": [
                                {
                                    "valueCoding": {
                                        "system": "http://snomed.info/sct",
                                        "code": "QUES_FINACIAL_STRESS_CODE_Q4_A1",
                                        "display": "What type of exercise do you do?"
                                    }
                                }
                            ]
                        }
                    ]
                }
            }
        ]
    }
    
  • {
      "resourceType": "OperationOutcome",
      "issue": [
        {
          "severity": "error",
          "code": "invalid",
          "details": {
            "text": "Bad request"
          }
        }
      ]
    }
    
  • {
      "resourceType": "OperationOutcome",
      "issue": [
        {
          "severity": "error",
          "code": "unknown",
          "details": {
            "text": "Authentication failed"
          }
        }
      ]
    }
    
  • {
      "resourceType": "OperationOutcome",
      "issue": [
        {
          "severity": "error",
          "code": "forbidden",
          "details": {
            "text": "Authorization failed"
          }
        }
      ]
    }