Skip to content

QuestionnaireResponse

Overview

Represents a structured set of questions and their answers. The QuestionnaireResponse resource is used to capture data in a structured or semi-structured way, providing a complete or partial list of answers to a set of questions filled in when responding to a questionnaire. It supports both complete and partial responses and can represent responses collected through various methods including interviews, forms, or automated processes.

Each QuestionnaireResponse has next elements:

  • a reference back to the assessment upon which it is based
  • a status
  • a patient
  • the date the answers were gathered

Each QuestionnaireResponse supports next elements:

  • a practitioner who recorded the answers
  • the questions and decimal, string, and coded type answers
    • each question must have a identifier the pointing to question

Profile specific implementation guidance:

  • The QuestionnaireResponse resource is used to represent the USCDI v3 Clinical Test and Assessment structured and unstructured data.
  • This Profile references a Questionnaire resource that defines the questions being answered
  • The questionnaire reference can be canonical (URL to a published questionnaire) or a direct reference to a Questionnaire resource
  • The server systems SHALL support the questionnaire reference
  • The client application SHALL support processing questionnaire references
  • Answers can be of various types including strings, integers, decimals, booleans, dates, times, choices, and attachments
  • Items can be nested to represent hierarchical question structures and repeating groups
  • The resource supports partial responses where not all questions have been answered

This resource conforms to USCDI V3 profile for QuestionnaireResponse - refer to StructureDefinition US Core QuestionnaireResponse. QuestionnaireResponse response will be provided in JSON (refers to Capability Statement) format as per FHIR standard R4 version.

Must support elements, mandatory and optional search parameters

QuestionnaireResponse must support these elements:

  • identifier
  • questionnaire
    • questionnaireDisplay
    • url
  • status
  • subject
  • authored
  • author
  • item
  • linkId
  • text
  • answer
    • value[x]
    • item
  • item

The following search parameters and search parameter combinations SHALL be supported:

SHALL support both read QuestionnaireResponse by id AND QuestionnaireResponse search using the _id search parameter:

GET [base]/QuestionnaireResponse/[id]

or

GET [base]/QuestionnaireResponse?_id=[id]

SHALL support searching using the patient search parameter:

GET [base]/QuestionnaireResponse?patient=14676

The following search parameter combinations SHOULD be supported (optional):

SHOULD support searching using the combination of the patient and questionnaire search parameters:

GET [base]/QuestionnaireResponse?patient={Type/}[id]&questionnaire=[url]

SHOULD support searching using the combination of the patient and status search parameters:

  • including support for OR search on status (e.g.status={system|}[code],{system|}[code],...)

GET [base]/QuestionnaireResponse?patient={Type/}[id]&status={system|}[code]

SHOULD support searching using the combination of the patient and authored search parameters:

  • including support for these authored comparators: gt,lt,ge,le
  • including optional support for AND search on authored (e.g.authored=[date]&authored=[date]&...)

GET [base]/QuestionnaireResponse?patient={Type/}[id]&authored={gt|lt|ge|le}[date]

The response to any search operation is always a list of resources in a Bundle or an Operation Outcome.

QuestionnaireResponse By Id

METHOD GET

[base url]/QuestionnaireResponse/[id]

or

[base url]/QuestionnaireResponse?_id=[id]

PARAMS

[base url] - FHIR base url

[id] - Id for QuestionnaireResponse resource

HEADERS

The Authorization token SHALL be obtained during Authentication and Authorization process. Goto Authentication and Authorization for further details.

Header Type Required/Optional Value
Authorization string required 'Bearer'

RESPONSES

Code Description Comment
200 OK The request was processed successfully
400 Bad request Invalid request parameters or FHIR operation outcome resource returned
401 Unauthorized This code indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource
404 no Route matched with those values The request was able to communicate with a given server, but the server could not find what was requested
500 Internal Server Error The server has encountered a situation it doesn't know how to handle

EXAMPLE:

curl --location --request GET 'https://sandbox.fhir.elationemr.com/fhir/QuestionnaireResponse/c5137fa5-3216-b12a-cbbc-a0c6bef361g7' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'

QuestionnaireResponse By Patient Id

Search for QuestionnaireResponse by patient.

METHOD GET

[base url]/QuestionnaireResponse?patient={Type/}[id]

PARAMS

[base url] - FHIR base url

[id] - Id for the Patient

HEADERS

The Authorization token SHALL be obtained during Authentication and Authorization process. Goto Authentication and Authorization for further details.

Header Type Required/Optional Value
Authorization string required 'Bearer'

RESPONSES

