> ## Documentation Index
> Fetch the complete documentation index at: https://help.elationhealth.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Questionnaire Response

## Overview

QuestionnaireResponse provides a complete or partial list of answers to a set of questions filled when responding to a questionnaire. This resource store to form/survey and assessment tools such as the Protocol for Responding to and Assessing Patients’ Assets, Risks, and Experiences (PRAPARE) Survey. This profile is based on the [Structured Data Capture (SDC) Questionnaire Response Profile](http://hl7.org/fhir/uv/sdc/STU3/StructureDefinition-sdc-questionnaireresponse.html).

QuestionnaireResponse along with the [US Core Care Plan Profile](/articles/fhir/uscdi-care-plan), [US Core Observation Survey Profile](/articles/fhir/uscdi-observation-survey), [US Core Observation SDOH Profile](/articles/fhir/uscdi-observation-sdoh-assessment) and [US Core Observation Social History Profile](/articles/fhir/uscdi-observation-social-history) meets the US Core Data for Interoperability (USCDI) v2 Assessment and Plan of Treatment requirements.

**Example Usage Scenarios:**

The following are example usage scenarios for this profile:

* Query for survey screening results for a patient.
* Record or update screening results results belonging to a Patient

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 must support:

* a tag to indicate context like SDOH
* 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 SDC profile (from which this profile is derived) focuses on the constraints appropriate to capturing the “answer(s)” to a [FHIR Questionnaire](http://hl7.org/fhir/R4/questionnaire.html) and demands that the Questionnaire’s canonical URL be specified. If the QuestionnaireResponse is based on a non-FHIR form:
  1. Construct a FHIR Questionnaire which represents at least the relevant metadata (in other words, the actual questions may be omitted).
  2. Communicates the identifier of the non-FHIR form instead of the canonical URI using the [US Core Extension Questionnaire URI](https://www.hl7.org/fhir/us/core/StructureDefinition-us-core-extension-questionnaire-uri.html) extension.
* See the [SDOH](https://www.hl7.org/fhir/us/core/sdoh.html) guidance page for how this profile or alternatively Observations can be used represent SDOH assessments.
* QuestionnaireResponse can be searched using the standard FHIR RESTful API search parameters.
* The basic workflow for the creation, discovery and retrieval and data-extraction of FHIR Questionnaire and QuestionnaireResponse is thoroughly documented in the [Structured Data Capture (SDC](http://hl7.org/fhir/uv/sdc) implementation guide.

This resource conforms to [USCDI V2 profile](https://www.healthit.gov/isa/uscdi-data-class/assessment-and-plan-treatment#uscdi-v2) for Assessment and Plan of Treatment - refers to [US Core QuestionnaireResponse Profile](https://www.hl7.org/fhir/us/core/StructureDefinition-us-core-questionnaireresponse.html). QuestionnaireResponse response will be provided in JSON (refers to Capability Statement) format as per [FHIR](https://hl7.org/fhir) standard R4 version.

### Must support elements, mandatory and optional search parameters

*QuestionnaireResponse**must support** these elements:*

* meta
  * tag
    * Slices:
      * All slices
    * :sdoh
* identifier
* questionnaire
  * display
  * us-core-extension-questionnaire-uri
* status
* subject
* authored
* author
* item
  * linkId
  * text
  * answer
    * value\[x]
      * valueDecimal
      * valueString
      * valueCoding
    * item
  * item

*The following search parameters and search parameter combinations SHALL be supported (**mandatory**):*

The syntax used to describe the interactions is described [here](/articles/fhir/us-core-guidance).

**SHALL** support fetching a QuestionnaireResponse using the \_id search parameter:

`GET [base url]/QuestionnaireResponse[id]`

**SHALL** support searching for all QuestionnaireResponse for a patient using the patient search parameter:

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

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

**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 url]/QuestionnaireResponse?patient={Type/}[id]&status={system|}[code]{,{system|}[code],...}`

**SHOULD** support searching using the combination of the `patient` and `_tag` search parameters:

`GET [base url]/QuestionnaireResponse?patient={Type/}[id]&_tag=sdoh`

**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 url]/QuestionnaireResponse?patient={Type/}[id]&authored={gt|lt|ge|le}[date]{&authored={gt|lt|ge|le}[date]&...}`

**SHOULD** support searching using the combination of the `patient` and `_tag` 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]&_tag=sdoh&authored={gt|lt|ge|le}[date]{&authored={gt|lt|ge|le}[date]&...}`

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

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

## QuestionnaireResponse by Id

Get a QuestionnaireResponse by id

**METHOD** *GET*

```
GET [base url]/QuestionnaireResponse/[id]
```

or

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

**PARAMS**

\[base url] - [FHIR base url](/articles/fhir/service-base-urls)\
\[id] - QuestionnaireResponse id

**HEADERS**

The Authorization token SHALL be obtained during the Authentication and Authorization process. Go to [Authentication and Authorization](/articles/fhir/authentication-authorization) for further details.

| Header        | Type       | Required/Optional | Value            |
| ------------- | ---------- | ----------------- | ---------------- |
| Authorization | **string** | required          | `Bearer <token>` |

**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                                                                            |

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

**EXAMPLE:**

```
curl --location --request GET 'https://sandbox.fhir.elationemr.com/fhir/QuestionnaireResponse/b110cfa5-ab16-b12a-fbbc-f22323a3c1g7' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'
```

## QuestionnaireResponse by patient

Fetches a bundle of all QuestionnaireResponse resources for the specified patient

**METHOD** *GET*

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

**PARAMS**\
\[base url] - [FHIR base url](/articles/fhir/service-base-urls)\
\{Type/} - optional reference type. *Example:* `Patient/`\
\[id] - patient id

**HEADERS**

The Authorization token SHALL be obtained during the Authentication and Authorization process.   [Authentication and Authorization](/articles/fhir/authentication-authorization) for further details.

| Header        | Type       | Required/Optional | Value            |
| ------------- | ---------- | ----------------- | ---------------- |
| Authorization | **string** | required          | `Bearer <token>` |

**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                                                                            |

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

**EXAMPLE:**

```
curl --location --request GET 'https://sandbox.fhir.elationemr.com/fhir/QuestionnaireResponse?patient=Patient/a210cfa5-2116-c12a-fbbc-f2c323a3c1g7' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'
```

## QuestionnaireResponse by patient and status

Fetches a bundle of all QuestionnaireResponse resources for the specified patient and status

**METHOD** *GET*

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

**PARAMS**\
\[base url] - [FHIR base url](/articles/fhir/service-base-urls)\
\{Type/} - optional reference type. *Example:* `Patient/`\
\[id] - patient id\
\{system|} - The system for the category\
\[code] - code in the system, e.g. `completed`

**HEADERS**

The Authorization token SHALL be obtained during the Authentication and Authorization process.   [Authentication and Authorization](/articles/fhir/authentication-authorization) for further details.

| Header        | Type       | Required/Optional | Value            |
| ------------- | ---------- | ----------------- | ---------------- |
| Authorization | **string** | required          | `Bearer <token>` |

**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                                                                            |

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

**EXAMPLE:**

```
curl --location --request GET 'https://sandbox.fhir.elationemr.com/fhir/QuestionnaireResponse?patient=Patient/a210cfa5-2116-c12a-fbbc-f2c323a3c1g7&status=completed' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'
```

## QuestionnaireResponse by patient and \_tag

Fetches a bundle of all QuestionnaireResponse resources for the specified patient and \_tag= 'sdoh'

**METHOD** *GET*

```
GET [base url]/QuestionnaireResponse?patient={Type/}[id]&_tag=sdoh
```

**PARAMS**\
\[base url] - [FHIR base url](/articles/fhir/service-base-urls)\
\{Type/} - optional reference type. *Example:* `Patient/`\
\[id] - patient id

**HEADERS**

The Authorization token SHALL be obtained during the Authentication and Authorization process.   [Authentication and Authorization](/articles/fhir/authentication-authorization) for further details.

| Header        | Type       | Required/Optional | Value            |
| ------------- | ---------- | ----------------- | ---------------- |
| Authorization | **string** | required          | `Bearer <token>` |

**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                                                                            |

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

**EXAMPLE:**

```
curl --location --request GET 'https://sandbox.fhir.elationemr.com/fhir/QuestionnaireResponse?patient=Patient/a210cfa5-2116-c12a-fbbc-f2c323a3c1g7&_tag=sdoh' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'
```

## QuestionnaireResponse by patient and authored

Fetches a bundle of all QuestionnaireResponse resources for the specified patient and date

**METHOD** *GET*

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

**PARAMS**\
\[base url] - [FHIR base url](/articles/fhir/service-base-urls)\
\{Type/} - optional reference type. *Example:* `Patient/`\
\[id] - patient id\
\[date] - an estimated or actual date, when the QuestionnaireResponse signed\
\{gt|lt|ge|le} - search modifiers for date parameter. See [Search specification](https://www.hl7.org/fhir/search.html#date) for more information

**HEADERS**

The Authorization token SHALL be obtained during the Authentication and Authorization process.   [Authentication and Authorization](/articles/fhir/authentication-authorization) for further details.

| Header        | Type       | Required/Optional | Value            |
| ------------- | ---------- | ----------------- | ---------------- |
| Authorization | **string** | required          | `Bearer <token>` |

**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                                                                            |

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

**EXAMPLE:**

```
curl --location --request GET 'https://sandbox.fhir.elationemr.com/fhir/QuestionnaireResponse?patient=Patient/a210cfa5-2116-c12a-fbbc-f2c323a3c1g7&date=ge2022' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'
```

## QuestionnaireResponse by patient and \_tag and authored

Fetches a bundle of all QuestionnaireResponse resources tagged as 'sdoh' for the specified patient and date

**METHOD** *GET*

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

**PARAMS**\
\[base url] - [FHIR base url](/articles/fhir/service-base-urls)\
\{Type/} - optional reference type. *Example:* `Patient/`\
\[id] - patient id\
\[date] - an estimated or actual date, when the QuestionnaireResponse signed\
\{gt|lt|ge|le} - search modifiers for date parameter. See [Search specification](https://www.hl7.org/fhir/search.html#date) for more information

**HEADERS**

The Authorization token SHALL be obtained during the Authentication and Authorization process.   [Authentication and Authorization](/articles/fhir/authentication-authorization) for further details.

| Header        | Type       | Required/Optional | Value            |
| ------------- | ---------- | ----------------- | ---------------- |
| Authorization | **string** | required          | `Bearer <token>` |

**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                                                                            |

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

**EXAMPLE:**

```
curl --location --request GET 'https://sandbox.fhir.elationemr.com/fhir/QuestionnaireResponse?patient=Patient/a210cfa5-2116-c12a-fbbc-f2c323a3c1g7&_tag=sdoh&date=ge2022' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'
```

## QuestionnaireResponse by patient and questionnaire

Fetches a bundle of all QuestionnaireResponse resources for the specified patient that have been completed against a specified form

**METHOD** *GET*

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

**PARAMS**\
\[base url] - [FHIR base url](/articles/fhir/service-base-urls)\
\{Type/} - optional reference type. *Example:* `Patient/`\
\[id] - patient id\
\[questionnaire\_id] - questionnaire id

**HEADERS**

The Authorization token SHALL be obtained during the Authentication and Authorization process.   [Authentication and Authorization](/articles/fhir/authentication-authorization) for further details.

| Header        | Type       | Required/Optional | Value            |
| ------------- | ---------- | ----------------- | ---------------- |
| Authorization | **string** | required          | `Bearer <token>` |

**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                                                                            |

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

**EXAMPLE:**

```
curl --location --request GET 'https://sandbox.fhir.elationemr.com/fhir/QuestionnaireResponse?patient=Patient/a210cfa5-2116-c12a-fbbc-f2c323a3c1g7&questionnaire=http://hl7.org/fhir/us/sdoh-clinicalcare/Questionnaire/SDOHCC-QuestionnaireHungerVitalSign' \
--header 'Authorization: Bearer fe1cd986-1ac7-4c26-b8b3-d632a48408fd'
```
