# QuestionnaireResponsesResource

Canonical page: https://docs.ovok.com/java-sdk/reference/questionnaire-responses-resource

```java
public final class QuestionnaireResponsesResource
```

Submits QuestionnaireResponses and extracts data from them. Get it from [`Ovok.questionnaireResponses()`](/java-sdk/reference/ovok#questionnaireresponses).

## Methods [#methods]

### submit [#submit]

```java
public JsonNode submit(JsonNode response) throws IOException, InterruptedException
```

Creates a QuestionnaireResponse in a FHIR transaction.

**Parameters:**

- `response`: the QuestionnaireResponse to create

**Returns:** the transaction response

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response

```java
public JsonNode submit(
        JsonNode response,
        RequestOptions options) throws IOException, InterruptedException
```

Creates a QuestionnaireResponse in a FHIR transaction.

**Parameters:**

- `response`: the QuestionnaireResponse to create
- `options`: per-request options, such as the timeout

**Returns:** the transaction response

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response

### submitWithObservations [#submitwithobservations]

```java
public JsonNode submitWithObservations(
        JsonNode response,
        List<JsonNode> observations) throws IOException, InterruptedException
```

Creates a QuestionnaireResponse and Observations in one FHIR transaction.

**Parameters:**

- `response`: the QuestionnaireResponse to create
- `observations`: Observations to create in the same transaction

**Returns:** the transaction response

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response

```java
public JsonNode submitWithObservations(
        JsonNode response,
        List<JsonNode> observations,
        RequestOptions options) throws IOException, InterruptedException
```

Creates a QuestionnaireResponse and Observations in one FHIR transaction.

**Parameters:**

- `response`: the QuestionnaireResponse to create
- `observations`: Observations to create in the same transaction
- `options`: per-request options, such as the timeout

**Returns:** the transaction response

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response

### extract [#extract]

```java
public JsonNode extract(String questionnaireResponseId) throws IOException, InterruptedException
```

Extracts resources from a QuestionnaireResponse (`POST /fhir/QuestionnaireResponse/{id}/$extract`).

**Parameters:**

- `questionnaireResponseId`: the QuestionnaireResponse ID

**Returns:** the response body

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response

```java
public JsonNode extract(
        String questionnaireResponseId,
        RequestOptions options) throws IOException, InterruptedException
```

Extracts resources from a QuestionnaireResponse (`POST /fhir/QuestionnaireResponse/{id}/$extract`).

**Parameters:**

- `questionnaireResponseId`: the QuestionnaireResponse ID
- `options`: per-request options, such as the timeout

**Returns:** the response body

**Throws:**

- `IOException`: if the request cannot be sent or the response cannot be read
- `InterruptedException`: if the thread is interrupted while waiting for the response
