@aehrc/smart-forms-renderer 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/FormRenderer/SmartFormsRenderer.js +4 -2
- package/lib/components/FormRenderer/SmartFormsRenderer.js.map +1 -1
- package/lib/theme/Theme.d.ts +38 -0
- package/lib/theme/Theme.js +39 -0
- package/lib/theme/Theme.js.map +1 -0
- package/lib/theme/globalStyles.d.ts +2 -0
- package/lib/theme/globalStyles.js +64 -0
- package/lib/theme/globalStyles.js.map +1 -0
- package/lib/theme/overrides/Accordion.d.ts +14 -0
- package/{src/components/FormComponents/QItemChoice/QItemChoiceRadioSingle.js → lib/theme/overrides/Accordion.js} +15 -7
- package/lib/theme/overrides/Accordion.js.map +1 -0
- package/lib/theme/overrides/Autocomplete.d.ts +10 -0
- package/{src/components/FormComponents/DisplayItem/DisplayInstructions.styles.js → lib/theme/overrides/Autocomplete.js} +12 -7
- package/lib/theme/overrides/Autocomplete.js.map +1 -0
- package/lib/theme/overrides/Backdrop.d.ts +13 -0
- package/{src/components/FormComponents/ItemParts/FadingCheckIcon.js → lib/theme/overrides/Backdrop.js} +15 -9
- package/lib/theme/overrides/Backdrop.js.map +1 -0
- package/lib/theme/overrides/Button.d.ts +33 -0
- package/lib/theme/overrides/Button.js +52 -0
- package/lib/theme/overrides/Button.js.map +1 -0
- package/lib/theme/overrides/Card.d.ts +35 -0
- package/lib/theme/overrides/Card.js +49 -0
- package/lib/theme/overrides/Card.js.map +1 -0
- package/lib/theme/overrides/Input.d.ts +64 -0
- package/lib/theme/overrides/Input.js +81 -0
- package/lib/theme/overrides/Input.js.map +1 -0
- package/lib/theme/overrides/Overrides.d.ts +3 -0
- package/{src/components/BackToTopButton/BackToTopButton.js → lib/theme/overrides/Overrides.js} +14 -15
- package/lib/theme/overrides/Overrides.js.map +1 -0
- package/lib/theme/overrides/Paper.d.ts +12 -0
- package/{src/hooks/useQueryClient.js → lib/theme/overrides/Paper.js} +12 -10
- package/lib/theme/overrides/Paper.js.map +1 -0
- package/lib/theme/overrides/SpeedDial.d.ts +16 -0
- package/{src/hooks/useInitialiseRepeatAnswers.js → lib/theme/overrides/SpeedDial.js} +16 -18
- package/lib/theme/overrides/SpeedDial.js.map +1 -0
- package/lib/theme/overrides/Table.d.ts +11 -0
- package/{src/components/FormRenderer/index.js → lib/theme/overrides/Table.js} +13 -2
- package/lib/theme/overrides/Table.js.map +1 -0
- package/lib/theme/overrides/Typography.d.ts +13 -0
- package/lib/theme/overrides/Typography.js +31 -0
- package/lib/theme/overrides/Typography.js.map +1 -0
- package/lib/theme/palette.d.ts +28 -0
- package/lib/theme/palette.js +67 -0
- package/lib/theme/palette.js.map +1 -0
- package/lib/theme/shadows.d.ts +2 -0
- package/lib/theme/shadows.js +52 -0
- package/lib/theme/shadows.js.map +1 -0
- package/lib/theme/typography.d.ts +139 -0
- package/lib/theme/typography.js +80 -0
- package/lib/theme/typography.js.map +1 -0
- package/package.json +1 -1
- package/src/components/FormRenderer/SmartFormsRenderer.tsx +6 -3
- package/src/theme/Theme.tsx +107 -0
- package/src/theme/globalStyles.tsx +68 -0
- package/src/{components/FormComponents/Item.styles.js → theme/overrides/Accordion.ts} +18 -11
- package/src/{interfaces/answerExpression.interface.js → theme/overrides/Autocomplete.ts} +14 -2
- package/src/theme/overrides/Backdrop.ts +34 -0
- package/src/theme/overrides/Button.ts +54 -0
- package/src/theme/overrides/Card.ts +51 -0
- package/src/theme/overrides/Input.ts +83 -0
- package/src/theme/overrides/Overrides.ts +45 -0
- package/src/{interfaces/enableWhen.interface.js → theme/overrides/Paper.ts} +15 -2
- package/src/{hooks/useInitialiseGroupTable.js → theme/overrides/SpeedDial.ts} +17 -17
- package/src/{hooks/useBackToTop.js → theme/overrides/Table.ts} +14 -9
- package/src/{components/FormComponents/Typography.styles.js → theme/overrides/Typography.ts} +17 -7
- package/src/theme/palette.ts +100 -0
- package/src/theme/shadows.ts +54 -0
- package/src/theme/typography.ts +114 -0
- package/src/api/populate.js +0 -63
- package/src/api/populate.js.map +0 -1
- package/src/components/Alert.styles.js +0 -40
- package/src/components/Alert.styles.js.map +0 -1
- package/src/components/BackToTopButton/BackToTopButton.js.map +0 -1
- package/src/components/Box.styles.js +0 -30
- package/src/components/Box.styles.js.map +0 -1
- package/src/components/FormComponents/BooleanItem/BooleanField.js +0 -24
- package/src/components/FormComponents/BooleanItem/BooleanField.js.map +0 -1
- package/src/components/FormComponents/BooleanItem/BooleanItem.js +0 -49
- package/src/components/FormComponents/BooleanItem/BooleanItem.js.map +0 -1
- package/src/components/FormComponents/DateItem/DateField.js +0 -31
- package/src/components/FormComponents/DateItem/DateField.js.map +0 -1
- package/src/components/FormComponents/DateItem/DateItem.js +0 -52
- package/src/components/FormComponents/DateItem/DateItem.js.map +0 -1
- package/src/components/FormComponents/DateTimeItem/DateTimeField.js +0 -33
- package/src/components/FormComponents/DateTimeItem/DateTimeField.js.map +0 -1
- package/src/components/FormComponents/DateTimeItem/DateTimeItem.js +0 -52
- package/src/components/FormComponents/DateTimeItem/DateTimeItem.js.map +0 -1
- package/src/components/FormComponents/DecimalItem/DecimalField.js +0 -30
- package/src/components/FormComponents/DecimalItem/DecimalField.js.map +0 -1
- package/src/components/FormComponents/DecimalItem/DecimalItem.js +0 -80
- package/src/components/FormComponents/DecimalItem/DecimalItem.js.map +0 -1
- package/src/components/FormComponents/DisplayItem/DisplayInstructions.js +0 -26
- package/src/components/FormComponents/DisplayItem/DisplayInstructions.js.map +0 -1
- package/src/components/FormComponents/DisplayItem/DisplayInstructions.styles.js.map +0 -1
- package/src/components/FormComponents/DisplayItem/DisplayItem.js +0 -31
- package/src/components/FormComponents/DisplayItem/DisplayItem.js.map +0 -1
- package/src/components/FormComponents/GridGroup/GridGroup.js +0 -58
- package/src/components/FormComponents/GridGroup/GridGroup.js.map +0 -1
- package/src/components/FormComponents/GridGroup/GridRow.js +0 -55
- package/src/components/FormComponents/GridGroup/GridRow.js.map +0 -1
- package/src/components/FormComponents/GridGroup/GridTable.js +0 -42
- package/src/components/FormComponents/GridGroup/GridTable.js.map +0 -1
- package/src/components/FormComponents/GroupItem/GroupHeading.js +0 -39
- package/src/components/FormComponents/GroupItem/GroupHeading.js.map +0 -1
- package/src/components/FormComponents/GroupItem/GroupItem.js +0 -62
- package/src/components/FormComponents/GroupItem/GroupItem.js.map +0 -1
- package/src/components/FormComponents/GroupItem/GroupItem.styles.js +0 -27
- package/src/components/FormComponents/GroupItem/GroupItem.styles.js.map +0 -1
- package/src/components/FormComponents/GroupItem/GroupItemSwitcher.js +0 -73
- package/src/components/FormComponents/GroupItem/GroupItemSwitcher.js.map +0 -1
- package/src/components/FormComponents/GroupItem/NextTabButton.js +0 -25
- package/src/components/FormComponents/GroupItem/NextTabButton.js.map +0 -1
- package/src/components/FormComponents/GroupItem/NextTabButtonWrapper.js +0 -55
- package/src/components/FormComponents/GroupItem/NextTabButtonWrapper.js.map +0 -1
- package/src/components/FormComponents/IntegerItem/IntegerField.js +0 -30
- package/src/components/FormComponents/IntegerItem/IntegerField.js.map +0 -1
- package/src/components/FormComponents/IntegerItem/IntegerItem.js +0 -73
- package/src/components/FormComponents/IntegerItem/IntegerItem.js.map +0 -1
- package/src/components/FormComponents/Item.styles.js.map +0 -1
- package/src/components/FormComponents/ItemParts/ContextDisplayItem.js +0 -29
- package/src/components/FormComponents/ItemParts/ContextDisplayItem.js.map +0 -1
- package/src/components/FormComponents/ItemParts/FadingCheckIcon.js.map +0 -1
- package/src/components/FormComponents/ItemParts/ItemFieldGrid.js +0 -31
- package/src/components/FormComponents/ItemParts/ItemFieldGrid.js.map +0 -1
- package/src/components/FormComponents/ItemParts/ItemLabelText.js +0 -45
- package/src/components/FormComponents/ItemParts/ItemLabelText.js.map +0 -1
- package/src/components/FormComponents/ItemParts/ItemLabelWrapper.js +0 -32
- package/src/components/FormComponents/ItemParts/ItemLabelWrapper.js.map +0 -1
- package/src/components/FormComponents/ItemParts/QItemCheckboxSingle.js +0 -24
- package/src/components/FormComponents/ItemParts/QItemCheckboxSingle.js.map +0 -1
- package/src/components/FormComponents/ItemParts/QItemCheckboxSingleWithOpenLabel.js +0 -33
- package/src/components/FormComponents/ItemParts/QItemCheckboxSingleWithOpenLabel.js.map +0 -1
- package/src/components/FormComponents/ItemParts/QItemRadioButtonWithOpenLabel.js +0 -31
- package/src/components/FormComponents/ItemParts/QItemRadioButtonWithOpenLabel.js.map +0 -1
- package/src/components/FormComponents/Lists.styles.js +0 -38
- package/src/components/FormComponents/Lists.styles.js.map +0 -1
- package/src/components/FormComponents/QItemChoice/QItemChoice.js +0 -61
- package/src/components/FormComponents/QItemChoice/QItemChoice.js.map +0 -1
- package/src/components/FormComponents/QItemChoice/QItemChoiceAutocomplete.js +0 -85
- package/src/components/FormComponents/QItemChoice/QItemChoiceAutocomplete.js.map +0 -1
- package/src/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerOption.js +0 -70
- package/src/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerOption.js.map +0 -1
- package/src/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerValueSet.js +0 -66
- package/src/components/FormComponents/QItemChoice/QItemChoiceCheckboxAnswerValueSet.js.map +0 -1
- package/src/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerOption.js +0 -70
- package/src/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerOption.js.map +0 -1
- package/src/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerValueSet.js +0 -70
- package/src/components/FormComponents/QItemChoice/QItemChoiceRadioAnswerValueSet.js.map +0 -1
- package/src/components/FormComponents/QItemChoice/QItemChoiceRadioSingle.js.map +0 -1
- package/src/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerOption.js +0 -70
- package/src/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerOption.js.map +0 -1
- package/src/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerValueSet.js +0 -80
- package/src/components/FormComponents/QItemChoice/QItemChoiceSelectAnswerValueSet.js.map +0 -1
- package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoice.js +0 -49
- package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoice.js.map +0 -1
- package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceAutocomplete.js +0 -104
- package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceAutocomplete.js.map +0 -1
- package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceCheckboxAnswerOption.js +0 -105
- package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceCheckboxAnswerOption.js.map +0 -1
- package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceRadioAnswerOption.js +0 -116
- package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceRadioAnswerOption.js.map +0 -1
- package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerOption.js +0 -74
- package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerOption.js.map +0 -1
- package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerValueSet.js +0 -66
- package/src/components/FormComponents/QItemOpenChoice/QItemOpenChoiceSelectAnswerValueSet.js.map +0 -1
- package/src/components/FormComponents/RepeatGroup/AddItemButton.js +0 -27
- package/src/components/FormComponents/RepeatGroup/AddItemButton.js.map +0 -1
- package/src/components/FormComponents/RepeatGroup/DeleteItemButton.js +0 -30
- package/src/components/FormComponents/RepeatGroup/DeleteItemButton.js.map +0 -1
- package/src/components/FormComponents/RepeatGroup/RepeatGroup.js +0 -81
- package/src/components/FormComponents/RepeatGroup/RepeatGroup.js.map +0 -1
- package/src/components/FormComponents/RepeatGroup/RepeatGroupItem.js +0 -30
- package/src/components/FormComponents/RepeatGroup/RepeatGroupItem.js.map +0 -1
- package/src/components/FormComponents/RepeatItem/AddItemButton.js +0 -27
- package/src/components/FormComponents/RepeatItem/AddItemButton.js.map +0 -1
- package/src/components/FormComponents/RepeatItem/DeleteItemButton.js +0 -30
- package/src/components/FormComponents/RepeatItem/DeleteItemButton.js.map +0 -1
- package/src/components/FormComponents/RepeatItem/RepeatField.js +0 -31
- package/src/components/FormComponents/RepeatItem/RepeatField.js.map +0 -1
- package/src/components/FormComponents/RepeatItem/RepeatItem.js +0 -69
- package/src/components/FormComponents/RepeatItem/RepeatItem.js.map +0 -1
- package/src/components/FormComponents/RepeatItem/RepeatItem.styles.js +0 -29
- package/src/components/FormComponents/RepeatItem/RepeatItem.styles.js.map +0 -1
- package/src/components/FormComponents/SingleItem/SingleItem.js +0 -32
- package/src/components/FormComponents/SingleItem/SingleItem.js.map +0 -1
- package/src/components/FormComponents/SingleItem/SingleItemSwitcher.js +0 -63
- package/src/components/FormComponents/SingleItem/SingleItemSwitcher.js.map +0 -1
- package/src/components/FormComponents/StringItem/StringField.js +0 -30
- package/src/components/FormComponents/StringItem/StringField.js.map +0 -1
- package/src/components/FormComponents/StringItem/StringItem.js +0 -71
- package/src/components/FormComponents/StringItem/StringItem.js.map +0 -1
- package/src/components/FormComponents/Tables/DeleteRowButton.js +0 -31
- package/src/components/FormComponents/Tables/DeleteRowButton.js.map +0 -1
- package/src/components/FormComponents/Tables/QItemGroupTable.js +0 -99
- package/src/components/FormComponents/Tables/QItemGroupTable.js.map +0 -1
- package/src/components/FormComponents/Tables/QItemGroupTableRow.js +0 -46
- package/src/components/FormComponents/Tables/QItemGroupTableRow.js.map +0 -1
- package/src/components/FormComponents/Tables/Table.styles.js +0 -46
- package/src/components/FormComponents/Tables/Table.styles.js.map +0 -1
- package/src/components/FormComponents/TextItem/TextField.js +0 -29
- package/src/components/FormComponents/TextItem/TextField.js.map +0 -1
- package/src/components/FormComponents/TextItem/TextItem.js +0 -71
- package/src/components/FormComponents/TextItem/TextItem.js.map +0 -1
- package/src/components/FormComponents/Textfield.styles.js +0 -27
- package/src/components/FormComponents/Textfield.styles.js.map +0 -1
- package/src/components/FormComponents/TimeItem/TimeField.js +0 -30
- package/src/components/FormComponents/TimeItem/TimeField.js.map +0 -1
- package/src/components/FormComponents/TimeItem/TimeItem.js +0 -52
- package/src/components/FormComponents/TimeItem/TimeItem.js.map +0 -1
- package/src/components/FormComponents/Typography.styles.js.map +0 -1
- package/src/components/FormComponents/UrlItem/UrlField.js +0 -25
- package/src/components/FormComponents/UrlItem/UrlField.js.map +0 -1
- package/src/components/FormComponents/UrlItem/UrlItem.js +0 -61
- package/src/components/FormComponents/UrlItem/UrlItem.js.map +0 -1
- package/src/components/FormRenderer/FormBodyCollapsible.js +0 -57
- package/src/components/FormRenderer/FormBodyCollapsible.js.map +0 -1
- package/src/components/FormRenderer/FormBodySingleCollapsible.js +0 -39
- package/src/components/FormRenderer/FormBodySingleCollapsible.js.map +0 -1
- package/src/components/FormRenderer/FormBodySingleCollapsibleWrapper.js +0 -31
- package/src/components/FormRenderer/FormBodySingleCollapsibleWrapper.js.map +0 -1
- package/src/components/FormRenderer/FormBodyTabbed.js +0 -60
- package/src/components/FormRenderer/FormBodyTabbed.js.map +0 -1
- package/src/components/FormRenderer/FormTitle.js +0 -30
- package/src/components/FormRenderer/FormTitle.js.map +0 -1
- package/src/components/FormRenderer/FormTopLevelItem.js +0 -45
- package/src/components/FormRenderer/FormTopLevelItem.js.map +0 -1
- package/src/components/FormRenderer/SmartFormsRenderer.js +0 -37
- package/src/components/FormRenderer/SmartFormsRenderer.js.map +0 -1
- package/src/components/FormRenderer/index.js.map +0 -1
- package/src/components/Iconify/Iconify.js +0 -26
- package/src/components/Iconify/Iconify.js.map +0 -1
- package/src/components/Lists.styles.js +0 -38
- package/src/components/Lists.styles.js.map +0 -1
- package/src/components/Tabs/CompleteTabButton.js +0 -29
- package/src/components/Tabs/CompleteTabButton.js.map +0 -1
- package/src/components/Tabs/FormBodySingleTab.js +0 -39
- package/src/components/Tabs/FormBodySingleTab.js.map +0 -1
- package/src/components/Tabs/FormBodyTabList.js +0 -52
- package/src/components/Tabs/FormBodyTabList.js.map +0 -1
- package/src/components/index.js +0 -18
- package/src/components/index.js.map +0 -1
- package/src/hooks/useBackToTop.js.map +0 -1
- package/src/hooks/useDebounce.js +0 -38
- package/src/hooks/useDebounce.js.map +0 -1
- package/src/hooks/useDecimalCalculatedExpression.js +0 -50
- package/src/hooks/useDecimalCalculatedExpression.js.map +0 -1
- package/src/hooks/useHidden.js +0 -35
- package/src/hooks/useHidden.js.map +0 -1
- package/src/hooks/useInitialiseGroupTable.js.map +0 -1
- package/src/hooks/useInitialiseRenderer.js +0 -49
- package/src/hooks/useInitialiseRenderer.js.map +0 -1
- package/src/hooks/useInitialiseRepeatAnswers.js.map +0 -1
- package/src/hooks/useInitialiseRepeatGroups.js +0 -36
- package/src/hooks/useInitialiseRepeatGroups.js.map +0 -1
- package/src/hooks/useIntegerCalculatedExpression.js +0 -44
- package/src/hooks/useIntegerCalculatedExpression.js.map +0 -1
- package/src/hooks/useQueryClient.js.map +0 -1
- package/src/hooks/useRenderingExtensions.js +0 -30
- package/src/hooks/useRenderingExtensions.js.map +0 -1
- package/src/hooks/useResponsive.js +0 -37
- package/src/hooks/useResponsive.js.map +0 -1
- package/src/hooks/useStringCalculatedExpression.js +0 -44
- package/src/hooks/useStringCalculatedExpression.js.map +0 -1
- package/src/hooks/useTerminologyServerQuery.js +0 -73
- package/src/hooks/useTerminologyServerQuery.js.map +0 -1
- package/src/hooks/useValidationError.js +0 -38
- package/src/hooks/useValidationError.js.map +0 -1
- package/src/hooks/useValueSetCodings.js +0 -125
- package/src/hooks/useValueSetCodings.js.map +0 -1
- package/src/index.js +0 -2
- package/src/index.js.map +0 -1
- package/src/interfaces/answerExpression.interface.js.map +0 -1
- package/src/interfaces/calculatedExpression.interface.js +0 -2
- package/src/interfaces/calculatedExpression.interface.js.map +0 -1
- package/src/interfaces/choice.enum.js +0 -41
- package/src/interfaces/choice.enum.js.map +0 -1
- package/src/interfaces/enableWhen.interface.js.map +0 -1
- package/src/interfaces/groupTable.interface.js +0 -18
- package/src/interfaces/groupTable.interface.js.map +0 -1
- package/src/interfaces/populate.interface.js +0 -18
- package/src/interfaces/populate.interface.js.map +0 -1
- package/src/interfaces/questionnaireStore.interface.js +0 -18
- package/src/interfaces/questionnaireStore.interface.js.map +0 -1
- package/src/interfaces/regex.interface.js +0 -18
- package/src/interfaces/regex.interface.js.map +0 -1
- package/src/interfaces/renderProps.interface.js +0 -18
- package/src/interfaces/renderProps.interface.js.map +0 -1
- package/src/interfaces/repeatGroup.interface.js +0 -18
- package/src/interfaces/repeatGroup.interface.js.map +0 -1
- package/src/interfaces/repeatItem.interface.js +0 -2
- package/src/interfaces/repeatItem.interface.js.map +0 -1
- package/src/interfaces/tab.interface.js +0 -2
- package/src/interfaces/tab.interface.js.map +0 -1
- package/src/interfaces/valueSet.interface.js +0 -18
- package/src/interfaces/valueSet.interface.js.map +0 -1
- package/src/interfaces/variables.interface.js +0 -18
- package/src/interfaces/variables.interface.js.map +0 -1
- package/src/setup-jest.js +0 -2
- package/src/setup-jest.js.map +0 -1
- package/src/stores/useConfigStore.js +0 -17
- package/src/stores/useConfigStore.js.map +0 -1
- package/src/stores/useQuestionnaireResponseStore.js +0 -39
- package/src/stores/useQuestionnaireResponseStore.js.map +0 -1
- package/src/stores/useQuestionnaireStore.js +0 -151
- package/src/stores/useQuestionnaireStore.js.map +0 -1
- package/src/stories/SmartFormsRenderer.stories.js +0 -90
- package/src/stories/SmartFormsRenderer.stories.js.map +0 -1
- package/src/utils/calculatedExpression.js +0 -180
- package/src/utils/calculatedExpression.js.map +0 -1
- package/src/utils/choice.js +0 -160
- package/src/utils/choice.js.map +0 -1
- package/src/utils/debounce.js +0 -19
- package/src/utils/debounce.js.map +0 -1
- package/src/utils/emptyResource.js +0 -25
- package/src/utils/emptyResource.js.map +0 -1
- package/src/utils/enableWhen.js +0 -228
- package/src/utils/enableWhen.js.map +0 -1
- package/src/utils/enableWhenExpression.js +0 -76
- package/src/utils/enableWhenExpression.js.map +0 -1
- package/src/utils/fhirpath.js +0 -98
- package/src/utils/fhirpath.js.map +0 -1
- package/src/utils/initialiseForm.js +0 -45
- package/src/utils/initialiseForm.js.map +0 -1
- package/src/utils/itemControl.js +0 -299
- package/src/utils/itemControl.js.map +0 -1
- package/src/utils/mapItem.js +0 -80
- package/src/utils/mapItem.js.map +0 -1
- package/src/utils/openChoice.js +0 -150
- package/src/utils/openChoice.js.map +0 -1
- package/src/utils/parseInputs.js +0 -49
- package/src/utils/parseInputs.js.map +0 -1
- package/src/utils/populate.js +0 -78
- package/src/utils/populate.js.map +0 -1
- package/src/utils/populateCallback.js +0 -40
- package/src/utils/populateCallback.js.map +0 -1
- package/src/utils/populateContexts.js +0 -76
- package/src/utils/populateContexts.js.map +0 -1
- package/src/utils/populateInputParams.js +0 -193
- package/src/utils/populateInputParams.js.map +0 -1
- package/src/utils/qItem.js +0 -73
- package/src/utils/qItem.js.map +0 -1
- package/src/utils/qrItem.js +0 -221
- package/src/utils/qrItem.js.map +0 -1
- package/src/utils/questionnaireStoreUtils/addAdditionalVariables.js +0 -47
- package/src/utils/questionnaireStoreUtils/addAdditionalVariables.js.map +0 -1
- package/src/utils/questionnaireStoreUtils/createQuestionaireModel.js +0 -79
- package/src/utils/questionnaireStoreUtils/createQuestionaireModel.js.map +0 -1
- package/src/utils/questionnaireStoreUtils/extractContainedValueSets.js +0 -59
- package/src/utils/questionnaireStoreUtils/extractContainedValueSets.js.map +0 -1
- package/src/utils/questionnaireStoreUtils/extractLaunchContext.js +0 -18
- package/src/utils/questionnaireStoreUtils/extractLaunchContext.js.map +0 -1
- package/src/utils/questionnaireStoreUtils/extractOtherExtensions.js +0 -174
- package/src/utils/questionnaireStoreUtils/extractOtherExtensions.js.map +0 -1
- package/src/utils/questionnaireStoreUtils/extractTabs.js +0 -31
- package/src/utils/questionnaireStoreUtils/extractTabs.js.map +0 -1
- package/src/utils/questionnaireStoreUtils/extractVariables.js +0 -63
- package/src/utils/questionnaireStoreUtils/extractVariables.js.map +0 -1
- package/src/utils/questionnaireStoreUtils/resolveValueSets.js +0 -58
- package/src/utils/questionnaireStoreUtils/resolveValueSets.js.map +0 -1
- package/src/utils/tabs.js +0 -190
- package/src/utils/tabs.js.map +0 -1
- package/src/utils/valueSet.js +0 -126
- package/src/utils/valueSet.js.map +0 -1
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 Commonwealth Scientific and Industrial Research
|
|
3
|
-
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
import { useEffect, useMemo, useState } from 'react';
|
|
18
|
-
import { getResourceFromLaunchContext, getTerminologyServerUrl, getValueSetCodings, getValueSetPromise } from '../utils/valueSet';
|
|
19
|
-
import { getAnswerExpression } from '../utils/itemControl';
|
|
20
|
-
import fhirpath from 'fhirpath';
|
|
21
|
-
import fhirpath_r4_model from 'fhirpath/fhir-context/r4';
|
|
22
|
-
import useConfigStore from '../stores/useConfigStore';
|
|
23
|
-
import useQuestionnaireStore from '../stores/useQuestionnaireStore';
|
|
24
|
-
function useValueSetCodings(qItem) {
|
|
25
|
-
var _a;
|
|
26
|
-
const patient = useConfigStore((state) => state.patient);
|
|
27
|
-
const user = useConfigStore((state) => state.user);
|
|
28
|
-
const encounter = useConfigStore((state) => state.encounter);
|
|
29
|
-
const launchContexts = useQuestionnaireStore((state) => state.launchContexts);
|
|
30
|
-
const processedValueSetCodings = useQuestionnaireStore((state) => state.processedValueSetCodings);
|
|
31
|
-
const cachedValueSetCodings = useQuestionnaireStore((state) => state.cachedValueSetCodings);
|
|
32
|
-
const addCodingToCache = useQuestionnaireStore((state) => state.addCodingToCache);
|
|
33
|
-
const { xFhirQueryVariables } = useQuestionnaireStore((state) => state.variables);
|
|
34
|
-
const valueSetUrl = qItem.answerValueSet;
|
|
35
|
-
let initialCodings = useMemo(() => {
|
|
36
|
-
// set options from cached answer options if present
|
|
37
|
-
if (valueSetUrl) {
|
|
38
|
-
let cleanValueSetUrl = valueSetUrl;
|
|
39
|
-
if (valueSetUrl.startsWith('#')) {
|
|
40
|
-
cleanValueSetUrl = valueSetUrl.slice(1);
|
|
41
|
-
}
|
|
42
|
-
// attempt to get codings from value sets preprocessed when loading questionnaire
|
|
43
|
-
if (processedValueSetCodings[cleanValueSetUrl]) {
|
|
44
|
-
return processedValueSetCodings[cleanValueSetUrl];
|
|
45
|
-
}
|
|
46
|
-
// attempt to get codings from cached queried value sets
|
|
47
|
-
if (cachedValueSetCodings[cleanValueSetUrl]) {
|
|
48
|
-
return cachedValueSetCodings[cleanValueSetUrl];
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return [];
|
|
52
|
-
}, [cachedValueSetCodings, processedValueSetCodings, valueSetUrl]);
|
|
53
|
-
const answerExpression = (_a = getAnswerExpression(qItem)) === null || _a === void 0 ? void 0 : _a.expression;
|
|
54
|
-
initialCodings = useMemo(() => {
|
|
55
|
-
if (initialCodings.length === 0 && answerExpression) {
|
|
56
|
-
const variable = answerExpression.substring(answerExpression.indexOf('%') + 1, answerExpression.indexOf('.'));
|
|
57
|
-
const contextMap = {};
|
|
58
|
-
// get answer expression resource from launch contexts
|
|
59
|
-
if (launchContexts[variable]) {
|
|
60
|
-
const resourceType = launchContexts[variable].extension[1].valueCode;
|
|
61
|
-
const resource = getResourceFromLaunchContext(resourceType, patient, user, encounter);
|
|
62
|
-
if (resource) {
|
|
63
|
-
contextMap[variable] = resource;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
else if (xFhirQueryVariables[variable]) {
|
|
67
|
-
const resource = xFhirQueryVariables[variable].result;
|
|
68
|
-
if (resource) {
|
|
69
|
-
contextMap[variable] = resource;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
if (contextMap[variable]) {
|
|
73
|
-
try {
|
|
74
|
-
const evaluated = fhirpath.evaluate({}, answerExpression, contextMap, fhirpath_r4_model);
|
|
75
|
-
if (evaluated[0].system || evaluated[0].code) {
|
|
76
|
-
// determine if the evaluated array is a coding array
|
|
77
|
-
return evaluated;
|
|
78
|
-
}
|
|
79
|
-
else if (evaluated[0].coding) {
|
|
80
|
-
// determine and return if the evaluated array is a codeable concept
|
|
81
|
-
return evaluated[0].coding;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
catch (e) {
|
|
85
|
-
console.warn(e.message);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return initialCodings;
|
|
90
|
-
}, [
|
|
91
|
-
answerExpression,
|
|
92
|
-
encounter,
|
|
93
|
-
initialCodings,
|
|
94
|
-
launchContexts,
|
|
95
|
-
patient,
|
|
96
|
-
user,
|
|
97
|
-
xFhirQueryVariables
|
|
98
|
-
]);
|
|
99
|
-
const [codings, setCodings] = useState(initialCodings);
|
|
100
|
-
const [serverError, setServerError] = useState(null);
|
|
101
|
-
// get options from answerValueSet on render
|
|
102
|
-
useEffect(() => {
|
|
103
|
-
const valueSetUrl = qItem.answerValueSet;
|
|
104
|
-
if (!valueSetUrl || codings.length > 0)
|
|
105
|
-
return;
|
|
106
|
-
const terminologyServer = getTerminologyServerUrl(qItem);
|
|
107
|
-
const promise = getValueSetPromise(valueSetUrl, terminologyServer);
|
|
108
|
-
if (promise) {
|
|
109
|
-
promise
|
|
110
|
-
.then((valueSet) => {
|
|
111
|
-
const codings = getValueSetCodings(valueSet);
|
|
112
|
-
if (codings.length > 0) {
|
|
113
|
-
addCodingToCache(valueSetUrl, codings);
|
|
114
|
-
setCodings(codings);
|
|
115
|
-
}
|
|
116
|
-
})
|
|
117
|
-
.catch((error) => {
|
|
118
|
-
setServerError(error);
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
}, [qItem]);
|
|
122
|
-
return { codings, serverError };
|
|
123
|
-
}
|
|
124
|
-
export default useValueSetCodings;
|
|
125
|
-
//# sourceMappingURL=useValueSetCodings.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useValueSetCodings.js","sourceRoot":"","sources":["useValueSetCodings.ts"],"names":[],"mappings":"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"}
|
package/src/index.js
DELETED
package/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"answerExpression.interface.js","sourceRoot":"","sources":["answerExpression.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"calculatedExpression.interface.js","sourceRoot":"","sources":["calculatedExpression.interface.ts"],"names":[],"mappings":""}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 Commonwealth Scientific and Industrial Research
|
|
3
|
-
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
export var QItemChoiceControl;
|
|
18
|
-
(function (QItemChoiceControl) {
|
|
19
|
-
QItemChoiceControl["Radio"] = "radio";
|
|
20
|
-
QItemChoiceControl["Select"] = "select";
|
|
21
|
-
QItemChoiceControl["Autocomplete"] = "autocomplete";
|
|
22
|
-
QItemChoiceControl["Checkbox"] = "check-box";
|
|
23
|
-
})(QItemChoiceControl || (QItemChoiceControl = {}));
|
|
24
|
-
export var QItemOpenChoiceControl;
|
|
25
|
-
(function (QItemOpenChoiceControl) {
|
|
26
|
-
QItemOpenChoiceControl["Select"] = "select";
|
|
27
|
-
QItemOpenChoiceControl["Autocomplete"] = "autocomplete";
|
|
28
|
-
QItemOpenChoiceControl["Checkbox"] = "check-box";
|
|
29
|
-
QItemOpenChoiceControl["Radio"] = "radio";
|
|
30
|
-
})(QItemOpenChoiceControl || (QItemOpenChoiceControl = {}));
|
|
31
|
-
export var QItemChoiceOrientation;
|
|
32
|
-
(function (QItemChoiceOrientation) {
|
|
33
|
-
QItemChoiceOrientation["Horizontal"] = "horizontal";
|
|
34
|
-
QItemChoiceOrientation["Vertical"] = "vertical";
|
|
35
|
-
})(QItemChoiceOrientation || (QItemChoiceOrientation = {}));
|
|
36
|
-
export var CheckBoxOptionType;
|
|
37
|
-
(function (CheckBoxOptionType) {
|
|
38
|
-
CheckBoxOptionType["AnswerOption"] = "answerOption";
|
|
39
|
-
CheckBoxOptionType["AnswerValueSet"] = "answerValueSet";
|
|
40
|
-
})(CheckBoxOptionType || (CheckBoxOptionType = {}));
|
|
41
|
-
//# sourceMappingURL=choice.enum.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"choice.enum.js","sourceRoot":"","sources":["choice.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,CAAN,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,qCAAe,CAAA;IACf,uCAAiB,CAAA;IACjB,mDAA6B,CAAA;IAC7B,4CAAsB,CAAA;AACxB,CAAC,EALW,kBAAkB,KAAlB,kBAAkB,QAK7B;AAED,MAAM,CAAN,IAAY,sBAKX;AALD,WAAY,sBAAsB;IAChC,2CAAiB,CAAA;IACjB,uDAA6B,CAAA;IAC7B,gDAAsB,CAAA;IACtB,yCAAe,CAAA;AACjB,CAAC,EALW,sBAAsB,KAAtB,sBAAsB,QAKjC;AAED,MAAM,CAAN,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAChC,mDAAyB,CAAA;IACzB,+CAAqB,CAAA;AACvB,CAAC,EAHW,sBAAsB,KAAtB,sBAAsB,QAGjC;AAED,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,mDAA6B,CAAA;IAC7B,uDAAiC,CAAA;AACnC,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"enableWhen.interface.js","sourceRoot":"","sources":["enableWhen.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 Commonwealth Scientific and Industrial Research
|
|
3
|
-
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
export {};
|
|
18
|
-
//# sourceMappingURL=groupTable.interface.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"groupTable.interface.js","sourceRoot":"","sources":["groupTable.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 Commonwealth Scientific and Industrial Research
|
|
3
|
-
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
export {};
|
|
18
|
-
//# sourceMappingURL=populate.interface.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"populate.interface.js","sourceRoot":"","sources":["populate.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 Commonwealth Scientific and Industrial Research
|
|
3
|
-
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
export {};
|
|
18
|
-
//# sourceMappingURL=questionnaireStore.interface.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"questionnaireStore.interface.js","sourceRoot":"","sources":["questionnaireStore.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 Commonwealth Scientific and Industrial Research
|
|
3
|
-
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
export {};
|
|
18
|
-
//# sourceMappingURL=regex.interface.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"regex.interface.js","sourceRoot":"","sources":["regex.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 Commonwealth Scientific and Industrial Research
|
|
3
|
-
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
export {};
|
|
18
|
-
//# sourceMappingURL=renderProps.interface.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderProps.interface.js","sourceRoot":"","sources":["renderProps.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 Commonwealth Scientific and Industrial Research
|
|
3
|
-
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
export {};
|
|
18
|
-
//# sourceMappingURL=repeatGroup.interface.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"repeatGroup.interface.js","sourceRoot":"","sources":["repeatGroup.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"repeatItem.interface.js","sourceRoot":"","sources":["repeatItem.interface.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tab.interface.js","sourceRoot":"","sources":["tab.interface.ts"],"names":[],"mappings":""}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 Commonwealth Scientific and Industrial Research
|
|
3
|
-
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
export {};
|
|
18
|
-
//# sourceMappingURL=valueSet.interface.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"valueSet.interface.js","sourceRoot":"","sources":["valueSet.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 Commonwealth Scientific and Industrial Research
|
|
3
|
-
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
export {};
|
|
18
|
-
//# sourceMappingURL=variables.interface.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"variables.interface.js","sourceRoot":"","sources":["variables.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
|
package/src/setup-jest.js
DELETED
package/src/setup-jest.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup-jest.js","sourceRoot":"","sources":["setup-jest.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { create } from 'zustand';
|
|
2
|
-
const useConfigStore = create()((set) => ({
|
|
3
|
-
smartClient: null,
|
|
4
|
-
patient: null,
|
|
5
|
-
user: null,
|
|
6
|
-
encounter: null,
|
|
7
|
-
launchQuestionnaire: null,
|
|
8
|
-
debugMode: false,
|
|
9
|
-
setSmartClient: (client) => set(() => ({ smartClient: client })),
|
|
10
|
-
setPatient: (patient) => set(() => ({ patient: patient })),
|
|
11
|
-
setUser: (user) => set(() => ({ user: user })),
|
|
12
|
-
setEncounter: (encounter) => set(() => ({ encounter: encounter })),
|
|
13
|
-
setLaunchQuestionnaire: (launchQuestionnaire) => set(() => ({ launchQuestionnaire: launchQuestionnaire })),
|
|
14
|
-
activateDebugMode: () => set(() => ({ debugMode: true }))
|
|
15
|
-
}));
|
|
16
|
-
export default useConfigStore;
|
|
17
|
-
//# sourceMappingURL=useConfigStore.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useConfigStore.js","sourceRoot":"","sources":["useConfigStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAmBjC,MAAM,cAAc,GAAG,MAAM,EAAe,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACrD,WAAW,EAAE,IAAI;IACjB,OAAO,EAAE,IAAI;IACb,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,IAAI;IACf,mBAAmB,EAAE,IAAI;IACzB,SAAS,EAAE,KAAK;IAChB,cAAc,EAAE,CAAC,MAAc,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,CAAC;IACxE,UAAU,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;IACnE,OAAO,EAAE,CAAC,IAAkB,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5D,YAAY,EAAE,CAAC,SAAoB,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC;IAC7E,sBAAsB,EAAE,CAAC,mBAAyC,EAAE,EAAE,CACpE,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,CAAC,CAAC;IAC3D,iBAAiB,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;CAC1D,CAAC,CAAC,CAAC;AAEJ,eAAe,cAAc,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { create } from 'zustand';
|
|
2
|
-
import { emptyResponse } from '../utils/emptyResource';
|
|
3
|
-
import cloneDeep from 'lodash.clonedeep';
|
|
4
|
-
const useQuestionnaireResponseStore = create()((set) => ({
|
|
5
|
-
sourceResponse: cloneDeep(emptyResponse),
|
|
6
|
-
updatableResponse: cloneDeep(emptyResponse),
|
|
7
|
-
hasChanges: false,
|
|
8
|
-
buildSourceResponse: (questionnaireResponse) => {
|
|
9
|
-
set(() => ({
|
|
10
|
-
sourceResponse: questionnaireResponse,
|
|
11
|
-
updatableResponse: questionnaireResponse
|
|
12
|
-
}));
|
|
13
|
-
},
|
|
14
|
-
populateResponse: (populatedResponse) => {
|
|
15
|
-
set(() => ({
|
|
16
|
-
updatableResponse: populatedResponse
|
|
17
|
-
}));
|
|
18
|
-
},
|
|
19
|
-
updateResponse: (updatedResponse) => set(() => ({
|
|
20
|
-
updatableResponse: updatedResponse,
|
|
21
|
-
hasChanges: true
|
|
22
|
-
})),
|
|
23
|
-
saveResponse: (savedResponse) => set(() => ({
|
|
24
|
-
sourceResponse: savedResponse,
|
|
25
|
-
updatableResponse: savedResponse,
|
|
26
|
-
hasChanges: false
|
|
27
|
-
})),
|
|
28
|
-
clearResponse: (clearedResponse) => set(() => ({
|
|
29
|
-
updatableResponse: clearedResponse,
|
|
30
|
-
hasChanges: false
|
|
31
|
-
})),
|
|
32
|
-
destroySourceResponse: () => set(() => ({
|
|
33
|
-
sourceResponse: cloneDeep(emptyResponse),
|
|
34
|
-
updatableResponse: cloneDeep(emptyResponse),
|
|
35
|
-
hasChanges: false
|
|
36
|
-
}))
|
|
37
|
-
}));
|
|
38
|
-
export default useQuestionnaireResponseStore;
|
|
39
|
-
//# sourceMappingURL=useQuestionnaireResponseStore.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useQuestionnaireResponseStore.js","sourceRoot":"","sources":["useQuestionnaireResponseStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,SAAS,MAAM,kBAAkB,CAAC;AAczC,MAAM,6BAA6B,GAAG,MAAM,EAAqC,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC1F,cAAc,EAAE,SAAS,CAAC,aAAa,CAAC;IACxC,iBAAiB,EAAE,SAAS,CAAC,aAAa,CAAC;IAC3C,UAAU,EAAE,KAAK;IAEjB,mBAAmB,EAAE,CAAC,qBAA4C,EAAE,EAAE;QACpE,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;YACT,cAAc,EAAE,qBAAqB;YACrC,iBAAiB,EAAE,qBAAqB;SACzC,CAAC,CAAC,CAAC;IACN,CAAC;IACD,gBAAgB,EAAE,CAAC,iBAAwC,EAAE,EAAE;QAC7D,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;YACT,iBAAiB,EAAE,iBAAiB;SACrC,CAAC,CAAC,CAAC;IACN,CAAC;IACD,cAAc,EAAE,CAAC,eAAsC,EAAE,EAAE,CACzD,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;QACT,iBAAiB,EAAE,eAAe;QAClC,UAAU,EAAE,IAAI;KACjB,CAAC,CAAC;IACL,YAAY,EAAE,CAAC,aAAoC,EAAE,EAAE,CACrD,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;QACT,cAAc,EAAE,aAAa;QAC7B,iBAAiB,EAAE,aAAa;QAChC,UAAU,EAAE,KAAK;KAClB,CAAC,CAAC;IACL,aAAa,EAAE,CAAC,eAAsC,EAAE,EAAE,CACxD,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;QACT,iBAAiB,EAAE,eAAe;QAClC,UAAU,EAAE,KAAK;KAClB,CAAC,CAAC;IACL,qBAAqB,EAAE,GAAG,EAAE,CAC1B,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;QACT,cAAc,EAAE,SAAS,CAAC,aAAa,CAAC;QACxC,iBAAiB,EAAE,SAAS,CAAC,aAAa,CAAC;QAC3C,UAAU,EAAE,KAAK;KAClB,CAAC,CAAC;CACN,CAAC,CAAC,CAAC;AAEJ,eAAe,6BAA6B,CAAC"}
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 Commonwealth Scientific and Industrial Research
|
|
3
|
-
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
import { create } from 'zustand';
|
|
27
|
-
import { updateItemAnswer } from '../utils/enableWhen';
|
|
28
|
-
import { evaluateUpdatedExpressions } from '../utils/fhirpath';
|
|
29
|
-
import { evaluateInitialCalculatedExpressions, initialiseCalculatedExpressionValues } from '../utils/calculatedExpression';
|
|
30
|
-
import { createQuestionnaireModel } from '../utils/questionnaireStoreUtils/createQuestionaireModel';
|
|
31
|
-
import { initialiseFormFromResponse } from '../utils/initialiseForm';
|
|
32
|
-
import { emptyQuestionnaire, emptyResponse } from '../utils/emptyResource';
|
|
33
|
-
import cloneDeep from 'lodash.clonedeep';
|
|
34
|
-
const useQuestionnaireStore = create()((set, get) => ({
|
|
35
|
-
sourceQuestionnaire: cloneDeep(emptyQuestionnaire),
|
|
36
|
-
tabs: {},
|
|
37
|
-
currentTabIndex: 0,
|
|
38
|
-
variables: { fhirPathVariables: {}, xFhirQueryVariables: {} },
|
|
39
|
-
launchContexts: {},
|
|
40
|
-
calculatedExpressions: {},
|
|
41
|
-
enableWhenExpressions: {},
|
|
42
|
-
answerExpressions: {},
|
|
43
|
-
enableWhenItems: {},
|
|
44
|
-
enableWhenLinkedQuestions: {},
|
|
45
|
-
enableWhenIsActivated: true,
|
|
46
|
-
processedValueSetCodings: {},
|
|
47
|
-
processedValueSetUrls: {},
|
|
48
|
-
cachedValueSetCodings: {},
|
|
49
|
-
buildSourceQuestionnaire: (questionnaire, questionnaireResponse = cloneDeep(emptyResponse), additionalVariables = {}) => __awaiter(void 0, void 0, void 0, function* () {
|
|
50
|
-
const questionnaireModel = yield createQuestionnaireModel(questionnaire, additionalVariables);
|
|
51
|
-
const { initialEnableWhenItems, initialEnableWhenLinkedQuestions, initialEnableWhenExpressions, initialCalculatedExpressions, firstVisibleTab } = initialiseFormFromResponse({
|
|
52
|
-
questionnaireResponse,
|
|
53
|
-
enableWhenItems: questionnaireModel.enableWhenItems,
|
|
54
|
-
enableWhenExpressions: questionnaireModel.enableWhenExpressions,
|
|
55
|
-
calculatedExpressions: questionnaireModel.calculatedExpressions,
|
|
56
|
-
variablesFhirPath: questionnaireModel.variables.fhirPathVariables,
|
|
57
|
-
tabs: questionnaireModel.tabs
|
|
58
|
-
});
|
|
59
|
-
set({
|
|
60
|
-
sourceQuestionnaire: questionnaire,
|
|
61
|
-
tabs: questionnaireModel.tabs,
|
|
62
|
-
currentTabIndex: firstVisibleTab,
|
|
63
|
-
variables: questionnaireModel.variables,
|
|
64
|
-
launchContexts: questionnaireModel.launchContexts,
|
|
65
|
-
enableWhenItems: initialEnableWhenItems,
|
|
66
|
-
enableWhenLinkedQuestions: initialEnableWhenLinkedQuestions,
|
|
67
|
-
enableWhenExpressions: initialEnableWhenExpressions,
|
|
68
|
-
calculatedExpressions: initialCalculatedExpressions,
|
|
69
|
-
answerExpressions: questionnaireModel.answerExpressions,
|
|
70
|
-
processedValueSetCodings: questionnaireModel.processedValueSetCodings,
|
|
71
|
-
processedValueSetUrls: questionnaireModel.processedValueSetUrls
|
|
72
|
-
});
|
|
73
|
-
}),
|
|
74
|
-
destroySourceQuestionnaire: () => set({
|
|
75
|
-
sourceQuestionnaire: cloneDeep(emptyQuestionnaire),
|
|
76
|
-
tabs: {},
|
|
77
|
-
currentTabIndex: 0,
|
|
78
|
-
variables: { fhirPathVariables: {}, xFhirQueryVariables: {} },
|
|
79
|
-
launchContexts: {},
|
|
80
|
-
enableWhenItems: {},
|
|
81
|
-
enableWhenLinkedQuestions: {},
|
|
82
|
-
enableWhenExpressions: {},
|
|
83
|
-
calculatedExpressions: {},
|
|
84
|
-
answerExpressions: {},
|
|
85
|
-
processedValueSetCodings: {},
|
|
86
|
-
processedValueSetUrls: {}
|
|
87
|
-
}),
|
|
88
|
-
switchTab: (newTabIndex) => set(() => ({ currentTabIndex: newTabIndex })),
|
|
89
|
-
markTabAsComplete: (tabLinkId) => {
|
|
90
|
-
const tabs = get().tabs;
|
|
91
|
-
set(() => ({
|
|
92
|
-
tabs: Object.assign(Object.assign({}, tabs), { [tabLinkId]: Object.assign(Object.assign({}, tabs[tabLinkId]), { isComplete: !tabs[tabLinkId].isComplete }) })
|
|
93
|
-
}));
|
|
94
|
-
},
|
|
95
|
-
updateEnableWhenItem: (linkId, newAnswer) => {
|
|
96
|
-
const enableWhenLinkedQuestions = get().enableWhenLinkedQuestions;
|
|
97
|
-
const enableWhenItems = get().enableWhenItems;
|
|
98
|
-
if (!enableWhenLinkedQuestions[linkId]) {
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
const itemLinkedQuestions = enableWhenLinkedQuestions[linkId];
|
|
102
|
-
const updatedEnableWhenItems = updateItemAnswer(Object.assign({}, enableWhenItems), itemLinkedQuestions, linkId, newAnswer);
|
|
103
|
-
set(() => ({
|
|
104
|
-
enableWhenItems: updatedEnableWhenItems
|
|
105
|
-
}));
|
|
106
|
-
},
|
|
107
|
-
toggleEnableWhenActivation: (isActivated) => set(() => ({ enableWhenIsActivated: isActivated })),
|
|
108
|
-
updateExpressions: (updatedResponse) => {
|
|
109
|
-
const { isUpdated, updatedCalculatedExpressions, updatedEnableWhenExpressions } = evaluateUpdatedExpressions({
|
|
110
|
-
updatedResponse: updatedResponse,
|
|
111
|
-
enableWhenExpressions: get().enableWhenExpressions,
|
|
112
|
-
calculatedExpressions: get().calculatedExpressions,
|
|
113
|
-
variablesFhirPath: get().variables.fhirPathVariables
|
|
114
|
-
});
|
|
115
|
-
if (isUpdated) {
|
|
116
|
-
set(() => ({
|
|
117
|
-
enableWhenExpressions: updatedEnableWhenExpressions,
|
|
118
|
-
calculatedExpressions: updatedCalculatedExpressions
|
|
119
|
-
}));
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
addCodingToCache: (valueSetUrl, codings) => set(() => ({
|
|
123
|
-
cachedValueSetCodings: Object.assign(Object.assign({}, get().cachedValueSetCodings), { [valueSetUrl]: codings })
|
|
124
|
-
})),
|
|
125
|
-
updatePopulatedProperties: (populatedResponse) => {
|
|
126
|
-
const initialCalculatedExpressions = evaluateInitialCalculatedExpressions({
|
|
127
|
-
initialResponse: populatedResponse,
|
|
128
|
-
calculatedExpressions: get().calculatedExpressions,
|
|
129
|
-
variablesFhirPath: get().variables.fhirPathVariables
|
|
130
|
-
});
|
|
131
|
-
const updatedResponse = initialiseCalculatedExpressionValues(get().sourceQuestionnaire, populatedResponse, initialCalculatedExpressions);
|
|
132
|
-
const { initialEnableWhenItems, initialEnableWhenLinkedQuestions, initialEnableWhenExpressions, firstVisibleTab } = initialiseFormFromResponse({
|
|
133
|
-
questionnaireResponse: updatedResponse,
|
|
134
|
-
enableWhenItems: get().enableWhenItems,
|
|
135
|
-
enableWhenExpressions: get().enableWhenExpressions,
|
|
136
|
-
calculatedExpressions: initialCalculatedExpressions,
|
|
137
|
-
variablesFhirPath: get().variables.fhirPathVariables,
|
|
138
|
-
tabs: get().tabs
|
|
139
|
-
});
|
|
140
|
-
set(() => ({
|
|
141
|
-
enableWhenItems: initialEnableWhenItems,
|
|
142
|
-
enableWhenLinkedQuestions: initialEnableWhenLinkedQuestions,
|
|
143
|
-
enableWhenExpressions: initialEnableWhenExpressions,
|
|
144
|
-
calculatedExpressions: initialCalculatedExpressions,
|
|
145
|
-
currentTabIndex: firstVisibleTab
|
|
146
|
-
}));
|
|
147
|
-
return updatedResponse;
|
|
148
|
-
}
|
|
149
|
-
}));
|
|
150
|
-
export default useQuestionnaireStore;
|
|
151
|
-
//# sourceMappingURL=useQuestionnaireStore.js.map
|