Skip to main content

@aehrc/smart-forms-renderer

Interfaces

InterfaceDescription
InitialiseFormWrapperProps-
ItemToRepopulateItemToRepopulate interface
LaunchContextLaunchContext interface
QuestionnaireResponseStoreTypeQuestionnaireResponseStore properties and methods
QuestionnaireStoreTypeQuestionnaireStore properties and methods
SmartConfigStoreTypeSmartConfigStore properties and methods
SmartFormsRendererPropsSmartFormsRenderer properties
TerminologyServerStoreTypeTerminologyServerStore properties and methods
VariableXFhirQueryVariableXFhirQuery interface
VariablesVariables interface

Type Aliases

Type aliasDescription
TabTab interface
TabsKey-value pair of tabs Record<linkId, Tab>

Variables

VariableDescription
questionnaireResponseStoreQuestionnaireResponse state management store which contains all properties and methods to manage the state of the questionnaireResponse.
questionnaireStoreQuestionnaire state management store which contains all properties and methods to manage the state of the questionnaire.
smartConfigStoreSmart Config state management store. This is only used for answerExpressions.
terminologyServerStoreTerminology server state management store. This is used for resolving valueSets externally.
useQuestionnaireResponseStoreQuestionnaireResponse state management store which contains all properties and methods to manage the state of the questionnaire.
useQuestionnaireStoreQuestionnaire state management store which contains all properties and methods to manage the state of the questionnaire.
useSmartConfigStoreSmart Config state management store. This is only used for answerExpressions.
useTerminologyServerStoreTerminology server state management store. This is used for resolving valueSets externally.

Functions

FunctionDescription
BaseRendererMain component of the form-rendering engine.
GridGroupMain component to render a Group Grid (grid) Questionnaire item.
GroupTableMain component to render a Group Table (gtable) Questionnaire item.
InitialiseFormWrapperForStorybookThis is a one-to-one replacement for the SmartFormsRenderer for demo purposes.
RendererThemeProviderDefault theme used by the renderer using Material UI. You can customise your own theme by defining a new ThemeProvider.
RepeatGroupMain component to render a repeating, group Questionnaire item.
RepeatItemMain component to render a repeating, non-group Questionnaire item.
SingleItemMain component to render a repeating, non-group Questionnaire item.
SmartFormsRendererA self-initialising wrapper around the BaseRenderer rendering engine.
buildFormBuild the form with an initial Questionnaire and an optional filled QuestionnaireResponse.
destroyFormDestroy the form to clean up the questionnaire and questionnaireResponse stores.
extractObservationBasedExtract an array of Observations from a QuestionnaireResponse and its source Questionnaire.
generateItemsToRepopulateCompare latest data from the server with the current QuestionnaireResponse and decide items to re-populate
getResponseGet the filled QuestionnaireResponse at its current state.
initialiseQuestionnaireResponseInitialise a questionnaireResponse from a given questionnaire
isRepeatItemAndNotCheckboxCheck if qItem is a repeat item AND if it isn't a checkbox item
isSpecificItemControlCheck if the extension has an itemControl code equal to the given itemControlCode
parseFhirDateToDisplayDateParse a FHIR date string to a date to be consumed and displayed by the DateItem component.
removeEmptyAnswersFromResponseRemove all empty/hidden answers from the filled QuestionnaireResponse.
removeInternalIdsFromResponseRemove all instances of item.answer.id from the filled QuestionnaireResponse.
repopulateResponseRe-populate checked items in the re-population dialog into the current QuestionnaireResponse
useBuildFormReact hook wrapping around the buildForm() function to build a form from a questionnaire and an optional QuestionnaireResponse.
useHiddenReact hook to determine if a QuestionnaireItem is hidden via item.hidden, enableWhens, enableWhenExpressions.
useRendererQueryClientDefault QueryClient used by the renderer.