Code Description Comment
200 OK The request was processed successfully
400 Bad request Invalid request parameters or FHIR operation outcome resource returned
401 Unauthorized This code indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource
404 no Route matched with those values The request was able to communicate with a given server, but the server could not find what was requested
500 Internal Server Error The server has encountered a situation it doesn't know how to handle

EXAMPLE:

curl --location --request GET 'https://sandbox.fhir.elationemr.com/fhir/QuestionnaireResponse?patient=Patient/c5137fa5-3216-b12a-cbbc-a0c6bef361g7' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'

QuestionnaireResponse by patient and questionnaire search parameters

Get QuestionnaireResponses using the combination of the patient and questionnaire search parameters

METHOD GET

GET [base url]/QuestionnaireResponse?patient={Type/}[id]&questionnaire=[url]

PARAMS

[base url] - FHIR base url

{Type/} - Type for the Reference. Example: Patient [id] - patient id [url] - canonical URL or reference to the Questionnaire

HEADERS

The Authorization token SHALL be obtained during Authentication and Authorization process. Goto Authentication and Authorization for further details.

Header Type Required/Optional Value
Authorization string required 'Bearer'

RESPONSES

Code Description Comment
200 OK The request was processed successfully
400 Bad request Invalid request parameters or FHIR operation outcome resource returned
401 Unauthorized This code indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource
404 no Route matched with those values The request was able to communicate with a given server, but the server could not find what was requested
500 Internal Server Error The server has encountered a situation it doesn't know how to handle

EXAMPLE:

curl --location --request GET 'https://sandbox.fhir.elationemr.com/fhir/QuestionnaireResponse?patient=Patient/fe1cd986-1ac7-4c26-b8b3-d632a48408fd&questionnaire=http://example.org/fhir/Questionnaire/phq-9' \
--header 'Authorization: Bearer 1239b275-909e-4754-8f73-1e411fd6769e'

QuestionnaireResponse by patient and status search parameters

Get QuestionnaireResponses using the combination of the patient and status search parameters

METHOD GET

GET [base url]/QuestionnaireResponse?patient={Type/}[id]&status={system|}[code]

PARAMS

[base url] - FHIR base url

{Type/} - Type for the Reference. Example: Patient

[id] - patient id

{system|} - terminology system used to identify questionnaire response status (optional)

[code] - status of the questionnaire response (e.g., in-progress, completed, amended, entered-in-error, stopped)

HEADERS

The Authorization token SHALL be obtained during Authentication and Authorization process. Goto Authentication and Authorization for further details.

Header Type Required/Optional Value
Authorization string required 'Bearer'

RESPONSES

Code Description Comment
200 OK The request was processed successfully
400 Bad request Invalid request parameters or FHIR operation outcome resource returned
401 Unauthorized This code indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource
404 no Route matched with those values The request was able to communicate with a given server, but the server could not find what was requested
500 Internal Server Error The server has encountered a situation it doesn't know how to handle

EXAMPLE:

curl --location --request GET 'https://sandbox.fhir.elationemr.com/fhir/QuestionnaireResponse?patient=Patient/fe1cd986-1ac7-4c26-b8b3-d632a48408fd&status=completed' \
--header 'Authorization: Bearer 1239b275-909e-4754-8f73-1e411fd6769e'

QuestionnaireResponse by patient and authored search parameters

Get QuestionnaireResponses using the combination of the patient and authored search parameters

METHOD GET

GET [base url]/QuestionnaireResponse?patient={Type/}[id]&authored={gt|lt|ge|le}[date]

PARAMS

[base url] - FHIR base url

{Type/} - Type for the Reference. Example: Patient

[id] - patient id

{gt|lt|ge|le} - comparison operator (greater than, less than, greater than or equal, less than or equal)

[date] - the date/time when the questionnaire response was authored

HEADERS

The Authorization token SHALL be obtained during Authentication and Authorization process. Goto Authentication and Authorization for further details.

Header Type Required/Optional Value
Authorization string required 'Bearer'

RESPONSES

Code Description Comment
200 OK The request was processed successfully
400 Bad request Invalid request parameters or FHIR operation outcome resource returned
401 Unauthorized This code indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource
404 no Route matched with those values The request was able to communicate with a given server, but the server could not find what was requested
500 Internal Server Error The server has encountered a situation it doesn't know how to handle

EXAMPLE:

curl --location --request GET 'https://sandbox.fhir.elationemr.com/fhir/QuestionnaireResponse?patient=Patient/fe1cd986-1ac7-4c26-b8b3-d632a48408fd&authored=ge2024-01-01' \
--header 'Authorization: Bearer 1239b275-909e-4754-8f73-1e411fd6769e'