QuestionnaireResponse

A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the questionnaire being responded to.

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

See this article for information about how to build questionnaires in Canvas.

Questionnaires can map to four different commands in the Canvas UI depending on what the use case in charting is set to:

QuestionnaireResponse resources contain answers to questions in a Questionnaire resource. Use the Questionnaire search endpoint to find Questionnaire resources.

post
/QuestionnaireResponse

QuestionnaireResponse create

Create an QuestionnaireResponse resource.

Attributes

resourceType
string

The FHIR Resource name.

extension
array[json]

Additional content defined by implementations

Canvas supports a note identifier extension on this resource for create, read, update, and search interactions. The note identifier can be used with the Canvas Note API.
Important: For create interactions, Canvas recommends sending the note identifier extension or the Encounter reference, but not both. If both are supplied, they must both refer to the same note.

Click to view child attributes
url
string required

Reference that defines the content of this object.

Value Options Supported:
  • For note identifier we have a url of `http://schemas.canvasmedical.com/fhir/extensions/note-id`
valueId
string

The valueId field is used for the Note extension and will be the note’s unique identifier

questionnaire
string required

Form being answered.

The questionnaire field contains a value that is formatted like a Questionnaire reference, e.g. Questionnaire/ac1da1a4-ccc4-492e-a9e0-7f70a58c2129. Questionnaire IDs can be obtained using the Questionnaire search endpoint.

status
string required

The position of the questionnaire response within its overall lifecycle.

Value Options Supported:
  • completed
subject
json required

The subject of the questions.

Click to view child attributes
reference
string required

The reference string of the subject in the format of "Patient/a39cafb9d1b445be95a2e2548e12a787"

type
string

Type the reference refers to (e.g. “Patient”)

encounter
json

Encounter created as part of.

If encounter is provided, the QuestionnaireResponse will be added to the existing encounter (note). If it is not provided, a new data import note will be created. It will be inserted into the timeline using the timestamp passed in authored.

Canvas does not currently support concurrent creation of resources on the same encounter. Please avoid issuing concurrent requests that reference the same encounter to this endpoint, or to any other endpoints that reference encounters. It is OK to issue concurrent requests to these endpoints as long as the requests reference different encounters.

Click to view child attributes
reference
string required

The reference string of the encounter in the format of "Encounter/cdbd6534-ba0d-4917-a5a6-6a2d46dcf0f7"

type
string

Type the reference refers to (e.g. “Encounter”)

authored
datetime

Date the answers were gathered in ISO 8601 format like "2022-03-19T14:54:12.194952+00:00".

If omitted, the current timestamp will be used.

author
json

Person who received and recorded the answers.

If omitted, then the built-in automation user Canvas Bot will be set as the author.

Supported reference types for create operations are: Patient, Practitioner

Click to view child attributes
reference
string required

The reference string of the author in the format of "Practitioner/cdbd6534-ba0d-4917-a5a6-6a2d46dcf0f7"

type
string

Type the reference refers to (e.g. “Patient”, “Practitioner”)

item
array[json]

Groups and questions

The item attribute contains the answers to the questions in the Questionnaire. The item attribute in QuestionnaireResponse corresponds to the item attribute in Questionnaire payload, and are related via the linkId attribute. If a question’s answer is omitted, it will be left unanswered in Canvas. However, if it is a questionnaire tied to a scoring function, Canvas requires all questions to be answered in order to accurately score the Questionnaire.

Each item must contain a linkId and answer attributes. The answer attribute is a list of answers for the question referred to by the linkId.

Canvas supports the following question formats:

• Free text
• Single choice
• Multiple choice

Answers to free text questions are provided as a valueString. Answers to single and multiple choice questions are provided as a valueCoding. See the request and response examples for more information.

The following mappings show how the FHIR system URI is mapped to the Canvas system (FHIR -> Canvas):

FHIR system uriCanvas system value
http://loinc.orgLOINC
http://snomed.info/sctSNOMED
http://canvasmedical.comCANVAS
http://www.ama-assn.org/go/cptCPT
http://hl7.org/fhir/sid/icd-10ICD-10
http://schemas.{instance-name}.canvasmedical.com/fhir/systems/internalINTERNAL
Click to view child attributes
linkId
string required

A Canvas assigned identifier that uniquely identifies this question in Canvas. This linkId must only occur at most once in the payload. You can retrieve this from FHIR Questionnaire Search/Read

text
string

Human readable text of the question. Not stored but can be helpful to include for troubleshooting.

answer
array[json] required

A list of one or more answers to this question.

Click to view child attributes

For question where the answer is a free-text field (i.e. Questionnaire item type = “text”), then the list will contain a single object containing a valueString field with the response text.

For a question where the answer is a single or multiple choice selection (i.e. Questionnaire item type = “choice” and repeats is “false” for single or “true” for multiple), then the list will have one or more ValueCoding objects. You can retrieve these coding options in the Questionnaire Read/Search endpoint.

Click to view child attributes
system
string required

The system url of the coding.

Value Options Supported:
  • http://loinc.org
  • http://snomed.info/sct
  • http://canvasmedical.com
  • http://www.ama-assn.org/go/cpt
  • http://hl7.org/fhir/sid/icd-10
  • http://schemas.{customer_identifier}.canvasmedical.com/fhir/systems/internal
code
string required

The code of the answer.

display
string required

The display name of the coding.

