# @ovok/native/questionnaire-response-form

Canonical page: https://docs.ovok.com/native-sdk/reference/questionnaire-response-form

FHIR questionnaire forms: providers, navigation, item renderers and answer helpers.

Import from `@ovok/native/questionnaire-response-form`.

## Components [#components]

### QuestionnaireForm [#questionnaireform]

```ts
const QuestionnaireForm: NamedExoticComponent<QuestionnaireFormProps> & object & object;
```

Form that renders a FHIR Questionnaire and submits a QuestionnaireResponse; compose it with the `QuestionnaireForm.*` sub-components.

#### Type Declaration [#type-declaration]

| Name | Type | Description |
| ------ | ------ | ------ |
| `Content` | `NamedExoticComponent`\<`QuestionnaireContentProps`\> & `object` & `object` | Renders the current page or items. |
| `Header` | `NamedExoticComponent`\<[`QuestionnaireHeaderProps`](#questionnaireheaderprops)\> & `object` & `object` | Header showing progress through the questionnaire. |
| `Navigation` | `NamedExoticComponent`\<`Omit`\<`KeyboardAvoidingViewProps`, `"contentContainerStyle"`\>\> & `object` & `object` | Back, next and submit controls. |

***

### QuestionnaireFormProvider [#questionnaireformprovider]

```ts
const QuestionnaireFormProvider: MemoExoticComponent<(__namedParameters) => Element>;
```

Owns the Formik state, validation and submission for a questionnaire and provides it to descendants.

***

### QuestionnaireNavigationProvider [#questionnairenavigationprovider]

```ts
const QuestionnaireNavigationProvider: React.FC<React.PropsWithChildren<QuestionnaireNavigationProviderProps>>;
```

Provides navigation state and next and previous handlers to the form controls.

## Hooks [#hooks]

### useQuestionnaireForm() [#usequestionnaireform]

```ts
function useQuestionnaireForm(): QuestionnaireFormContextType;
```

Returns the questionnaire form context; must be used within a `QuestionnaireFormProvider`.

#### Returns [#returns]

[`QuestionnaireFormContextType`](#questionnaireformcontexttype)

***

### useQuestionnaireNavigation() [#usequestionnairenavigation]

```ts
function useQuestionnaireNavigation(): QuestionnaireNavigationContextType;
```

Returns the navigation state and handlers; must be used within a `QuestionnaireNavigationProvider`.

#### Returns [#returns-1]

`QuestionnaireNavigationContextType`

***

### useQuestionnaireNavigationState() [#usequestionnairenavigationstate]

```ts
function useQuestionnaireNavigationState(
   currentItem,
   currentPageIndex,
   currentItemIndex,
   enabledItems,
   pages,
   values,
   allEnabledItems,
   renderItem?
): NavigationState;
```

Derives navigation flags and the item count from the current position and answers.

#### Parameters [#parameters]

| Parameter | Type |
| ------ | ------ |
| `currentItem` | [`ExtendedQuestionnaireItem`](#extendedquestionnaireitem) \| `undefined` |
| `currentPageIndex` | `number` |
| `currentItemIndex` | `number` |
| `enabledItems` | [`ExtendedQuestionnaireItem`](#extendedquestionnaireitem)[] |
| `pages` | [`ExtendedQuestionnaireItem`](#extendedquestionnaireitem)[] |
| `values` | [`QuestionnaireFormValues`](#questionnaireformvalues) |
| `allEnabledItems` | [`ExtendedQuestionnaireItem`](#extendedquestionnaireitem)[] |
| `renderItem?` | [`QuestionnaireItemRenderer`](#questionnaireitemrenderer) |

#### Returns [#returns-2]

`NavigationState`

## Classes [#classes]

### QuestionnaireSubmitUtils [#questionnairesubmitutils]

Helpers for building and saving a QuestionnaireResponse.

#### Constructors [#constructors]

##### Constructor [#constructor]

```ts
new QuestionnaireSubmitUtils(): QuestionnaireSubmitUtils;
```

###### Returns [#returns-3]

[`QuestionnaireSubmitUtils`](#questionnairesubmitutils)

#### Methods [#methods]

##### createQuestionnaireResponse() [#createquestionnaireresponse]

```ts
static createQuestionnaireResponse(
   responses,
   pages,
   questionnaire,
   renderItem?,
   resolver?,
   unitOptionsResolver?
): QuestionnaireResponse;
```

Builds a QuestionnaireResponse from the form values; its status is `in-progress` while required items are unanswered, otherwise `completed`.

###### Parameters [#parameters-1]

| Parameter | Type |
| ------ | ------ |
| `responses` | [`ResponseValues`](#responsevalues) |
| `pages` | [`ExtendedQuestionnaireItem`](#extendedquestionnaireitem)[] |
| `questionnaire` | `Questionnaire` |
| `renderItem?` | [`QuestionnaireItemRenderer`](#questionnaireitemrenderer) |
| `resolver?` | [`QuestionnaireConstraintResolver`](#questionnaireconstraintresolver) |
| `unitOptionsResolver?` | [`QuestionnaireUnitOptionsResolver`](#questionnaireunitoptionsresolver) |

###### Returns [#returns-4]

`QuestionnaireResponse`

##### persistQuestionnaireResponse() [#persistquestionnaireresponse]

```ts
static persistQuestionnaireResponse(
   client,
   response,
   extractObservations
): Promise<QuestionnaireResponse>;
```

Saves the response idempotently by its identifier.
When `extractObservations` is set, also creates the extracted Observations and marks the response completed in one transaction.

###### Parameters [#parameters-2]

| Parameter | Type |
| ------ | ------ |
| `client` | `Ovok` |
| `response` | `QuestionnaireResponse` |
| `extractObservations` | `boolean` |

###### Returns [#returns-5]

`Promise`\<`QuestionnaireResponse`\>

The saved QuestionnaireResponse.

###### Throws [#throws]

Error with a translation key when the save, the extraction or the required transaction support fails.

##### questionnaireHasObservationExtraction() [#questionnairehasobservationextraction]

```ts
static questionnaireHasObservationExtraction(questionnaire): boolean;
```

Whether the questionnaire, or any of its items, asks for Observations to be extracted from the response.

###### Parameters [#parameters-3]

| Parameter | Type |
| ------ | ------ |
| `questionnaire` | `Questionnaire` |

###### Returns [#returns-6]

`boolean`

## Functions [#functions]

### getQuestionnaireAnswerPickerOptions() [#getquestionnaireanswerpickeroptions]

```ts
function getQuestionnaireAnswerPickerOptions(item, locale?): QuestionnaireAnswerPickerOption[];
```

Builds picker options from a choice item's answer options, in order.

#### Parameters [#parameters-4]

| Parameter | Type |
| ------ | ------ |
| `item` | [`ExtendedQuestionnaireItem`](#extendedquestionnaireitem) |
| `locale?` | `string` |

#### Returns [#returns-7]

[`QuestionnaireAnswerPickerOption`](#questionnaireanswerpickeroption)[]

***

### getQuestionnaireItemConstraints() [#getquestionnaireitemconstraints]

```ts
function getQuestionnaireItemConstraints(
   item,
   answers?,
   resolver?,
   unitOptionsResolver?
): QuestionnaireItemConstraints;
```

Reads the value, length, step and unit constraints from a questionnaire item's extensions.

#### Parameters [#parameters-5]

| Parameter | Type |
| ------ | ------ |
| `item` | [`ExtendedQuestionnaireItem`](#extendedquestionnaireitem) |
| `answers?` | [`ResponseValues`](#responsevalues) |
| `resolver?` | [`QuestionnaireConstraintResolver`](#questionnaireconstraintresolver) |
| `unitOptionsResolver?` | [`QuestionnaireUnitOptionsResolver`](#questionnaireunitoptionsresolver) |

#### Returns [#returns-8]

[`QuestionnaireItemConstraints`](#questionnaireitemconstraints)

***

### getQuestionnaireNumericPickerOptions() [#getquestionnairenumericpickeroptions]

```ts
function getQuestionnaireNumericPickerOptions(
   item,
   constraints,
   locale?,
   maximumOptions?
): QuestionnaireNumericPickerOption[];
```

Builds picker options from the item's min, max and step; returns an empty list when the range is missing, invalid or larger than `maximumOptions`.

#### Parameters [#parameters-6]

| Parameter | Type | Default value |
| ------ | ------ | ------ |
| `item` | [`ExtendedQuestionnaireItem`](#extendedquestionnaireitem) | `undefined` |
| `constraints` | [`QuestionnaireItemConstraints`](#questionnaireitemconstraints) | `undefined` |
| `locale?` | `string` | `undefined` |
| `maximumOptions?` | `number` | `1000` |

#### Returns [#returns-9]

[`QuestionnaireNumericPickerOption`](#questionnairenumericpickeroption)[]

***

### useInitialSelectedValues() [#useinitialselectedvalues]

```ts
function useInitialSelectedValues(
   pages,
   values,
   setFieldValue
): void;
```

Hook to handle initializing conditional questions with default values

#### Parameters [#parameters-7]

| Parameter | Type |
| ------ | ------ |
| `pages` | [`ExtendedQuestionnaireItem`](#extendedquestionnaireitem)[] |
| `values` | [`QuestionnaireFormValues`](#questionnaireformvalues) |
| `setFieldValue` | (`field`, `value`, `shouldValidate?`) => `void` |

#### Returns [#returns-10]

`void`

***

### useNavigationHandlers() [#usenavigationhandlers]

```ts
function useNavigationHandlers(__namedParameters): object;
```

Provides navigation handlers for the questionnaire form

#### Parameters [#parameters-8]

| Parameter | Type |
| ------ | ------ |
| `__namedParameters` | `UseNavigationHandlersProps` |

#### Returns [#returns-11]

| Name | Type | Description |
| ------ | ------ | ------ |
| `handleNext()` | () => `void` | Validates the current item, then moves to the next item or page. |
| `handlePrevious()` | () => `void` | Moves back to the previous item or page. |

## Interfaces [#interfaces]

### QuestionnaireFormContextType [#questionnaireformcontexttype]

Value of the questionnaire form context: Formik state plus questionnaire navigation state and helpers.

#### Extends [#extends]

- `FormikProps`\<[`QuestionnaireFormValues`](#questionnaireformvalues)\>

#### Properties [#properties]

| Property | Type | Description |
| ------ | ------ | ------ |
| <a id="property-allitems"></a> `allItems` | [`ExtendedQuestionnaireItem`](#extendedquestionnaireitem)[] | All enabled items in display order. |
| <a id="property-currentitem"></a> `currentItem` | [`ExtendedQuestionnaireItem`](#extendedquestionnaireitem) \| `undefined` | The item currently shown, or `undefined` when there is none. |
| <a id="property-currentitemindex"></a> `currentItemIndex` | `number` | Index of the current item within `allItems`. |
| <a id="property-currentpage"></a> `currentPage` | [`ExtendedQuestionnaireItem`](#extendedquestionnaireitem) | The page (top-level group) currently shown. |
| <a id="property-currentpageindex"></a> `currentPageIndex` | `number` | Index of the current page within `pages`. |
| <a id="property-errormessage"></a> `errorMessage` | `string` \| `null` | Validation error to show for the current item, or `null`. |
| <a id="property-locale"></a> `locale?` | `string` | Locale used for questionnaire text. |
| <a id="property-paged"></a> `paged` | `boolean` | Whether the questionnaire is shown one page at a time. |
| <a id="property-pages"></a> `pages` | [`ExtendedQuestionnaireItem`](#extendedquestionnaireitem)[] | The pages of the questionnaire. |
| <a id="property-questionnaire"></a> `questionnaire` | `Questionnaire` | The FHIR Questionnaire being filled in. |
| <a id="property-renderitem"></a> `renderItem?` | [`QuestionnaireItemRenderer`](#questionnaireitemrenderer) | Custom renderer for questionnaire items. |
| <a id="property-resolvequestionnaireconstraint"></a> `resolveQuestionnaireConstraint?` | [`QuestionnaireConstraintResolver`](#questionnaireconstraintresolver) | Resolves constraints (such as min and max values) for an item. |
| <a id="property-resolvequestionnaireunitoptions"></a> `resolveQuestionnaireUnitOptions?` | [`QuestionnaireUnitOptionsResolver`](#questionnaireunitoptionsresolver) | Resolves the selectable units for a quantity item. |
| <a id="property-retrysubmit"></a> `retrySubmit` | () => `void` | Retries the last failed submission. |
| <a id="property-setcurrentitemindex"></a> `setCurrentItemIndex` | `Dispatch`\<`SetStateAction`\<`number`\>\> | Sets the current item index. |
| <a id="property-setcurrentpageindex"></a> `setCurrentPageIndex` | `Dispatch`\<`SetStateAction`\<`number`\>\> | Sets the current page index. |
| <a id="property-seterrormessage"></a> `setErrorMessage` | `Dispatch`\<`SetStateAction`\<`string` \| `null`\>\> | Sets the validation error message. |
| <a id="property-submissionerror"></a> `submissionError` | `string` \| `null` | Error from the last failed submission, or `null`. |

***

### QuestionnaireFormValues [#questionnaireformvalues]

Form values keyed by item `linkId`.

#### Indexable [#indexable]

```ts
[key: string]: QuestionnaireFormValue
```

#### Properties [#properties-1]

| Property | Type | Description |
| ------ | ------ | ------ |
| <a id="property-currentlinkid"></a> `currentLinkId?` | `string` | `linkId` of the item currently shown. |

***

### QuestionnaireHeaderProps [#questionnaireheaderprops]

Props for `QuestionnaireForm.Header`; also accepts `View` props except `style`.

#### Extends [#extends-1]

- `Omit`\<`ViewProps`, `"style"`\>

#### Properties [#properties-2]

| Property | Type | Description | Overrides |
| ------ | ------ | ------ | ------ |
| <a id="property-children"></a> `children?` | `ReactNode` | Header content, such as the title and subtitle. | `Omit.children` |
| <a id="property-style"></a> `style?` | `StyleProp`\<`ViewStyle`\> | Style for the header container. | - |

## Type Aliases [#type-aliases]

### ExtendedQuestionnaireItem [#extendedquestionnaireitem]

```ts
type ExtendedQuestionnaireItem = QuestionnaireItem & object;
```

A FHIR Questionnaire item with extra fields for translations, helper text and placeholders.

#### Type Declaration [#type-declaration-1]

| Name | Type | Description |
| ------ | ------ | ------ |
| `_helperText?` | `Element` | FHIR extension element for `helperText` (carries translations). |
| `_isSyntheticPage?` | `boolean` | `true` for a page the SDK created to wrap items that are not in a group. |
| `_placeholder?` | `Element` | FHIR extension element for `placeholder` (carries translations). |
| `_prefix?` | `Element` | FHIR extension element for `prefix` (carries translations). |
| `_text?` | `Element` | FHIR extension element for `text` (carries translations). |
| `answerOption?` | `ExtendedQuestionnaireItemAnswerOption`[] | Answer options, with optional preselection. |
| `helperText?` | `string` | Helper text shown below the input. |
| `placeholder?` | `string` | Placeholder text for the input. |

***

### QuestionnaireAnswerPickerOption [#questionnaireanswerpickeroption]

```ts
type QuestionnaireAnswerPickerOption = object;
```

A picker option for a choice item, pairing a label with its answer.

#### Properties [#properties-3]

##### label [#label]

```ts
label: string;
```

Display text for the option.

##### value [#value]

```ts
value: QuestionnaireResponseItemAnswer;
```

Answer stored when the option is chosen.

***

### QuestionnaireConstraintResolver [#questionnaireconstraintresolver]

```ts
type QuestionnaireConstraintResolver = (constraint, item, answers) => unknown;
```

Resolves a calculated constraint extension to a concrete value; return `undefined` or `null` to fall back to the static value.

#### Parameters [#parameters-9]

| Parameter | Type |
| ------ | ------ |
| `constraint` | `Extension` |
| `item` | [`ExtendedQuestionnaireItem`](#extendedquestionnaireitem) |
| `answers` | [`ResponseValues`](#responsevalues) |

#### Returns [#returns-12]

`unknown`

***

### QuestionnaireFormProps [#questionnaireformprops]

```ts
type QuestionnaireFormProps = (ViewProps | ScrollViewProps) & QuestionnaireFormProviderProps & object;
```

Props for `QuestionnaireForm`: `View` or `ScrollView` props plus the provider props.

#### Type Declaration [#type-declaration-2]

| Name | Type | Description |
| ------ | ------ | ------ |
| `nestedScrollEnabled?` | `boolean` | Whether the non-paged form scrolls inside a parent scroll view; defaults to `true`. |

***

### QuestionnaireFormProviderProps [#questionnaireformproviderprops]

```ts
type QuestionnaireFormProviderProps = object & (
  | {
  onError?: (error) => void;
  onSubmit?: undefined;
  onSuccess?: (response) => void;
}
  | {
  onError?: undefined;
  onSubmit?: (values, formikHelpers?) => Promise<void>;
  onSuccess?: undefined;
});
```

Props for the questionnaire form provider; pass either `onSubmit`, or `onSuccess` and `onError`.

#### Type Declaration [#type-declaration-3]

| Name | Type | Description |
| ------ | ------ | ------ |
| `initialValues?` | `Partial`\<[`QuestionnaireFormValues`](#questionnaireformvalues)\> | Initial form values. |
| `locale?` | `string` | Locale used for questionnaire text. |
| `paged?` | `boolean` | Show the questionnaire one page at a time. |
| `questionnaire` | `Questionnaire` | The FHIR Questionnaire to fill in. |
| `renderItem?` | [`QuestionnaireItemRenderer`](#questionnaireitemrenderer) | Custom renderer for questionnaire items. |
| `resolveQuestionnaireConstraint?` | [`QuestionnaireConstraintResolver`](#questionnaireconstraintresolver) | Resolves SDC calculated min/max extensions. Integrations can use their FHIRPath/CQL engine without coupling the questionnaire controls to one. |
| `resolveQuestionnaireUnitOptions?` | [`QuestionnaireUnitOptionsResolver`](#questionnaireunitoptionsresolver) | Resolves SDC `unitValueSet` canonicals to available unit choices. |

***

### QuestionnaireFormValue [#questionnaireformvalue]

```ts
type QuestionnaireFormValue =
  | QuestionnaireResponseItemAnswerValue
  | QuestionnaireResponseItemAnswer
  | null
  | undefined;
```

The answer stored for one questionnaire item.

***

### QuestionnaireItemConstraints [#questionnaireitemconstraints]

```ts
type QuestionnaireItemConstraints = object;
```

Constraints derived from a questionnaire item's extensions.

#### Properties [#properties-4]

##### maxLength? [#maxlength]

```ts
maxLength?: number;
```

Maximum text length.

##### maxQuantity? [#maxquantity]

```ts
maxQuantity?: Quantity;
```

Maximum allowed quantity.

##### maxValue? [#maxvalue]

```ts
maxValue?: number | string;
```

Maximum allowed value.

##### minLength? [#minlength]

```ts
minLength?: number;
```

Minimum text length.

##### minQuantity? [#minquantity]

```ts
minQuantity?: Quantity;
```

Minimum allowed quantity.

##### minValue? [#minvalue]

```ts
minValue?: number | string;
```

Minimum allowed value.

##### step? [#step]

```ts
step?: number;
```

Slider step; only set when positive.

##### unitOpen? [#unitopen]

```ts
unitOpen?: string;
```

Whether units outside the options are allowed; defaults to `"optionsOnly"`.

##### unitOptions [#unitoptions]

```ts
unitOptions: Coding[];
```

Unit choices for quantity items, de-duplicated.

##### unitValueSet? [#unitvalueset]

```ts
unitValueSet?: string;
```

Canonical of the value set providing unit choices.

##### unresolvedDynamicBounds [#unresolveddynamicbounds]

```ts
unresolvedDynamicBounds: ("minValue" | "maxValue" | "minQuantity" | "maxQuantity")[];
```

Bounds backed by a calculated value that the resolver did not resolve.

##### unresolvedUnitValueSet [#unresolvedunitvalueset]

```ts
unresolvedUnitValueSet: boolean;
```

`true` when a unit value set exists but the resolver did not expand it.

***

### QuestionnaireItemRenderer [#questionnaireitemrenderer]

```ts
type QuestionnaireItemRenderer = (props) => ReactNode;
```

Renders a questionnaire item; used to override the built-in controls.

#### Parameters [#parameters-10]

| Parameter | Type |
| ------ | ------ |
| `props` | [`QuestionnaireItemRenderProps`](#questionnaireitemrenderprops) |

#### Returns [#returns-13]

`ReactNode`

***

### QuestionnaireItemRenderProps [#questionnaireitemrenderprops]

```ts
type QuestionnaireItemRenderProps = object;
```

Props passed to a custom questionnaire item renderer.

#### Properties [#properties-5]

##### constraints [#constraints]

```ts
constraints: QuestionnaireItemConstraints;
```

Constraints derived from the item's extensions.

##### item [#item]

```ts
item: ExtendedQuestionnaireItem;
```

The questionnaire item to render.

##### locale? [#locale]

```ts
locale?: string;
```

Locale used for item text.

##### onChange [#onchange]

```ts
onChange: (value) => void;
```

Call with the new answer when the user changes it.

###### Parameters [#parameters-11]

| Parameter | Type |
| ------ | ------ |
| `value` | [`QuestionnaireFormValue`](#questionnaireformvalue) |

###### Returns [#returns-14]

`void`

##### testID? [#testid]

```ts
testID?: string;
```

Test identifier for the rendered item.

##### value? [#value-1]

```ts
value?: QuestionnaireFormValue;
```

Current answer for the item.

***

### QuestionnaireNavigationProviderProps [#questionnairenavigationproviderprops]

```ts
type QuestionnaireNavigationProviderProps = object;
```

Props for the questionnaire navigation provider.

#### Properties [#properties-6]

##### allEnabledItems [#allenableditems]

```ts
allEnabledItems: ExtendedQuestionnaireItem[];
```

Enabled items across all pages.

##### currentItem [#currentitem]

```ts
currentItem: ExtendedQuestionnaireItem | undefined;
```

The item currently shown, or `undefined` when there is none.

##### currentItemIndex [#currentitemindex]

```ts
currentItemIndex: number;
```

Index of the current item.

##### currentPage [#currentpage]

```ts
currentPage: ExtendedQuestionnaireItem;
```

The page currently shown.

##### currentPageIndex [#currentpageindex]

```ts
currentPageIndex: number;
```

Index of the current page.

##### enabledItems [#enableditems]

```ts
enabledItems: ExtendedQuestionnaireItem[];
```

Enabled items of the current page.

##### formik [#formik]

```ts
formik: object;
```

Subset of Formik state the navigation depends on.

###### isSubmitting [#issubmitting]

```ts
isSubmitting: boolean;
```

Whether the form is being submitted.

###### values [#values]

```ts
values: QuestionnaireFormValues;
```

Current form values.

##### pages [#pages]

```ts
pages: ExtendedQuestionnaireItem[];
```

The pages of the questionnaire.

##### renderItem? [#renderitem]

```ts
renderItem?: QuestionnaireItemRenderer;
```

Custom renderer for questionnaire items.

##### resolveQuestionnaireConstraint? [#resolvequestionnaireconstraint]

```ts
resolveQuestionnaireConstraint?: QuestionnaireConstraintResolver;
```

Resolves constraints (such as min and max values) for an item.

##### resolveQuestionnaireUnitOptions? [#resolvequestionnaireunitoptions]

```ts
resolveQuestionnaireUnitOptions?: QuestionnaireUnitOptionsResolver;
```

Resolves the selectable units for a quantity item.

##### setCurrentItemIndex [#setcurrentitemindex]

```ts
setCurrentItemIndex: React.Dispatch<React.SetStateAction<number>>;
```

Sets the current item index.

##### setCurrentPageIndex [#setcurrentpageindex]

```ts
setCurrentPageIndex: React.Dispatch<React.SetStateAction<number>>;
```

Sets the current page index.

##### setErrorMessage [#seterrormessage]

```ts
setErrorMessage: React.Dispatch<React.SetStateAction<string | null>>;
```

Sets the validation error message.

##### values [#values-1]

```ts
values: QuestionnaireFormValues;
```

Current form values.

***

### QuestionnaireNumericPickerOption [#questionnairenumericpickeroption]

```ts
type QuestionnaireNumericPickerOption = object;
```

A picker option for a numeric item, pairing a formatted label with its number.

#### Properties [#properties-7]

##### label [#label-1]

```ts
label: string;
```

Formatted number shown for the option.

##### value [#value-2]

```ts
value: number;
```

Numeric value of the option.

***

### QuestionnaireUnitOptionsResolver [#questionnaireunitoptionsresolver]

```ts
type QuestionnaireUnitOptionsResolver = (valueSet, item, answers) => Coding[] | undefined;
```

Resolves a `unitValueSet` canonical to its unit codings, or `undefined` when it cannot be resolved.

#### Parameters [#parameters-12]

| Parameter | Type |
| ------ | ------ |
| `valueSet` | `string` |
| `item` | [`ExtendedQuestionnaireItem`](#extendedquestionnaireitem) |
| `answers` | [`ResponseValues`](#responsevalues) |

#### Returns [#returns-15]

`Coding`[] \| `undefined`

***

### ResponseValues [#responsevalues]

```ts
type ResponseValues = Record<string, QuestionnaireFormValue>;
```

Form values keyed by item `linkId`.

## Variables [#variables]

### QuestionnaireFormContext [#questionnaireformcontext]

```ts
const QuestionnaireFormContext: Context<
  | QuestionnaireFormContextType
| undefined>;
```

Context holding the questionnaire form state.

***

### QuestionnaireNavigationContext [#questionnairenavigationcontext]

```ts
const QuestionnaireNavigationContext: Context<QuestionnaireNavigationContextType | undefined>;
```

Context holding the questionnaire navigation state and handlers.
