Skip to main content

Variable: useQuestionnaireResponseStore

const useQuestionnaireResponseStore: StoreApi <QuestionnaireResponseStoreType> & object

QuestionnaireResponse state management store which contains all properties and methods to manage the state of the questionnaire. This is the React version of the store which can be used as React hooks in React functional components.

See

  • QuestionnaireResponseStoreType for available properties and methods.
  • questionnaireResponseStore for the vanilla store.

Type declaration

use

use: object

use.buildSourceResponse()

buildSourceResponse: () => (response) => void

Returns

Function

Parameters
ParameterType
responseQuestionnaireResponse
Returns

void

use.destroySourceResponse()

destroySourceResponse: () => () => void

Returns

Function

Returns

void

use.formChangesHistory()

formChangesHistory: () => (null | Diff<QuestionnaireResponse, QuestionnaireResponse>[])[]

Returns

(null | Diff<QuestionnaireResponse, QuestionnaireResponse>[])[]

use.invalidItems()

invalidItems: () => Record<string, OperationOutcome>

Returns

Record<string, OperationOutcome>

use.key()

key: () => string

Returns

string

use.responseIsValid()

responseIsValid: () => boolean

Returns

boolean

use.setUpdatableResponseAsEmpty()

setUpdatableResponseAsEmpty: () => (clearedResponse) => void

Returns

Function

Parameters
ParameterType
clearedResponseQuestionnaireResponse
Returns

void

use.setUpdatableResponseAsPopulated()

setUpdatableResponseAsPopulated: () => (populatedResponse) => void

Returns

Function

Parameters
ParameterType
populatedResponseQuestionnaireResponse
Returns

void

use.setUpdatableResponseAsSaved()

setUpdatableResponseAsSaved: () => (savedResponse) => void

Returns

Function

Parameters
ParameterType
savedResponseQuestionnaireResponse
Returns

void

use.sourceResponse()

sourceResponse: () => QuestionnaireResponse

Returns

QuestionnaireResponse

use.updatableResponse()

updatableResponse: () => QuestionnaireResponse

Returns

QuestionnaireResponse

use.updatableResponseItems()

updatableResponseItems: () => Record<string, QuestionnaireResponseItem[]>

Returns

Record<string, QuestionnaireResponseItem[]>

use.updateResponse()

updateResponse: () => (updatedResponse) => void

Returns

Function

Parameters
ParameterType
updatedResponseQuestionnaireResponse
Returns

void

use.validateQuestionnaire()

validateQuestionnaire: () => (questionnaire, updatedResponse) => void

Returns

Function

Parameters
ParameterType
questionnaireQuestionnaire
updatedResponseQuestionnaireResponse
Returns

void