Responses

201 Created
The server has successfully processed the request; the new resource has been created and is now ready for interaction.

Canvas returns the created resource's id as a UUID within the location header and a null response body.

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.
405 Method Not Allowed
The request performs an operation that is either not supported or allowed.
422 Unprocessable Entity
The request cannot be processed due to semantic issues or conflicts with the database state.

Validation Errors

Beware of ambiguous choices!

If the questionnaire contains a question with identical codings for different choices, Canvas will not know which of the choices were selected. In this case, Canvas will reject the request. For the request to succeed, each question must have a uniquely coded set of choices. Choice codings can be reused across questions, but not within them.If this scenario occurs, you will get the error message: Question received a response option code: {code} that belongs to more than one option response

More Coding Validation

The system is the valueCoding answer needs to match the system that the question specified in the Questionnaire Search Response. If it does not, you will get the error: Question expects answer of code system {system} but {system} was given

If a code is passed that does not exist for that question in Canvas, you will get the error: Question received an invalid response option code: {code}

Answer Validation

For single or free text questions, if more than one answer is provided, you will get the error: Question of type {type} is expecting at most one answer

For free text questions, the answer object must include a valueString or you will get the error: Question of type TXT expects a valueString answer

For single or multiple choice questions, the answer objects must include a valueCoding or you will see one of these errors:
Question of type SING expects a valueCoding answer
Question of type MULT expects a valueCoding answer

get
/QuestionnaireResponse/{id}

QuestionnaireResponse read

Read an QuestionnaireResponse resource.

Path Parameters

id required
string
The unique identifier for the QuestionnaireResponse

Response Payload Attributes

resourceType
string

The FHIR Resource name.

id
string

The identifier of the QuestionnaireResponse.

extension
array[json]

Additional content defined by implementations

Canvas supports a note identifier extension on this resource for create, read, update, and search interactions. The note identifier can be used with the Canvas Note API.
Important: For create interactions, Canvas recommends sending the note identifier extension or the Encounter reference, but not both. If both are supplied, they must both refer to the same note.

The Questionnaire permalink is included in the extension attribute. This will take you directly to the command in the patient’s chart.

Click to view child attributes
url
string

Reference that defines the content of this object.

Value Options Supported:
  • For permalinks which have a url of `http://schemas.canvasmedical.com/fhir/extensions/questionnaire-permalink`
  • For note identifier we have a url of `http://schemas.canvasmedical.com/fhir/extensions/note-id`
valueString
string

The permalink extension will have a valueString returned that represents a url. This url will take you to the exact command in the Canvas UI the response is captured. It will look like https://<customer-identifier>.canvasmedical.com/permalinks/v1/SW50ZXJ2aWV3OjUxOjc1NTU=

valueId
string

The valueId field is used for the Note extension and will be the note’s unique identifier

questionnaire
string

Form being answered.

The questionnaire field contains a value that is formatted like a Questionnaire reference, e.g. Questionnaire/ac1da1a4-ccc4-492e-a9e0-7f70a58c2129. Questionnaire IDs can be obtained using the Questionnaire search endpoint.

status
string

The position of the questionnaire response within its overall lifecycle.

Value Options Supported:
  • completed
  • entered-in-error
subject
json

The subject of the questions.

Click to view child attributes
reference
string

The reference string of the subject in the format of "Patient/a39cafb9d1b445be95a2e2548e12a787"

type
string

Type the reference refers to (e.g. “Patient”)

encounter
json

Encounter created as part of.

If encounter is provided, the QuestionnaireResponse will be added to the existing encounter (note). If it is not provided, a new data import note will be created. It will be inserted into the timeline using the timestamp passed in authored.

Canvas does not currently support concurrent creation of resources on the same encounter. Please avoid issuing concurrent requests that reference the same encounter to this endpoint, or to any other endpoints that reference encounters. It is OK to issue concurrent requests to these endpoints as long as the requests reference different encounters.

Click to view child attributes
reference
string

The reference string of the encounter in the format of "Encounter/cdbd6534-ba0d-4917-a5a6-6a2d46dcf0f7"

type
string

Type the reference refers to (e.g. “Encounter”)

authored
datetime

Date the answers were gathered in ISO 8601 format like "2022-03-19T14:54:12.194952+00:00".

If omitted, the current timestamp will be used.

author
json

Person who received and recorded the answers.

If omitted, then the built-in automation user Canvas Bot will be set as the author.

Supported reference types for create operations are: Patient, Practitioner

Click to view child attributes
reference
string

The reference string of the author in the format of "Practitioner/cdbd6534-ba0d-4917-a5a6-6a2d46dcf0f7"

type
string

Type the reference refers to (e.g. “Patient”, “Practitioner”)

item
array[json]

Groups and questions

The item attribute contains the answers to the questions in the Questionnaire. The item attribute in QuestionnaireResponse corresponds to the item attribute in Questionnaire payload, and are related via the linkId attribute. If a question’s answer is omitted, it will be left unanswered in Canvas. However, if it is a questionnaire tied to a scoring function, Canvas requires all questions to be answered in order to accurately score the Questionnaire.

Each item must contain a linkId and answer attributes. The answer attribute is a list of answers for the question referred to by the linkId.

Canvas supports the following question formats:

• Free text
• Single choice
• Multiple choice

Answers to free text questions are provided as a valueString. Answers to single and multiple choice questions are provided as a valueCoding. See the request and response examples for more information.

