Skip to main content

Variable: useQuestionnaireStore

const useQuestionnaireStore: StoreApi <QuestionnaireStoreType> & object

Questionnaire 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

  • QuestionnaireStoreType for available properties and methods.
  • questionnaireStore for the vanilla store.

Type declaration

use

use: object

use.addCodingToCache()

addCodingToCache: () => (valueSetUrl, codings) => void

Returns

Function

Parameters
ParameterType
valueSetUrlstring
codingsCoding[]
Returns

void

use.answerExpressions()

answerExpressions: () => Record<string, AnswerExpression>

Returns

Record<string, AnswerExpression>

use.buildSourceQuestionnaire()

buildSourceQuestionnaire: () => (questionnaire, questionnaireResponse?, additionalVariables?, terminologyServerUrl?, readOnly?) => Promise<void>

Returns

Function

Parameters
ParameterType
questionnaireQuestionnaire
questionnaireResponse?QuestionnaireResponse
additionalVariables?Record<string, object>
terminologyServerUrl?string
readOnly?boolean
Returns

Promise<void>

use.cachedValueSetCodings()

cachedValueSetCodings: () => Record<string, Coding[]>

Returns

Record<string, Coding[]>

use.calculatedExpressions()

calculatedExpressions: () => Record<string, CalculatedExpression[]>

Returns

Record<string, CalculatedExpression[]>

use.currentPageIndex()

currentPageIndex: () => number

Returns

number

use.currentTabIndex()

currentTabIndex: () => number

Returns

number

use.destroySourceQuestionnaire()

destroySourceQuestionnaire: () => () => void

Returns

Function

Returns

void

use.enableWhenExpressions()

enableWhenExpressions: () => EnableWhenExpressions

Returns

EnableWhenExpressions

use.enableWhenIsActivated()

enableWhenIsActivated: () => boolean

Returns

boolean

use.enableWhenItems()

enableWhenItems: () => EnableWhenItems

Returns

EnableWhenItems

use.enableWhenLinkedQuestions()

enableWhenLinkedQuestions: () => Record<string, string[]>

Returns

Record<string, string[]>

use.fhirPathContext()

fhirPathContext: () => Record<string, any>

Returns

Record<string, any>

use.focusedLinkId()

focusedLinkId: () => string

Returns

string

use.initialExpressions()

initialExpressions: () => Record<string, InitialExpression>

Returns

Record<string, InitialExpression>

use.itemPreferredTerminologyServers()

itemPreferredTerminologyServers: () => Record<string, string>

Returns

Record<string, string>

use.itemTypes()

itemTypes: () => Record<string, string>

Returns

Record<string, string>

use.launchContexts()

launchContexts: () => Record<string, LaunchContext>

Returns

Record<string, LaunchContext>

use.markPageAsComplete()

markPageAsComplete: () => (pageLinkId) => void

Returns

Function

Parameters
ParameterType
pageLinkIdstring
Returns

void

use.markTabAsComplete()

markTabAsComplete: () => (tabLinkId) => void

Returns

Function

Parameters
ParameterType
tabLinkIdstring
Returns

void

use.mutateRepeatEnableWhenItems()

mutateRepeatEnableWhenItems: () => (parentRepeatGroupLinkId, parentRepeatGroupIndex, actionType) => void

Returns

Function

Parameters
ParameterType
parentRepeatGroupLinkIdstring
parentRepeatGroupIndexnumber
actionType"add" | "remove"
Returns

void

use.onFocusLinkId()

onFocusLinkId: () => (linkId) => void

Returns

Function

Parameters
ParameterType
linkIdstring
Returns

void

use.pages()

pages: () => Pages

Returns

Pages

use.populatedContext()

populatedContext: () => Record<string, any>

Returns

Record<string, any>

use.processedValueSetCodings()

processedValueSetCodings: () => Record<string, Coding[]>

Returns

Record<string, Coding[]>

use.processedValueSetUrls()

processedValueSetUrls: () => Record<string, string>

Returns

Record<string, string>

use.readOnly()

readOnly: () => boolean

Returns

boolean

use.setFormAsReadOnly()

setFormAsReadOnly: () => (readOnly) => void

Returns

Function

Parameters
ParameterType
readOnlyboolean
Returns

void

use.setPopulatedContext()

setPopulatedContext: () => (newPopulatedContext) => void

Returns

Function

Parameters
ParameterType
newPopulatedContextRecord<string, any>
Returns

void

use.sourceQuestionnaire()

sourceQuestionnaire: () => Questionnaire

Returns

Questionnaire

use.switchPage()

switchPage: () => (newPageIndex) => void

Returns

Function

Parameters
ParameterType
newPageIndexnumber
Returns

void

use.switchTab()

switchTab: () => (newTabIndex) => void

Returns

Function

Parameters
ParameterType
newTabIndexnumber
Returns

void

use.tabs()

tabs: () => Tabs

Returns

Tabs

use.toggleEnableWhenActivation()

toggleEnableWhenActivation: () => (isActivated) => void

Returns

Function

Parameters
ParameterType
isActivatedboolean
Returns

void

use.updateEnableWhenItem()

updateEnableWhenItem: () => (linkId, newAnswer, parentRepeatGroupIndex) => void

Returns

Function

Parameters
ParameterType
linkIdstring
newAnswerundefined | QuestionnaireResponseItemAnswer[]
parentRepeatGroupIndexnull | number
Returns

void

use.updateExpressions()

updateExpressions: () => (updatedResponse) => void

Returns

Function

Parameters
ParameterType
updatedResponseQuestionnaireResponse
Returns

void

use.updatePopulatedProperties()

updatePopulatedProperties: () => (populatedResponse, populatedContext?, persistTabIndex?) => QuestionnaireResponse

Returns

Function

Parameters
ParameterType
populatedResponseQuestionnaireResponse
populatedContext?Record<string, any>
persistTabIndex?boolean
Returns

QuestionnaireResponse

use.variables()

variables: () => Variables

Returns

Variables