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 Zendesk article for information about how to build questionnaires in Canvas.
See this Zendesk article for information about how to fill out a questionnaire for a patient via the Questionnaire
command. QuestionnaireResponse resources contain answers to questions in a Questionnaire resource. Use the Questionnaire search endpoint to find Questionnaire resources.
QuestionnaireResponse create
Create an QuestionnaireResponse resource.
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
.
Validation
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, the following error message will be returned:
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, the following error message will be returned:
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, the following error message will be returned:
Question received an invalid response option code: {code}
Answer Validation
For single or free text questions, if more than one answer is provided, the following error message will be returned:
Question of type {type} is expecting at most one answer
For free text questions, the answer object must include a valueString
or the following error message will be returned:
Question of type TXT expects a valueString answer
For single or multiple choice questions, the answer objects must include a valueCoding
or one of the following error messages will be returned:
Question of type SING expects a valueCoding answer
Question of type MULT expects a valueCoding answer
Attributes
The identifier of the QuestionnaireResponse
Additional content defined by implementations
Currently we support two different extensions in this object
- 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. This value is autogenerated, so it is not processed during create interactions. You will only see this value in a Read/Search request.
Reference that defines the content of this object. Currently we only support two different urls
1. For permalinks which have a url of http://schemas.canvasmedical.com/fhir/extensions/questionnaire-permalink
2. For note identifier we have a url of http://schemas.canvasmedical.com/fhir/extensions/note-id
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=
The valueId field is used for the Note extension and will be the note’s unique identifier
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.
The position of the questionnaire response within its overall lifecycle
Supported codes for create interactions are: completed
The subject of the questions
The reference string of the subject in the format of "Patient/a39cafb9d1b445be95a2e2548e12a787"
Type the reference refers to (e.g. “Patient”)
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.
The reference string of the encounter in the format of "Encounter/cdbd6534-ba0d-4917-a5a6-6a2d46dcf0f7"
Type the reference refers to (e.g. “Encounter”)
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.
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
The reference string of the author in the format of "Practitioner/cdbd6534-ba0d-4917-a5a6-6a2d46dcf0f7"
Type the reference refers to (e.g. “Patient”, “Practitioner”)
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.
Canvas supports LOINC, SNOMED, and INTERNAL code systems for for answers provided as a valueCoding
. The following mappings show how the FHIR system URI is mapped to the Canvas system (FHIR -> Canvas):
FHIR system uri | Canvas system value |
---|---|
http://loinc.org | LOINC |
http://snomed.info/sct | SNOMED |
http://canvasmedical.com | CANVAS |
http://www.ama-assn.org/go/cpt | CPT |
http://hl7.org/fhir/sid/icd-10 | ICD-10 |
http://schemas.{instance-name}.canvasmedical.com/fhir/systems/internal | INTERNAL |
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
Human readable text of the question. Not stored but can be helpful to include for troubleshooting.
A list of one or more answers to this question.
• If this is for a 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.
• If this is 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 objects containing a code
, display
, and system
Responses
Canvas returns the created resource's id as a UUID within the
location
header and a null
response body.Errors
QuestionnaireResponse read
Read an QuestionnaireResponse resource.
Path Parameters
Response Payload Attributes
The identifier of the QuestionnaireResponse
Additional content defined by implementations
Currently we support two different extensions in this object
- 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. This value is autogenerated, so it is not processed during create interactions. You will only see this value in a Read/Search request.
Reference that defines the content of this object. Currently we only support two different urls
1. For permalinks which have a url of http://schemas.canvasmedical.com/fhir/extensions/questionnaire-permalink
2. For note identifier we have a url of http://schemas.canvasmedical.com/fhir/extensions/note-id
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=
The valueId field is used for the Note extension and will be the note’s unique identifier
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.
The position of the questionnaire response within its overall lifecycle
Supported codes for create interactions are: completed
The subject of the questions
The reference string of the subject in the format of "Patient/a39cafb9d1b445be95a2e2548e12a787"
Type the reference refers to (e.g. “Patient”)
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.
The reference string of the encounter in the format of "Encounter/cdbd6534-ba0d-4917-a5a6-6a2d46dcf0f7"
Type the reference refers to (e.g. “Encounter”)
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.
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
The reference string of the author in the format of "Practitioner/cdbd6534-ba0d-4917-a5a6-6a2d46dcf0f7"
Type the reference refers to (e.g. “Patient”, “Practitioner”)
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.
Canvas supports LOINC, SNOMED, and INTERNAL code systems for for answers provided as a valueCoding
. The following mappings show how the FHIR system URI is mapped to the Canvas system (FHIR -> Canvas):
FHIR system uri | Canvas system value |
---|---|
http://loinc.org | LOINC |
http://snomed.info/sct | SNOMED |
http://canvasmedical.com | CANVAS |
http://www.ama-assn.org/go/cpt | CPT |
http://hl7.org/fhir/sid/icd-10 | ICD-10 |
http://schemas.{instance-name}.canvasmedical.com/fhir/systems/internal | INTERNAL |
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
Human readable text of the question. Not stored but can be helpful to include for troubleshooting.
A list of one or more answers to this question.
• If this is for a 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.
• If this is 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 objects containing a code
, display
, and system
Responses
Errors
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
The identifier of the QuestionnaireResponse
Additional content defined by implementations
Currently we support two different extensions in this object
- 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. This value is autogenerated, so it is not processed during create interactions. You will only see this value in a Read/Search request.
Reference that defines the content of this object. Currently we only support two different urls
1. For permalinks which have a url of http://schemas.canvasmedical.com/fhir/extensions/questionnaire-permalink
2. For note identifier we have a url of http://schemas.canvasmedical.com/fhir/extensions/note-id
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=
The valueId field is used for the Note extension and will be the note’s unique identifier
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.
The position of the questionnaire response within its overall lifecycle
Supported codes for create interactions are: completed
The subject of the questions
The reference string of the subject in the format of "Patient/a39cafb9d1b445be95a2e2548e12a787"
Type the reference refers to (e.g. “Patient”)
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.
The reference string of the encounter in the format of "Encounter/cdbd6534-ba0d-4917-a5a6-6a2d46dcf0f7"
Type the reference refers to (e.g. “Encounter”)
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.
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
The reference string of the author in the format of "Practitioner/cdbd6534-ba0d-4917-a5a6-6a2d46dcf0f7"
Type the reference refers to (e.g. “Patient”, “Practitioner”)
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.
Canvas supports LOINC, SNOMED, and INTERNAL code systems for for answers provided as a valueCoding
. The following mappings show how the FHIR system URI is mapped to the Canvas system (FHIR -> Canvas):
FHIR system uri | Canvas system value |
---|---|
http://loinc.org | LOINC |
http://snomed.info/sct | SNOMED |
http://canvasmedical.com | CANVAS |
http://www.ama-assn.org/go/cpt | CPT |
http://hl7.org/fhir/sid/icd-10 | ICD-10 |
http://schemas.{instance-name}.canvasmedical.com/fhir/systems/internal | INTERNAL |
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
Human readable text of the question. Not stored but can be helpful to include for troubleshooting.
A list of one or more answers to this question.
• If this is for a 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.
• If this is 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 objects containing a code
, display
, and system
Responses
Canvas returns a
null
response body.Errors
QuestionnaireResponse search
Search for QuestionnaireResponse resources.
Query Parameters
The identifier of the QuestionnaireResponse
When the questionnaire response was last changed
The authored
search parameter is a combination of an operand and a date/datetime in ISO8601 format. The currently-supported operands are:
• eq
: search for QuestionnaireResponse resources authored on a specific date, or at a specific datetime
• gt
: search for QuestionnaireResponse resources authored after a specific date or datetime
• ge
: search for QuestionnaireResponse resources authored on or after a specific date, or at or after a specific datetime
• lt
: search for QuestionnaireResponse resources authored before a specific date or datetime
• le
: search for QuestionnaireResponse resources authored on or before a specific date, or at or before a specific datetime
The authored
parameter can be in the query string multiple times, which allows for specifying a date range, e.g. /QuestionnaireResponse?authored=ge2021-09-16&authored=le2021-10-01
.
The patient that is the subject of the questionnaire response
The questionnaire the answers are provided for
The questionnaire the answers are provided for
A code that corresponds to one of its items in the questionnaire
Triggers sorting of the results by a specific criteria. Accepted values are _id and authored. Use -_id or -authored to sort in descending order.
Response Payload Attributes
The FHIR Resource name.
This element and value designate that the bundle is a search response. Search result bundles will always have the Bundle.type of searchset .
The number of resources that match the search parameter.
Attributes relevant to pagination, see our Pagination page for more detail.
The relation of the page search
The search url for the specific relation
The results bundle that lists out each object returned in the search
The attributes specific to the resource type, see the Attributes section below
Attributes
The identifier of the QuestionnaireResponse
Additional content defined by implementations
Currently we support two different extensions in this object
- 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. This value is autogenerated, so it is not processed during create interactions. You will only see this value in a Read/Search request.
Reference that defines the content of this object. Currently we only support two different urls
1. For permalinks which have a url of http://schemas.canvasmedical.com/fhir/extensions/questionnaire-permalink
2. For note identifier we have a url of http://schemas.canvasmedical.com/fhir/extensions/note-id
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=
The valueId field is used for the Note extension and will be the note’s unique identifier
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.
The position of the questionnaire response within its overall lifecycle
Supported codes for create interactions are: completed
The subject of the questions
The reference string of the subject in the format of "Patient/a39cafb9d1b445be95a2e2548e12a787"
Type the reference refers to (e.g. “Patient”)
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.
The reference string of the encounter in the format of "Encounter/cdbd6534-ba0d-4917-a5a6-6a2d46dcf0f7"
Type the reference refers to (e.g. “Encounter”)
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.
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
The reference string of the author in the format of "Practitioner/cdbd6534-ba0d-4917-a5a6-6a2d46dcf0f7"
Type the reference refers to (e.g. “Patient”, “Practitioner”)
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.
Canvas supports LOINC, SNOMED, and INTERNAL code systems for for answers provided as a valueCoding
. The following mappings show how the FHIR system URI is mapped to the Canvas system (FHIR -> Canvas):
FHIR system uri | Canvas system value |
---|---|
http://loinc.org | LOINC |
http://snomed.info/sct | SNOMED |
http://canvasmedical.com | CANVAS |
http://www.ama-assn.org/go/cpt | CPT |
http://hl7.org/fhir/sid/icd-10 | ICD-10 |
http://schemas.{instance-name}.canvasmedical.com/fhir/systems/internal | INTERNAL |
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
Human readable text of the question. Not stored but can be helpful to include for troubleshooting.
A list of one or more answers to this question.
• If this is for a 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.
• If this is 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 objects containing a code
, display
, and system
Responses
Errors
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%2Fb8dfa97bdcdf4754bcd8197ca78ef0f0' \ --header 'Authorization: Bearer <token>' \ --header 'accept: application/json'
import requests url = "https://fumage-example.canvasmedical.com/QuestionnaireResponse?patient=Patient%2Fb8dfa97bdcdf4754bcd8197ca78ef0f0" 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" } } ] }