The following mappings show how the FHIR system URI is mapped to the Canvas system (FHIR -> Canvas):

FHIR system uriCanvas system value
http://loinc.orgLOINC
http://snomed.info/sctSNOMED
http://canvasmedical.comCANVAS
http://www.ama-assn.org/go/cptCPT
http://hl7.org/fhir/sid/icd-10ICD-10
http://schemas.{instance-name}.canvasmedical.com/fhir/systems/internalINTERNAL
Click to view child attributes
linkId
string

A Canvas assigned identifier that uniquely identifies this question in Canvas. This linkId must only occur at most once in the payload. You can retrieve this from FHIR Questionnaire Search/Read

text
string

Human readable text of the question. Not stored but can be helpful to include for troubleshooting.

answer
array[json]

A list of one or more answers to this question.

Click to view child attributes

For question where the answer is a free-text field (i.e. Questionnaire item type = “text”), then the list will contain a single object containing a valueString field with the response text.

For a question where the answer is a single or multiple choice selection (i.e. Questionnaire item type = “choice” and repeats is “false” for single or “true” for multiple), then the list will have one or more ValueCoding objects. You can retrieve these coding options in the Questionnaire Read/Search endpoint.

Click to view child attributes
system
string

The system url of the coding.

Value Options Supported:
  • http://loinc.org
  • http://snomed.info/sct
  • http://canvasmedical.com
  • http://www.ama-assn.org/go/cpt
  • http://hl7.org/fhir/sid/icd-10
  • http://schemas.{customer_identifier}.canvasmedical.com/fhir/systems/internal
code
string

The code of the answer.

display
string

The display name of the coding.

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.
put
/QuestionnaireResponse/{id}

QuestionnaireResponse update

Update a QuestionnaireResponse resource.

The only type of QuestionnaireResponse update interaction that is supported by Canvas is to mark an existing QuestionnaireResponse as entered-in-error. No changes to other fields will be processed.

Attributes

resourceType
string

The FHIR Resource name.

id
string required

The identifier of the QuestionnaireResponse.

extension
array[json]

Additional content defined by implementations

Canvas supports a note identifier extension on this resource for create, read, update, and search interactions. The note identifier can be used with the Canvas Note API.
Important: For create interactions, Canvas recommends sending the note identifier extension or the Encounter reference, but not both. If both are supplied, they must both refer to the same note.

Click to view child attributes
url
string required

Reference that defines the content of this object.

Value Options Supported:
  • For note identifier we have a url of `http://schemas.canvasmedical.com/fhir/extensions/note-id`
valueId
string

The valueId field is used for the Note extension and will be the note’s unique identifier

questionnaire
string required

Form being answered.

The questionnaire field contains a value that is formatted like a Questionnaire reference, e.g. Questionnaire/ac1da1a4-ccc4-492e-a9e0-7f70a58c2129. Questionnaire IDs can be obtained using the Questionnaire search endpoint.

status
string required

The position of the questionnaire response within its overall lifecycle.

Value Options Supported:
  • entered-in-error
subject
json required

The subject of the questions.

Click to view child attributes
reference
string required

The reference string of the subject in the format of "Patient/a39cafb9d1b445be95a2e2548e12a787"

type
string

Type the reference refers to (e.g. “Patient”)

encounter
json

Encounter created as part of.

If encounter is provided, the QuestionnaireResponse will be added to the existing encounter (note). If it is not provided, a new data import note will be created. It will be inserted into the timeline using the timestamp passed in authored.

Canvas does not currently support concurrent creation of resources on the same encounter. Please avoid issuing concurrent requests that reference the same encounter to this endpoint, or to any other endpoints that reference encounters. It is OK to issue concurrent requests to these endpoints as long as the requests reference different encounters.

Click to view child attributes
reference
string required

The reference string of the encounter in the format of "Encounter/cdbd6534-ba0d-4917-a5a6-6a2d46dcf0f7"

type
string

Type the reference refers to (e.g. “Encounter”)

authored
datetime

Date the answers were gathered in ISO 8601 format like "2022-03-19T14:54:12.194952+00:00".

If omitted, the current timestamp will be used.

author
json

Person who received and recorded the answers.

If omitted, then the built-in automation user Canvas Bot will be set as the author.

Supported reference types for create operations are: Patient, Practitioner

Click to view child attributes
reference
string required

The reference string of the author in the format of "Practitioner/cdbd6534-ba0d-4917-a5a6-6a2d46dcf0f7"

type
string

Type the reference refers to (e.g. “Patient”, “Practitioner”)

item
array[json]

Groups and questions

The item attribute contains the answers to the questions in the Questionnaire. The item attribute in QuestionnaireResponse corresponds to the item attribute in Questionnaire payload, and are related via the linkId attribute. If a question’s answer is omitted, it will be left unanswered in Canvas. However, if it is a questionnaire tied to a scoring function, Canvas requires all questions to be answered in order to accurately score the Questionnaire.

Each item must contain a linkId and answer attributes. The answer attribute is a list of answers for the question referred to by the linkId.

Canvas supports the following question formats:

• Free text
• Single choice
• Multiple choice

Answers to free text questions are provided as a valueString. Answers to single and multiple choice questions are provided as a valueCoding. See the request and response examples for more information.

The following mappings show how the FHIR system URI is mapped to the Canvas system (FHIR -> Canvas):

FHIR system uriCanvas system value
http://loinc.orgLOINC
http://snomed.info/sctSNOMED
http://canvasmedical.comCANVAS
http://www.ama-assn.org/go/cptCPT
http://hl7.org/fhir/sid/icd-10ICD-10
http://schemas.{instance-name}.canvasmedical.com/fhir/systems/internalINTERNAL
Click to view child attributes
linkId
string required

A Canvas assigned identifier that uniquely identifies this question in Canvas. This linkId must only occur at most once in the payload. You can retrieve this from FHIR Questionnaire Search/Read

text
string

Human readable text of the question. Not stored but can be helpful to include for troubleshooting.

answer
array[json] required

A list of one or more answers to this question.

Click to view child attributes

For question where the answer is a free-text field (i.e. Questionnaire item type = “text”), then the list will contain a single object containing a valueString field with the response text.

For a question where the answer is a single or multiple choice selection (i.e. Questionnaire item type = “choice” and repeats is “false” for single or “true” for multiple), then the list will have one or more ValueCoding objects. You can retrieve these coding options in the Questionnaire Read/Search endpoint.

Click to view child attributes
system
string required

The system url of the coding.

Value Options Supported:
  • http://loinc.org
  • http://snomed.info/sct
  • http://canvasmedical.com
  • http://www.ama-assn.org/go/cpt
  • http://hl7.org/fhir/sid/icd-10
  • http://schemas.{customer_identifier}.canvasmedical.com/fhir/systems/internal
code
string required

The code of the answer.

display
string required

The display name of the coding.

Responses

200 OK
The server has successfully processed the request.

Canvas returns a null response body.

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.
404 Not Found
The requested resource was not found.
405 Method Not Allowed
The request performs an operation that is either not supported or allowed.
412 Precondition Failed
The request depends on a precondition that has not been met.
422 Unprocessable Entity
The request cannot be processed due to semantic issues or conflicts with the database state.

Query Parameters

_id
string

The identifier of the QuestionnaireResponse.

authored
datetime

Filter by the authored attribute. See Date Filtering for more information.

patient
string

The patient that is the subject of the questionnaire response in the format Patient/a39cafb9d1b445be95a2e2548e12a787.

questionnaire
string

The questionnaire the answers are provided for in the format “Questionnaire/7eefd6fc-0000-44c2-8224-d95f0ceaa2fd”.

questionnaire.code
string

Filters by the code and/or system of the associated questionnaire. You can search by just the code value or you can search by the system and code in the format system|code (e.g http://snomed.info/sct|404684003).

questionnaire.item.code
string

Filters by the code and/or system of questions in the questionnaire. You can search by just the code value or you can search by the system and code in the format system|code (e.g http://snomed.info/sct|404684003).

_sort
string

Triggers sorting of the results by a specific criteria. The results will be in ascending order unless you add a - in front to sort in descending order.

Search Values Supported:
  • _id
  • authored

Response Payload Attributes

resourceType
string

The FHIR Resource name.

type
string

This element and value designate that the bundle is a search response. Search result bundles will always have the Bundle.type of searchset .

total
integer

The number of resources that match the search parameter.

link
array[json]

Attributes relevant to pagination, see our Pagination page for more detail.

Click to view child attributes
relation
enum [self|first|next|last]

The relation of the page search

url

The search url for the specific relation

entry
array[json]

The results bundle that lists out each object returned in the search

Click to view child attributes
resource
json

The attributes specific to the resource type, see the Attributes section below

Attributes

resourceType
string

The FHIR Resource name.

id
string

The identifier of the QuestionnaireResponse.

extension
array[json]

Additional content defined by implementations

Canvas supports a note identifier extension on this resource for create, read, update, and search interactions. The note identifier can be used with the Canvas Note API.
Important: For create interactions, Canvas recommends sending the note identifier extension or the Encounter reference, but not both. If both are supplied, they must both refer to the same note.

The Questionnaire permalink is included in the extension attribute. This will take you directly to the command in the patient’s chart.

Click to view child attributes
url
string

Reference that defines the content of this object.

Value Options Supported:
  • For permalinks which have a url of `http://schemas.canvasmedical.com/fhir/extensions/questionnaire-permalink`
  • For note identifier we have a url of `http://schemas.canvasmedical.com/fhir/extensions/note-id`
valueString
string

The permalink extension will have a valueString returned that represents a url. This url will take you to the exact command in the Canvas UI the response is captured. It will look like https://<customer-identifier>.canvasmedical.com/permalinks/v1/SW50ZXJ2aWV3OjUxOjc1NTU=

valueId
string

The valueId field is used for the Note extension and will be the note’s unique identifier

questionnaire
string

Form being answered.

The questionnaire field contains a value that is formatted like a Questionnaire reference, e.g. Questionnaire/ac1da1a4-ccc4-492e-a9e0-7f70a58c2129. Questionnaire IDs can be obtained using the Questionnaire search endpoint.

status
string

The position of the questionnaire response within its overall lifecycle.

Value Options Supported:
  • completed
  • entered-in-error
subject
json

The subject of the questions.

Click to view child attributes
reference
string

The reference string of the subject in the format of "Patient/a39cafb9d1b445be95a2e2548e12a787"

type
string

Type the reference refers to (e.g. “Patient”)

encounter
json

Encounter created as part of.

If encounter is provided, the QuestionnaireResponse will be added to the existing encounter (note). If it is not provided, a new data import note will be created. It will be inserted into the timeline using the timestamp passed in authored.

Canvas does not currently support concurrent creation of resources on the same encounter. Please avoid issuing concurrent requests that reference the same encounter to this endpoint, or to any other endpoints that reference encounters. It is OK to issue concurrent requests to these endpoints as long as the requests reference different encounters.

Click to view child attributes
reference
string

The reference string of the encounter in the format of "Encounter/cdbd6534-ba0d-4917-a5a6-6a2d46dcf0f7"

type
string

Type the reference refers to (e.g. “Encounter”)

authored
datetime

Date the answers were gathered in ISO 8601 format like "2022-03-19T14:54:12.194952+00:00".

If omitted, the current timestamp will be used.

author
json

Person who received and recorded the answers.

If omitted, then the built-in automation user Canvas Bot will be set as the author.

Supported reference types for create operations are: Patient, Practitioner

Click to view child attributes
reference
string

The reference string of the author in the format of "Practitioner/cdbd6534-ba0d-4917-a5a6-6a2d46dcf0f7"

type
string

Type the reference refers to (e.g. “Patient”, “Practitioner”)

item
array[json]

Groups and questions

The item attribute contains the answers to the questions in the Questionnaire. The item attribute in QuestionnaireResponse corresponds to the item attribute in Questionnaire payload, and are related via the linkId attribute. If a question’s answer is omitted, it will be left unanswered in Canvas. However, if it is a questionnaire tied to a scoring function, Canvas requires all questions to be answered in order to accurately score the Questionnaire.

Each item must contain a linkId and answer attributes. The answer attribute is a list of answers for the question referred to by the linkId.

Canvas supports the following question formats:

• Free text
• Single choice
• Multiple choice

Answers to free text questions are provided as a valueString. Answers to single and multiple choice questions are provided as a valueCoding. See the request and response examples for more information.

The following mappings show how the FHIR system URI is mapped to the Canvas system (FHIR -> Canvas):

FHIR system uriCanvas system value
http://loinc.orgLOINC
http://snomed.info/sctSNOMED
http://canvasmedical.comCANVAS
http://www.ama-assn.org/go/cptCPT
http://hl7.org/fhir/sid/icd-10ICD-10
http://schemas.{instance-name}.canvasmedical.com/fhir/systems/internalINTERNAL
Click to view child attributes
linkId
string

A Canvas assigned identifier that uniquely identifies this question in Canvas. This linkId must only occur at most once in the payload. You can retrieve this from FHIR Questionnaire Search/Read

text
string

Human readable text of the question. Not stored but can be helpful to include for troubleshooting.

answer
array[json]

A list of one or more answers to this question.

Click to view child attributes

For question where the answer is a free-text field (i.e. Questionnaire item type = “text”), then the list will contain a single object containing a valueString field with the response text.

For a question where the answer is a single or multiple choice selection (i.e. Questionnaire item type = “choice” and repeats is “false” for single or “true” for multiple), then the list will have one or more ValueCoding objects. You can retrieve these coding options in the Questionnaire Read/Search endpoint.

Click to view child attributes
system
string

The system url of the coding.

Value Options Supported:
  • http://loinc.org
  • http://snomed.info/sct
  • http://canvasmedical.com
  • http://www.ama-assn.org/go/cpt
  • http://hl7.org/fhir/sid/icd-10
  • http://schemas.{customer_identifier}.canvasmedical.com/fhir/systems/internal
code
string

The code of the answer.

display
string

The display name of the coding.

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 POST \
         --url 'https://fumage-example.canvasmedical.com/QuestionnaireResponse' \
         --header 'Authorization: Bearer <token>' \
         --header 'accept: application/json' \
         --header 'content-type: application/json' \
         --data '
    {
        "resourceType": "QuestionnaireResponse",
        "id": "e76e44b4-4e68-4f72-b1c3-1de528a3bb2a",
        "extension": [
            {
                "url": "http://schemas.canvasmedical.com/fhir/extensions/note-id",
                "valueId": "2a8154d8-9420-4ab5-97f8-c2dae5a10af5",
            }
        ],
        "questionnaire": "Questionnaire/7eefd6fc-0000-44c2-8224-d95f0ceaa2fd",
        "status": "completed",
        "subject": {
            "reference": "Patient/b8dfa97bdcdf4754bcd8197ca78ef0f0",
            "type": "Patient"
        },
        "encounter": {
            "reference": "Encounter/ffa0bd44-997f-4ad4-8782-1a6c0ef01f1c",
            "type": "Encounter"
        },
        "authored": "2022-12-19T18:11:20.914260+00:00",
        "author": {
            "reference": "Practitioner/9cdb7a92d6614dcfa7948f2143a9f8e8",
            "type": "Practitioner"
        },
        "item": [
            {
                "linkId": "e2e5ddc3-a0ec-4a1b-9c53-bf2e2e990fe1",
                "text": "Tobacco status",
                "answer": [
                    {
                        "valueCoding": {
                            "system": "http://snomed.info/sct",
                            "code": "8517006",
                            "display": "Former user"
                        }
                    }
                ]
            },
            {
                "linkId": "d210dc3a-3427-4f58-8707-3f38393a8416",
                "text": "Tobacco type",
                "answer": [
                    {
                        "valueCoding": {
                            "system": "http://snomed.info/sct",
                            "code": "722496004",
                            "display": "Cigarettes"
                        }
                    },
                    {
                        "valueCoding": {
                            "system": "http://snomed.info/sct",
                            "code": "722498003",
                            "display": "eCigarette"
                        }
                    }
                ]
            },
            {
                "linkId": "a656c6c8-ecea-403f-a430-f80899f26914",
                "text": "Tobacco comment",
                "answer": [
                    {
                        "valueString": "Yep"
                    }
                ]
            }
        ]
    }'
    
  • import requests
    
    url = "https://fumage-example.canvasmedical.com/QuestionnaireResponse"
    
    headers = {
        "accept": "application/json",
        "Authorization": "Bearer <token>",
        "content-type": "application/json"
    }
    
    payload = {
        "resourceType": "QuestionnaireResponse",
        "id": "e76e44b4-4e68-4f72-b1c3-1de528a3bb2a",
        "extension": [
            {
                "url": "http://schemas.canvasmedical.com/fhir/extensions/note-id",
                "valueId": "2a8154d8-9420-4ab5-97f8-c2dae5a10af5",
            }
        ],
        "questionnaire": "Questionnaire/7eefd6fc-0000-44c2-8224-d95f0ceaa2fd",
        "status": "completed",
        "subject": {
            "reference": "Patient/b8dfa97bdcdf4754bcd8197ca78ef0f0",
            "type": "Patient"
        },
        "encounter": {
            "reference": "Encounter/ffa0bd44-997f-4ad4-8782-1a6c0ef01f1c",
            "type": "Encounter"
        },
        "authored": "2022-12-19T18:11:20.914260+00:00",
        "author": {
            "reference": "Practitioner/9cdb7a92d6614dcfa7948f2143a9f8e8",
            "type": "Practitioner"
        },
        "item": [
            {
                "linkId": "e2e5ddc3-a0ec-4a1b-9c53-bf2e2e990fe1",
                "text": "Tobacco status",
                "answer": [
                    {
                        "valueCoding": {
                            "system": "http://snomed.info/sct",
                            "code": "8517006",
                            "display": "Former user"
                        }
                    }
                ]
            },
            {
                "linkId": "d210dc3a-3427-4f58-8707-3f38393a8416",
                "text": "Tobacco type",
                "answer": [
                    {
                        "valueCoding": {
                            "system": "http://snomed.info/sct",
                            "code": "722496004",
                            "display": "Cigarettes"
                        }
                    },
                    {
                        "valueCoding": {
                            "system": "http://snomed.info/sct",
                            "code": "722498003",
                            "display": "eCigarette"
                        }
                    }
                ]
            },
            {
                "linkId": "a656c6c8-ecea-403f-a430-f80899f26914",
                "text": "Tobacco comment",
                "answer": [
                    {
                        "valueString": "Yep"
                    }
                ]
            }
        ]
    }
    response = requests.post(url, json=payload, headers=headers)
    
    print(response.text)
    
  • null
    
  • {
      "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"
          }
        }
      ]
    }
    
  • {
      "resourceType": "OperationOutcome",
      "issue": [
        {
          "severity": "error",
          "code": "not-supported",
          "details": {
            "text": "Operation is not supported"
          }
        }
      ]
    }
    
  • {
      "resourceType": "OperationOutcome",
      "issue": [
        {
          "severity": "error",
          "code": "business-rule",
          "details": {
            "text": "Unprocessable entity"
          }
        }
      ]
    }
    
  • curl --request GET \
         --url 'https://fumage-example.canvasmedical.com/QuestionnaireResponse/<id>' \
         --header 'Authorization: Bearer <token>' \
         --header 'accept: application/json'
    
  • import requests
    
    url = "https://fumage-example.canvasmedical.com/QuestionnaireResponse/<id>"
    
    headers = {
        "accept": "application/json",
        "Authorization": "Bearer <token>"
    }
    
    response = requests.get(url, headers=headers)
    
    print(response.text)
    
  • {
        "resourceType": "QuestionnaireResponse",
        "id": "e76e44b4-4e68-4f72-b1c3-1de528a3bb2a",
        "extension": [
            {
                "url": "http://schemas.canvasmedical.com/fhir/extensions/note-id",
                "valueId": "2a8154d8-9420-4ab5-97f8-c2dae5a10af5",
            },
            {
                "url": "http://schemas.canvasmedical.com/fhir/extensions/questionnaire-permalink",
                "valueString": "https://example.canvasmedical.com/permalinks/v1/YWJjZGVmZ2hpamtsbW5vcHFycwo"
            }
        ],
        "questionnaire": "Questionnaire/7eefd6fc-0000-44c2-8224-d95f0ceaa2fd",
        "status": "completed",
        "subject": {
            "reference": "Patient/b8dfa97bdcdf4754bcd8197ca78ef0f0",
            "type": "Patient"
        },
        "encounter": {
            "reference": "Encounter/ffa0bd44-997f-4ad4-8782-1a6c0ef01f1c",
            "type": "Encounter"
        },
        "authored": "2022-12-19T18:11:20.914260+00:00",
        "author": {
            "reference": "Practitioner/9cdb7a92d6614dcfa7948f2143a9f8e8",
            "type": "Practitioner"
        },
        "item": [
            {
                "linkId": "e2e5ddc3-a0ec-4a1b-9c53-bf2e2e990fe1",
                "text": "Tobacco status",
                "answer": [
                    {
                        "valueCoding": {
                            "system": "http://snomed.info/sct",
                            "code": "8517006",
                            "display": "Former user"
                        }
                    }
                ]
            },
            {
                "linkId": "d210dc3a-3427-4f58-8707-3f38393a8416",
                "text": "Tobacco type",
                "answer": [
                    {
                        "valueCoding": {
                            "system": "http://snomed.info/sct",
                            "code": "722496004",
                            "display": "Cigarettes"
                        }
                    },
                    {
                        "valueCoding": {
                            "system": "http://snomed.info/sct",
                            "code": "722498003",
                            "display": "eCigarette"
                        }
                    }
                ]
            },
            {
                "linkId": "a656c6c8-ecea-403f-a430-f80899f26914",
                "text": "Tobacco comment",
                "answer": [
                    {
                        "valueString": "Yep"
                    }
                ]
            }
        ]
    }
    
  • {
      "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 QuestionnaireResponse resource 'a47c7b0e-bbb4-42cd-bc4a-df259d148ea1'"
          }
        }
      ]
    }
    
  • curl --request PUT \
         --url 'https://fumage-example.canvasmedical.com/QuestionnaireResponse/<id>' \
         --header 'Authorization: Bearer <token>' \
         --header 'accept: application/json' \
         --header 'content-type: application/json' \
         --data '
    {
        "resourceType": "QuestionnaireResponse",
        "id": "e76e44b4-4e68-4f72-b1c3-1de528a3bb2a",
        "extension": [
            {
                "url": "http://schemas.canvasmedical.com/fhir/extensions/note-id",
                "valueId": "2a8154d8-9420-4ab5-97f8-c2dae5a10af5",
            }
        ],
        "questionnaire": "Questionnaire/7eefd6fc-0000-44c2-8224-d95f0ceaa2fd",
        "status": "entered-in-error",
        "subject": {
            "reference": "Patient/b8dfa97bdcdf4754bcd8197ca78ef0f0",
            "type": "Patient"
        },
        "encounter": {
            "reference": "Encounter/ffa0bd44-997f-4ad4-8782-1a6c0ef01f1c",
            "type": "Encounter"
        },
        "authored": "2022-12-19T18:11:20.914260+00:00",
        "author": {
            "reference": "Practitioner/9cdb7a92d6614dcfa7948f2143a9f8e8",
            "type": "Practitioner"
        },
        "item": [
            {
                "linkId": "e2e5ddc3-a0ec-4a1b-9c53-bf2e2e990fe1",
                "text": "Tobacco status",
                "answer": [
                    {
                        "valueCoding": {
                            "system": "http://snomed.info/sct",
                            "code": "8517006",
                            "display": "Former user"
                        }
                    }
                ]
            },
            {
                "linkId": "d210dc3a-3427-4f58-8707-3f38393a8416",
                "text": "Tobacco type",
                "answer": [
                    {
                        "valueCoding": {
                            "system": "http://snomed.info/sct",
                            "code": "722496004",
                            "display": "Cigarettes"
                        }
                    },
                    {
                        "valueCoding": {
                            "system": "http://snomed.info/sct",
                            "code": "722498003",
                            "display": "eCigarette"
                        }
                    }
                ]
            },
            {
                "linkId": "a656c6c8-ecea-403f-a430-f80899f26914",
                "text": "Tobacco comment",
                "answer": [
                    {
                        "valueString": "Yep"
                    }
                ]
            }
        ]
    }'
    
  • import requests
    
    url = "https://fumage-example.canvasmedical.com/QuestionnaireResponse/<id>"
    
    headers = {
        "accept": "application/json",
        "Authorization": "Bearer <token>",
        "content-type": "application/json"
    }
    
    payload = {
        "resourceType": "QuestionnaireResponse",
        "id": "e76e44b4-4e68-4f72-b1c3-1de528a3bb2a",
        "extension": [
            {
                "url": "http://schemas.canvasmedical.com/fhir/extensions/note-id",
                "valueId": "2a8154d8-9420-4ab5-97f8-c2dae5a10af5",
            }
        ],
        "questionnaire": "Questionnaire/7eefd6fc-0000-44c2-8224-d95f0ceaa2fd",
        "status": "entered-in-error",
        "subject": {
            "reference": "Patient/b8dfa97bdcdf4754bcd8197ca78ef0f0",
            "type": "Patient"
        },
        "encounter": {
            "reference": "Encounter/ffa0bd44-997f-4ad4-8782-1a6c0ef01f1c",
            "type": "Encounter"
        },
        "authored": "2022-12-19T18:11:20.914260+00:00",
        "author": {
            "reference": "Practitioner/9cdb7a92d6614dcfa7948f2143a9f8e8",
            "type": "Practitioner"
        },
        "item": [
            {
                "linkId": "e2e5ddc3-a0ec-4a1b-9c53-bf2e2e990fe1",
                "text": "Tobacco status",
                "answer": [
                    {
                        "valueCoding": {
                            "system": "http://snomed.info/sct",
                            "code": "8517006",
                            "display": "Former user"
                        }
                    }
                ]
            },
            {
                "linkId": "d210dc3a-3427-4f58-8707-3f38393a8416",
                "text": "Tobacco type",
                "answer": [
                    {
                        "valueCoding": {
                            "system": "http://snomed.info/sct",
                            "code": "722496004",
                            "display": "Cigarettes"
                        }
                    },
                    {
                        "valueCoding": {
                            "system": "http://snomed.info/sct",
                            "code": "722498003",
                            "display": "eCigarette"
                        }
                    }
                ]
            },
            {
                "linkId": "a656c6c8-ecea-403f-a430-f80899f26914",
                "text": "Tobacco comment",
                "answer": [
                    {
                        "valueString": "Yep"
                    }
                ]
            }
        ]
    }
    response = requests.put(url, json=payload, headers=headers)
    
    print(response.text)
    
  • null
    
  • {
      "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"
          }
        }
      ]
    }
    
  • {
      "resourceType": "OperationOutcome",
      "issue": [
        {
          "severity": "error",
          "code": "not-found",
          "details": {
            "text": "Unknown QuestionnaireResponse resource 'a47c7b0e-bbb4-42cd-bc4a-df259d148ea1'"
          }
        }
      ]
    }
    
  • {
      "resourceType": "OperationOutcome",
      "issue": [
        {
          "severity": "error",
          "code": "not-supported",
          "details": {
            "text": "Operation is not supported"
          }
        }
      ]
    }
    
  • {
      "resourceType": "OperationOutcome",
      "issue": [
        {
          "severity": "error",
          "code": "conflict",
          "details": {
            "text": "Resource updated since If-Unmodified-Since date"
          }
        }
      ]
    }
    
  • {
      "resourceType": "OperationOutcome",
      "issue": [
        {
          "severity": "error",
          "code": "business-rule",
          "details": {
            "text": "Unprocessable entity"
          }
        }
      ]
    }
    
  • curl --request GET \
         --url 'https://fumage-example.canvasmedical.com/QuestionnaireResponse?patient=Patient/b8dfa97bdcdf4754bcd8197ca78ef0f0' \
         --header 'Authorization: Bearer <token>' \
         --header 'accept: application/json'
    
  • import requests
    
    url = "https://fumage-example.canvasmedical.com/QuestionnaireResponse?patient=Patient/b8dfa97bdcdf4754bcd8197ca78ef0f0"
    
    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": "/QuestionnaireResponse?patient=Patient%2Fb8dfa97bdcdf4754bcd8197ca78ef0f0&_count=10&_offset=0"
            },
            {
                "relation": "first",
                "url": "/QuestionnaireResponse?patient=Patient%2Fb8dfa97bdcdf4754bcd8197ca78ef0f0&_count=10&_offset=0"
            },
            {
                "relation": "last",
                "url": "/QuestionnaireResponse?patient=Patient%2Fb8dfa97bdcdf4754bcd8197ca78ef0f0&_count=10&_offset=0"
            }
        ],
        "entry": [
            {
                "resource": {
                    "resourceType": "QuestionnaireResponse",
                    "id": "e76e44b4-4e68-4f72-b1c3-1de528a3bb2a",
                    "extension": [
                        {
                            "url": "http://schemas.canvasmedical.com/fhir/extensions/note-id",
                            "valueId": "2a8154d8-9420-4ab5-97f8-c2dae5a10af5",
                        },
                        {
                            "url": "http://schemas.canvasmedical.com/fhir/extensions/questionnaire-permalink",
                            "valueString": "https://example.canvasmedical.com/permalinks/v1/YWJjZGVmZ2hpamtsbW5vcHFycwo"
                        }
                    ],
                    "questionnaire": "Questionnaire/7eefd6fc-0000-44c2-8224-d95f0ceaa2fd",
                    "status": "completed",
                    "subject": {
                        "reference": "Patient/b8dfa97bdcdf4754bcd8197ca78ef0f0",
                        "type": "Patient"
                    },
                    "encounter": {
                        "reference": "Encounter/ffa0bd44-997f-4ad4-8782-1a6c0ef01f1c",
                        "type": "Encounter"
                    },
                    "authored": "2022-12-19T18:11:20.914260+00:00",
                    "author": {
                        "reference": "Practitioner/9cdb7a92d6614dcfa7948f2143a9f8e8",
                        "type": "Practitioner"
                    },
                    "item": [
                        {
                            "linkId": "e2e5ddc3-a0ec-4a1b-9c53-bf2e2e990fe1",
                            "text": "Tobacco status",
                            "answer": [
                                {
                                    "valueCoding": {
                                        "system": "http://snomed.info/sct",
                                        "code": "8517006",
                                        "display": "Former user"
                                    }
                                }
                            ]
                        },
                        {
                            "linkId": "d210dc3a-3427-4f58-8707-3f38393a8416",
                            "text": "Tobacco type",
                            "answer": [
                                {
                                    "valueCoding": {
                                        "system": "http://snomed.info/sct",
                                        "code": "722496004",
                                        "display": "Cigarettes"
                                    }
                                },
                                {
                                    "valueCoding": {
                                        "system": "http://snomed.info/sct",
                                        "code": "722498003",
                                        "display": "eCigarette"
                                    }
                                }
                            ]
                        },
                        {
                            "linkId": "a656c6c8-ecea-403f-a430-f80899f26914",
                            "text": "Tobacco comment",
                            "answer": [
                                {
                                    "valueString": "Yep"
                                }
                            ]
                        }
                    ]
                }
            }
        ]
    }
    
  • {
      "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"
          }
        }
      ]
    }