@aehrc/smart-forms-renderer 0.7.1 → 0.8.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/README.md +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.js +1 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.d.ts +12 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.js +39 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.js.map +1 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.d.ts +3 -3
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js +14 -27
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.d.ts +13 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.js +42 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.js.map +1 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.d.ts +4 -3
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js +14 -22
- package/lib/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.d.ts +2 -2
- package/lib/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.js +3 -3
- package/lib/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.d.ts +12 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.js +27 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.js.map +1 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.d.ts +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js +9 -24
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.d.ts +14 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.js +42 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.js.map +1 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.d.ts +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js +8 -21
- package/lib/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.d.ts +10 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.js +41 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.js.map +1 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.js +7 -23
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.d.ts +12 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.js +42 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.js.map +1 -0
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.js +8 -18
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/DecimalItem/DecimalItem.js +3 -2
- package/lib/components/FormComponents/DecimalItem/DecimalItem.js.map +1 -1
- package/lib/components/FormComponents/GridGroup/GridGroup.js +2 -2
- package/lib/components/FormComponents/GridGroup/GridGroup.js.map +1 -1
- package/lib/components/FormComponents/GridGroup/GridRow.js +2 -2
- package/lib/components/FormComponents/GridGroup/GridRow.js.map +1 -1
- package/lib/components/FormComponents/GroupItem/GroupChildItemSwitcher.d.ts +10 -0
- package/lib/components/FormComponents/GroupItem/GroupChildItemSwitcher.js +73 -0
- package/lib/components/FormComponents/GroupItem/GroupChildItemSwitcher.js.map +1 -0
- package/lib/components/FormComponents/GroupItem/GroupItem.js +3 -3
- package/lib/components/FormComponents/GroupItem/GroupItem.js.map +1 -1
- package/lib/components/FormComponents/GroupItem/GroupItemSwitcher.js +4 -4
- package/lib/components/FormComponents/GroupItem/GroupItemSwitcher.js.map +1 -1
- package/lib/components/FormComponents/GroupItem/ItemSwitcher.d.ts +10 -0
- package/lib/components/FormComponents/GroupItem/ItemSwitcher.js +81 -0
- package/lib/components/FormComponents/GroupItem/ItemSwitcher.js.map +1 -0
- package/lib/components/FormComponents/GroupItem/TopLevelGroupItemSwitcher.d.ts +10 -0
- package/lib/components/FormComponents/GroupItem/TopLevelGroupItemSwitcher.js +45 -0
- package/lib/components/FormComponents/GroupItem/TopLevelGroupItemSwitcher.js.map +1 -0
- package/lib/components/FormComponents/IntegerItem/IntegerItem.js +3 -2
- package/lib/components/FormComponents/IntegerItem/IntegerItem.js.map +1 -1
- package/lib/components/FormComponents/Item.styles.d.ts +2 -2
- package/lib/components/FormComponents/Item.styles.js +2 -2
- package/lib/components/FormComponents/Item.styles.js.map +1 -1
- package/lib/components/FormComponents/ItemParts/RadioAnswerOptionButtons.d.ts +8 -0
- package/lib/components/FormComponents/ItemParts/RadioAnswerOptionButtons.js +37 -0
- package/lib/components/FormComponents/ItemParts/RadioAnswerOptionButtons.js.map +1 -0
- package/lib/components/FormComponents/ItemParts/RadioButtons.d.ts +8 -0
- package/lib/components/FormComponents/ItemParts/RadioButtons.js +37 -0
- package/lib/components/FormComponents/ItemParts/RadioButtons.js.map +1 -0
- package/lib/components/FormComponents/ItemParts/RadioButtonsAnswerOption.d.ts +8 -0
- package/lib/components/FormComponents/ItemParts/RadioButtonsAnswerOption.js +37 -0
- package/lib/components/FormComponents/ItemParts/RadioButtonsAnswerOption.js.map +1 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.d.ts +20 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.js +49 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.js.map +1 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteFieldEndAdornment.d.ts +0 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteFieldEndAdornment.js +2 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteFieldEndAdornment.js.map +1 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.js +11 -35
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.d.ts +17 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.js +42 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.js.map +1 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.d.ts +3 -3
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js +23 -36
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.d.ts +2 -2
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.js +3 -3
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.d.ts +15 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.js +29 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.js.map +1 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.d.ts +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js +3 -23
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.d.ts +11 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.js +14 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.js.map +1 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionFields.d.ts +0 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionFields.js +2 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionFields.js.map +1 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.js +18 -23
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.js.map +1 -1
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.d.ts +12 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.js +16 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.js.map +1 -0
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.js +8 -14
- package/lib/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.js.map +1 -1
- package/lib/components/FormComponents/RepeatGroup/RepeatGroup.js +4 -3
- package/lib/components/FormComponents/RepeatGroup/RepeatGroup.js.map +1 -1
- package/lib/components/FormComponents/RepeatGroup/index.d.ts +1 -0
- package/lib/components/FormComponents/RepeatGroup/index.js +18 -0
- package/lib/components/FormComponents/RepeatGroup/index.js.map +1 -0
- package/lib/components/FormComponents/RepeatItem/RepeatItem.js +1 -1
- package/lib/components/FormComponents/RepeatItem/RepeatItem.js.map +1 -1
- package/lib/components/FormComponents/SingleItem/SingleItem.d.ts +2 -2
- package/lib/components/FormComponents/SingleItem/SingleItem.js +2 -2
- package/lib/components/FormComponents/SingleItem/SingleItem.js.map +1 -1
- package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.d.ts +2 -2
- package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js +3 -3
- package/lib/components/FormComponents/SingleItem/SingleItemSwitcher.js.map +1 -1
- package/lib/components/FormComponents/SingleItem/index.d.ts +1 -0
- package/lib/components/FormComponents/SingleItem/index.js +18 -0
- package/lib/components/FormComponents/SingleItem/index.js.map +1 -0
- package/lib/components/FormComponents/StringItem/StringItem.js +3 -2
- package/lib/components/FormComponents/StringItem/StringItem.js.map +1 -1
- package/lib/components/FormComponents/Tables/AddItemButton.d.ts +8 -0
- package/lib/components/FormComponents/Tables/AddItemButton.js +28 -0
- package/lib/components/FormComponents/Tables/AddItemButton.js.map +1 -0
- package/lib/components/FormComponents/Tables/AddRowButton.d.ts +8 -0
- package/lib/components/FormComponents/Tables/AddRowButton.js +28 -0
- package/lib/components/FormComponents/Tables/AddRowButton.js.map +1 -0
- package/lib/components/FormComponents/Tables/GroupTable.d.ts +10 -0
- package/lib/components/FormComponents/Tables/GroupTable.js +108 -0
- package/lib/components/FormComponents/Tables/GroupTable.js.map +1 -0
- package/lib/components/FormComponents/Tables/GroupTableRow.d.ts +10 -0
- package/lib/components/FormComponents/Tables/GroupTableRow.js +46 -0
- package/lib/components/FormComponents/Tables/GroupTableRow.js.map +1 -0
- package/lib/components/FormComponents/Tables/QItemGroupTable.js +7 -5
- package/lib/components/FormComponents/Tables/QItemGroupTable.js.map +1 -1
- package/lib/components/FormComponents/Tables/QItemGroupTableRow.js +2 -2
- package/lib/components/FormComponents/Tables/QItemGroupTableRow.js.map +1 -1
- package/lib/components/FormComponents/Tables/index.d.ts +1 -0
- package/lib/components/FormComponents/Tables/index.js +18 -0
- package/lib/components/FormComponents/Tables/index.js.map +1 -0
- package/lib/components/FormComponents/TextItem/TextItem.js +3 -2
- package/lib/components/FormComponents/TextItem/TextItem.js.map +1 -1
- package/lib/components/FormComponents/index.d.ts +3 -0
- package/lib/components/FormComponents/index.js +20 -0
- package/lib/components/FormComponents/index.js.map +1 -0
- package/lib/components/Renderer/BaseRenderer.js +26 -14
- package/lib/components/Renderer/BaseRenderer.js.map +1 -1
- package/lib/components/Renderer/FormBodyCollapsible.js +2 -2
- package/lib/components/Renderer/FormBodyCollapsible.js.map +1 -1
- package/lib/components/Renderer/FormBodyTabbed.js +3 -3
- package/lib/components/Renderer/FormBodyTabbed.js.map +1 -1
- package/lib/components/Renderer/FormTopLevelItem.d.ts +4 -4
- package/lib/components/Renderer/FormTopLevelItem.js +14 -1
- package/lib/components/Renderer/FormTopLevelItem.js.map +1 -1
- package/lib/components/Tabs/FormBodySingleTab.js +1 -1
- package/lib/components/Tabs/FormBodySingleTab.js.map +1 -1
- package/lib/components/Tabs/FormBodyTabList.d.ts +1 -0
- package/lib/components/Tabs/FormBodyTabList.js +3 -4
- package/lib/components/Tabs/FormBodyTabList.js.map +1 -1
- package/lib/components/Tabs/FormBodyTabListWrapper.d.ts +1 -1
- package/lib/components/Tabs/FormBodyTabListWrapper.js +6 -13
- package/lib/components/Tabs/FormBodyTabListWrapper.js.map +1 -1
- package/lib/components/Tabs/ShowCompletedTabsSection.d.ts +7 -0
- package/lib/components/Tabs/ShowCompletedTabsSection.js +34 -0
- package/lib/components/Tabs/ShowCompletedTabsSection.js.map +1 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +1 -0
- package/lib/components/index.js.map +1 -1
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/index.js +2 -0
- package/lib/hooks/index.js.map +1 -0
- package/lib/hooks/useContextDisplayItems.d.ts +6 -0
- package/lib/hooks/useContextDisplayItems.js +30 -0
- package/lib/hooks/useContextDisplayItems.js.map +1 -0
- package/lib/hooks/useDecimalUpdateFromProp.d.ts +2 -0
- package/lib/hooks/useDecimalUpdateFromProp.js +29 -0
- package/lib/hooks/useDecimalUpdateFromProp.js.map +1 -0
- package/lib/hooks/useInitialiseRenderer.js +2 -2
- package/lib/hooks/useInitialiseRenderer.js.map +1 -1
- package/lib/hooks/useInitialiseRepeatAnswers.d.ts +2 -2
- package/lib/hooks/useInitialiseRepeatAnswers.js +21 -15
- package/lib/hooks/useInitialiseRepeatAnswers.js.map +1 -1
- package/lib/hooks/useInitialiseRepeatGroups.d.ts +2 -1
- package/lib/hooks/useInitialiseRepeatGroups.js +21 -15
- package/lib/hooks/useInitialiseRepeatGroups.js.map +1 -1
- package/lib/hooks/useIntegerUpdateFromProp.d.ts +2 -0
- package/lib/hooks/useIntegerUpdateFromProp.js +29 -0
- package/lib/hooks/useIntegerUpdateFromProp.js.map +1 -0
- package/lib/hooks/useNumberInput.d.ts +3 -0
- package/lib/hooks/useNumberInput.js +31 -0
- package/lib/hooks/useNumberInput.js.map +1 -0
- package/lib/hooks/useNumberUpdateFromProp.d.ts +2 -0
- package/lib/hooks/useNumberUpdateFromProp.js +29 -0
- package/lib/hooks/useNumberUpdateFromProp.js.map +1 -0
- package/lib/hooks/useRepeatItemState.d.ts +5 -0
- package/lib/hooks/useRepeatItemState.js +35 -0
- package/lib/hooks/useRepeatItemState.js.map +1 -0
- package/lib/hooks/useRepeatItemUpdateFromProp.d.ts +2 -0
- package/lib/hooks/useRepeatItemUpdateFromProp.js +29 -0
- package/lib/hooks/useRepeatItemUpdateFromProp.js.map +1 -0
- package/lib/hooks/useStringField.d.ts +2 -0
- package/lib/hooks/useStringField.js +29 -0
- package/lib/hooks/useStringField.js.map +1 -0
- package/lib/hooks/useStringInput.d.ts +3 -0
- package/lib/hooks/useStringInput.js +31 -0
- package/lib/hooks/useStringInput.js.map +1 -0
- package/lib/hooks/useStringUpdateFromProp.d.ts +2 -0
- package/lib/hooks/useStringUpdateFromProp.js +29 -0
- package/lib/hooks/useStringUpdateFromProp.js.map +1 -0
- package/lib/hooks/useTerminologyServerQuery.js +3 -6
- package/lib/hooks/useTerminologyServerQuery.js.map +1 -1
- package/lib/index.d.ts +16 -0
- package/lib/index.js +29 -2
- package/lib/index.js.map +1 -1
- package/lib/interfaces/questionnaireStore.interface.d.ts +1 -0
- package/lib/interfaces/renderProps.interface.d.ts +3 -0
- package/lib/stores/useQuestionnaireResponseStore.d.ts +2 -1
- package/lib/stores/useQuestionnaireResponseStore.js +17 -10
- package/lib/stores/useQuestionnaireResponseStore.js.map +1 -1
- package/lib/stores/useQuestionnaireStore.d.ts +2 -1
- package/lib/stores/useQuestionnaireStore.js +5 -2
- package/lib/stores/useQuestionnaireStore.js.map +1 -1
- package/lib/theme/overrides/Overrides.js +1 -2
- package/lib/theme/overrides/Overrides.js.map +1 -1
- package/lib/utils/calculatedExpression.js +2 -2
- package/lib/utils/calculatedExpression.js.map +1 -1
- package/lib/utils/formChanges.d.ts +18 -0
- package/lib/utils/formChanges.js +91 -0
- package/lib/utils/formChanges.js.map +1 -0
- package/lib/utils/formChangesOld.d.ts +18 -0
- package/lib/utils/formChangesOld.js +91 -0
- package/lib/utils/formChangesOld.js.map +1 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +18 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/mapItem.d.ts +2 -2
- package/lib/utils/mapItem.js +3 -3
- package/lib/utils/mapItem.js.map +1 -1
- package/lib/utils/qItem.d.ts +2 -0
- package/lib/utils/qItem.js +22 -0
- package/lib/utils/qItem.js.map +1 -1
- package/lib/utils/qrItem.d.ts +3 -4
- package/lib/utils/qrItem.js +94 -96
- package/lib/utils/qrItem.js.map +1 -1
- package/lib/utils/questionnaireStoreUtils/createQuestionaireModel.js +4 -0
- package/lib/utils/questionnaireStoreUtils/createQuestionaireModel.js.map +1 -1
- package/lib/utils/repopulate.d.ts +9 -0
- package/lib/utils/repopulate.js +133 -0
- package/lib/utils/repopulate.js.map +1 -0
- package/lib/utils/repopulateGenerateItems.d.ts +9 -0
- package/lib/utils/repopulateGenerateItems.js +133 -0
- package/lib/utils/repopulateGenerateItems.js.map +1 -0
- package/lib/utils/repopulateIntoResponse.d.ts +3 -0
- package/lib/utils/repopulateIntoResponse.js +92 -0
- package/lib/utils/repopulateIntoResponse.js.map +1 -0
- package/lib/utils/repopulateItems.d.ts +9 -0
- package/lib/utils/repopulateItems.js +130 -0
- package/lib/utils/repopulateItems.js.map +1 -0
- package/lib/utils/repopulateRepeatGroup.d.ts +4 -0
- package/lib/utils/repopulateRepeatGroup.js +54 -0
- package/lib/utils/repopulateRepeatGroup.js.map +1 -0
- package/package.json +7 -5
- package/src/components/FormComponents/ChoiceItems/ChoiceAutocompleteItem.tsx +1 -2
- package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionFields.tsx +85 -0
- package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerOptionItem.tsx +35 -58
- package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetFields.tsx +79 -0
- package/src/components/FormComponents/ChoiceItems/ChoiceCheckboxAnswerValueSetItem.tsx +37 -50
- package/src/components/FormComponents/ChoiceItems/ChoiceItemSwitcher.tsx +10 -5
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionFields.tsx +48 -0
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerOptionItem.tsx +25 -53
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetFields.tsx +83 -0
- package/src/components/FormComponents/ChoiceItems/ChoiceRadioAnswerValueSetItem.tsx +27 -49
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionFields.tsx +81 -0
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerOptionItem.tsx +19 -54
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.tsx +97 -0
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetItem.tsx +22 -60
- package/src/components/FormComponents/DecimalItem/DecimalItem.tsx +3 -2
- package/src/components/FormComponents/GridGroup/GridGroup.tsx +2 -2
- package/src/components/FormComponents/GridGroup/GridRow.tsx +2 -2
- package/src/components/FormComponents/GroupItem/GroupItem.tsx +3 -3
- package/src/components/FormComponents/GroupItem/GroupItemSwitcher.tsx +4 -4
- package/src/components/FormComponents/IntegerItem/IntegerItem.tsx +3 -2
- package/src/components/FormComponents/Item.styles.ts +2 -2
- package/src/components/FormComponents/ItemParts/RadioAnswerOptionButtons.tsx +72 -0
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteField.tsx +131 -0
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceAutocompleteItem.tsx +38 -93
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionFields.tsx +112 -0
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceCheckboxAnswerOptionItem.tsx +57 -76
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceItemSwitcher.tsx +8 -5
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionFields.tsx +72 -0
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceRadioAnswerOptionItem.tsx +12 -59
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionField.tsx +54 -0
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerOptionItem.tsx +40 -64
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetField.tsx +63 -0
- package/src/components/FormComponents/OpenChoiceItems/OpenChoiceSelectAnswerValueSetItem.tsx +22 -50
- package/src/components/FormComponents/RepeatGroup/RepeatGroup.tsx +4 -3
- package/src/{theme/overrides/Backdrop.ts → components/FormComponents/RepeatGroup/index.ts} +1 -17
- package/src/components/FormComponents/RepeatItem/RepeatItem.tsx +1 -1
- package/src/components/FormComponents/SingleItem/SingleItem.tsx +6 -3
- package/src/components/FormComponents/SingleItem/SingleItemSwitcher.tsx +7 -3
- package/src/components/FormComponents/SingleItem/index.ts +18 -0
- package/src/components/FormComponents/StringItem/StringItem.tsx +3 -2
- package/src/components/FormComponents/Tables/AddRowButton.tsx +49 -0
- package/src/components/FormComponents/Tables/{QItemGroupTable.tsx → GroupTable.tsx} +21 -23
- package/src/components/FormComponents/Tables/{QItemGroupTableRow.tsx → GroupTableRow.tsx} +4 -4
- package/src/components/FormComponents/Tables/index.ts +18 -0
- package/src/components/FormComponents/TextItem/TextItem.tsx +3 -2
- package/src/components/FormComponents/index.ts +20 -0
- package/src/components/Renderer/BaseRenderer.tsx +39 -18
- package/src/components/Renderer/FormBodyCollapsible.tsx +2 -2
- package/src/components/Renderer/FormBodyTabbed.tsx +3 -3
- package/src/components/Renderer/FormTopLevelItem.tsx +33 -4
- package/src/components/Tabs/FormBodySingleTab.tsx +1 -1
- package/src/components/Tabs/FormBodyTabList.tsx +5 -8
- package/src/components/Tabs/FormBodyTabListWrapper.tsx +15 -26
- package/src/components/Tabs/ShowCompletedTabsSection.tsx +52 -0
- package/src/components/index.ts +1 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useContextDisplayItems.ts +40 -0
- package/src/hooks/useInitialiseRenderer.ts +2 -2
- package/src/hooks/useInitialiseRepeatAnswers.ts +28 -17
- package/src/hooks/useInitialiseRepeatGroups.ts +28 -17
- package/src/hooks/useNumberInput.ts +38 -0
- package/src/hooks/useStringInput.ts +38 -0
- package/src/hooks/useTerminologyServerQuery.ts +3 -6
- package/src/index.ts +45 -2
- package/src/interfaces/questionnaireStore.interface.ts +1 -0
- package/src/interfaces/renderProps.interface.ts +4 -0
- package/src/stores/useQuestionnaireResponseStore.ts +15 -10
- package/src/stores/useQuestionnaireStore.ts +10 -3
- package/src/theme/overrides/Overrides.ts +0 -2
- package/src/utils/calculatedExpression.ts +2 -2
- package/src/utils/formChanges.ts +141 -0
- package/src/utils/index.ts +18 -0
- package/src/utils/mapItem.ts +6 -4
- package/src/utils/qItem.ts +29 -0
- package/src/utils/qrItem.ts +108 -97
- package/src/utils/questionnaireStoreUtils/createQuestionaireModel.ts +4 -0
- package/src/utils/repopulateIntoResponse.ts +153 -0
- package/src/utils/repopulateItems.ts +206 -0
- package/src/utils/repopulateRepeatGroup.ts +68 -0
|
@@ -0,0 +1,29 @@
|
|
|
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 } from 'react';
|
|
18
|
+
function useRepeatItemUpdateFromProp(stateValue, propValue, setInputValue) {
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (stateValue !== propValue) {
|
|
21
|
+
setInputValue(propValue);
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
// Only trigger this effect if prop value changes
|
|
25
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
26
|
+
[propValue]);
|
|
27
|
+
}
|
|
28
|
+
export default useRepeatItemUpdateFromProp;
|
|
29
|
+
//# sourceMappingURL=useRepeatItemUpdateFromProp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRepeatItemUpdateFromProp.js","sourceRoot":"","sources":["../../src/hooks/useRepeatItemUpdateFromProp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,SAAS,2BAA2B,CAClC,UAAkB,EAClB,SAAiB,EACjB,aAAsC;IAEtC,SAAS,CACP,GAAG,EAAE;QACH,IAAI,UAAU,KAAK,SAAS,EAAE;YAC5B,aAAa,CAAC,SAAS,CAAC,CAAC;SAC1B;IACH,CAAC;IACD,iDAAiD;IACjD,uDAAuD;IACvD,CAAC,SAAS,CAAC,CACZ,CAAC;AACJ,CAAC;AAED,eAAe,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 } from 'react';
|
|
18
|
+
function useStringUpdateFromProp(stateValue, propValue, setInputValue) {
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (stateValue !== propValue) {
|
|
21
|
+
setInputValue(propValue);
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
// Only trigger this effect if prop value changes
|
|
25
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
26
|
+
[propValue]);
|
|
27
|
+
}
|
|
28
|
+
export default useStringUpdateFromProp;
|
|
29
|
+
//# sourceMappingURL=useStringField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStringField.js","sourceRoot":"","sources":["../../src/hooks/useStringField.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,SAAS,uBAAuB,CAC9B,UAAkB,EAClB,SAAiB,EACjB,aAAsC;IAEtC,SAAS,CACP,GAAG,EAAE;QACH,IAAI,UAAU,KAAK,SAAS,EAAE;YAC5B,aAAa,CAAC,SAAS,CAAC,CAAC;SAC1B;IACH,CAAC;IACD,iDAAiD;IACjD,uDAAuD;IACvD,CAAC,SAAS,CAAC,CACZ,CAAC;AACJ,CAAC;AAED,eAAe,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
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, useState } from 'react';
|
|
18
|
+
function useStringInput(valueFromProps) {
|
|
19
|
+
const [input, setInput] = useState(valueFromProps);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (input !== valueFromProps) {
|
|
22
|
+
setInput(valueFromProps);
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
// Only trigger this effect if prop value changes
|
|
26
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
27
|
+
[valueFromProps]);
|
|
28
|
+
return [input, setInput];
|
|
29
|
+
}
|
|
30
|
+
export default useStringInput;
|
|
31
|
+
//# sourceMappingURL=useStringInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStringInput.js","sourceRoot":"","sources":["../../src/hooks/useStringInput.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,SAAS,cAAc,CAAC,cAAsB;IAC5C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAC;IAEnD,SAAS,CACP,GAAG,EAAE;QACH,IAAI,KAAK,KAAK,cAAc,EAAE;YAC5B,QAAQ,CAAC,cAAc,CAAC,CAAC;SAC1B;IACH,CAAC;IACD,iDAAiD;IACjD,uDAAuD;IACvD,CAAC,cAAc,CAAC,CACjB,CAAC;IAEF,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC3B,CAAC;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 } from 'react';
|
|
18
|
+
function useStringUpdateFromProp(stateValue, propValue, setInputValue) {
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (stateValue !== propValue) {
|
|
21
|
+
setInputValue(propValue);
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
// Only trigger this effect if prop value changes
|
|
25
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
26
|
+
[propValue]);
|
|
27
|
+
}
|
|
28
|
+
export default useStringUpdateFromProp;
|
|
29
|
+
//# sourceMappingURL=useStringUpdateFromProp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStringUpdateFromProp.js","sourceRoot":"","sources":["../../src/hooks/useStringUpdateFromProp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,SAAS,uBAAuB,CAC9B,UAAkB,EAClB,SAAiB,EACjB,aAAsC;IAEtC,SAAS,CACP,GAAG,EAAE;QACH,IAAI,UAAU,KAAK,SAAS,EAAE;YAC5B,aAAa,CAAC,SAAS,CAAC,CAAC;SAC1B;IACH,CAAC;IACD,iDAAiD;IACjD,uDAAuD;IACvD,CAAC,SAAS,CAAC,CACZ,CAAC;AACJ,CAAC;AAED,eAAe,uBAAuB,CAAC"}
|
|
@@ -24,7 +24,6 @@ function useTerminologyServerQuery(qItem, maxList, input, searchTerm) {
|
|
|
24
24
|
const defaultTerminologyServerUrl = useTerminologyServerStore((state) => state.url);
|
|
25
25
|
let fullUrl = '';
|
|
26
26
|
let options = [];
|
|
27
|
-
let loading = false;
|
|
28
27
|
let feedback;
|
|
29
28
|
if (input.length === 0) {
|
|
30
29
|
feedback = undefined;
|
|
@@ -47,12 +46,10 @@ function useTerminologyServerQuery(qItem, maxList, input, searchTerm) {
|
|
|
47
46
|
}
|
|
48
47
|
// Perform query
|
|
49
48
|
const terminologyServerUrl = (_a = getTerminologyServerUrl(qItem)) !== null && _a !== void 0 ? _a : defaultTerminologyServerUrl;
|
|
50
|
-
const {
|
|
49
|
+
const { isFetching, error, data } = useQuery(['expandValueSet', fullUrl], () => getValueSetPromise(fullUrl, terminologyServerUrl), {
|
|
51
50
|
enabled: searchTerm.length >= 2 && answerValueSetUrl !== undefined
|
|
52
51
|
});
|
|
53
|
-
|
|
54
|
-
loading = true;
|
|
55
|
-
}
|
|
52
|
+
console.log(isFetching);
|
|
56
53
|
if (error) {
|
|
57
54
|
console.warn('Ontoserver query failed. Details below: \n' + error);
|
|
58
55
|
feedback = {
|
|
@@ -71,7 +68,7 @@ function useTerminologyServerQuery(qItem, maxList, input, searchTerm) {
|
|
|
71
68
|
};
|
|
72
69
|
}
|
|
73
70
|
}
|
|
74
|
-
return { options, loading, feedback };
|
|
71
|
+
return { options, loading: isFetching, feedback };
|
|
75
72
|
}
|
|
76
73
|
export default useTerminologyServerQuery;
|
|
77
74
|
//# sourceMappingURL=useTerminologyServerQuery.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTerminologyServerQuery.js","sourceRoot":"","sources":["../../src/hooks/useTerminologyServerQuery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAGpG,OAAO,qBAAqB,MAAM,iCAAiC,C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A4C,GAAG,KAAK,CAAC,CAAC;QACnE,QAAQ,GAAG;YACT,OAAO,EAAE,2EAA2E;YACpF,KAAK,EAAE,OAAO;SACf,CAAC;KACH;IAED,IAAI,IAAI,EAAE;QACR,IAAI,CAAA,MAAA,IAAI,CAAC,SAAS,0CAAE,KAAK,MAAK,CAAC,EAAE;YAC/B,OAAO,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;SACpC;aAAM;YACL,QAAQ,GAAG;gBACT,OAAO,EAAE,wEAAwE;gBACjF,KAAK,EAAE,SAAS;aACjB,CAAC;SACH;KACF;IAED,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;AACpD,CAAC;AACD,eAAe,yBAAyB,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { Questionnaire, QuestionnaireResponse } from 'fhir/r4';
|
|
2
|
+
import type { ItemToRepopulate } from './utils/repopulateItems';
|
|
2
3
|
export * from './components';
|
|
3
4
|
export * from './stores';
|
|
5
|
+
export * from './hooks';
|
|
6
|
+
export * from './utils';
|
|
7
|
+
export type { ItemToRepopulate };
|
|
4
8
|
/**
|
|
5
9
|
* Build the form with an initial Questionnaire and an optional filled QuestionnaireResponse.
|
|
6
10
|
* If a QuestionnaireResponse is not provided, an empty QuestionnaireResponse is set as the initial QuestionnaireResponse.
|
|
@@ -28,3 +32,15 @@ export declare function getResponse(): QuestionnaireResponse;
|
|
|
28
32
|
* @author Sean Fong
|
|
29
33
|
*/
|
|
30
34
|
export declare function removeHiddenAnswersFromResponse(questionnaire: Questionnaire, questionnaireResponse: QuestionnaireResponse): QuestionnaireResponse;
|
|
35
|
+
/**
|
|
36
|
+
* Re-populate stuff
|
|
37
|
+
*
|
|
38
|
+
* @author Sean Fong
|
|
39
|
+
*/
|
|
40
|
+
export declare function generateItemsToRepopulate(populatedResponse: QuestionnaireResponse): Record<string, ItemToRepopulate>;
|
|
41
|
+
/**
|
|
42
|
+
* Re-populate stuff
|
|
43
|
+
*
|
|
44
|
+
* @author Sean Fong
|
|
45
|
+
*/
|
|
46
|
+
export declare function repopulate(checkedItemsToRepopulate: Record<string, ItemToRepopulate>): QuestionnaireResponse;
|
package/lib/index.js
CHANGED
|
@@ -8,11 +8,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import useQuestionnaireStore from './stores/useQuestionnaireStore';
|
|
11
|
-
import {
|
|
11
|
+
import { createEmptyQuestionnaireResponse } from './utils/qrItem';
|
|
12
12
|
import useQuestionnaireResponseStore from './stores/useQuestionnaireResponseStore';
|
|
13
13
|
import { removeHiddenAnswers } from './utils/removeHidden';
|
|
14
|
+
import { getItemsToRepopulate } from './utils/repopulateItems';
|
|
15
|
+
import { repopulateItemsIntoResponse } from './utils/repopulateIntoResponse';
|
|
14
16
|
export * from './components';
|
|
15
17
|
export * from './stores';
|
|
18
|
+
export * from './hooks';
|
|
19
|
+
export * from './utils';
|
|
16
20
|
/**
|
|
17
21
|
* Build the form with an initial Questionnaire and an optional filled QuestionnaireResponse.
|
|
18
22
|
* If a QuestionnaireResponse is not provided, an empty QuestionnaireResponse is set as the initial QuestionnaireResponse.
|
|
@@ -25,7 +29,7 @@ export function buildForm(questionnaire, questionnaireResponse) {
|
|
|
25
29
|
if (!questionnaireResponse) {
|
|
26
30
|
useQuestionnaireResponseStore
|
|
27
31
|
.getState()
|
|
28
|
-
.buildSourceResponse(
|
|
32
|
+
.buildSourceResponse(createEmptyQuestionnaireResponse(questionnaire));
|
|
29
33
|
return;
|
|
30
34
|
}
|
|
31
35
|
useQuestionnaireResponseStore.getState().buildSourceResponse(questionnaireResponse);
|
|
@@ -68,4 +72,27 @@ export function removeHiddenAnswersFromResponse(questionnaire, questionnaireResp
|
|
|
68
72
|
enableWhenExpressions
|
|
69
73
|
});
|
|
70
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* Re-populate stuff
|
|
77
|
+
*
|
|
78
|
+
* @author Sean Fong
|
|
79
|
+
*/
|
|
80
|
+
export function generateItemsToRepopulate(populatedResponse) {
|
|
81
|
+
const sourceQuestionnaire = useQuestionnaireStore.getState().sourceQuestionnaire;
|
|
82
|
+
const itemTypes = useQuestionnaireStore.getState().itemTypes;
|
|
83
|
+
const tabs = useQuestionnaireStore.getState().tabs;
|
|
84
|
+
const updatableResponse = useQuestionnaireResponseStore.getState().updatableResponse;
|
|
85
|
+
console.log(updatableResponse);
|
|
86
|
+
return getItemsToRepopulate(sourceQuestionnaire, itemTypes, tabs, populatedResponse, updatableResponse);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Re-populate stuff
|
|
90
|
+
*
|
|
91
|
+
* @author Sean Fong
|
|
92
|
+
*/
|
|
93
|
+
export function repopulate(checkedItemsToRepopulate) {
|
|
94
|
+
const sourceQuestionnaire = useQuestionnaireStore.getState().sourceQuestionnaire;
|
|
95
|
+
const updatableResponse = useQuestionnaireResponseStore.getState().updatableResponse;
|
|
96
|
+
return repopulateItemsIntoResponse(sourceQuestionnaire, updatableResponse, checkedItemsToRepopulate);
|
|
97
|
+
}
|
|
71
98
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,qBAAqB,MAAM,gCAAgC,CAAC;AAEnE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,qBAAqB,MAAM,gCAAgC,CAAC;AAEnE,OAAO,EAAE,gCAAgC,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,6BAA6B,MAAM,wCAAwC,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAA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C;IAErF,OAAO,mBAAmB,CAAC;QACzB,aAAa;QACb,qBAAqB;QACrB,qBAAqB;QACrB,eAAe;QACf,qBAAqB;KACtB,CAAC,CAAC;AACL,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CAAC,iBAAwC;IAChF,MAAM,mBAAmB,GAAG,qBAAqB,CAAC,QAAQ,EAAE,CAAC,mBAAmB,CAAC;IACjF,MAAM,SAAS,GAAG,qBAAqB,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC;IAC7D,MAAM,IAAI,GAAG,qBAAqB,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC;IACnD,MAAM,iBAAiB,GAAG,6BAA6B,CAAC,QAAQ,EAAE,CAAC,iBAAiB,CAAC;IACrF,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAE/B,OAAO,oBAAoB,CACzB,mBAAmB,EACnB,SAAS,EACT,IAAI,EACJ,iBAAiB,EACjB,iBAAiB,CAClB,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,wBAA0D;IACnF,MAAM,mBAAmB,GAAG,qBAAqB,CAAC,QAAQ,EAAE,CAAC,mBAAmB,CAAC;IACjF,MAAM,iBAAiB,GAAG,6BAA6B,CAAC,QAAQ,EAAE,CAAC,iBAAiB,CAAC;IAErF,OAAO,2BAA2B,CAChC,mBAAmB,EACnB,iBAAiB,EACjB,wBAAwB,CACzB,CAAC;AACJ,CAAC"}
|
|
@@ -6,6 +6,7 @@ import type { CalculatedExpression } from './calculatedExpression.interface';
|
|
|
6
6
|
import type { AnswerExpression } from './answerExpression.interface';
|
|
7
7
|
import type { Coding } from 'fhir/r4';
|
|
8
8
|
export interface QuestionnaireModel {
|
|
9
|
+
itemTypes: Record<string, string>;
|
|
9
10
|
tabs: Tabs;
|
|
10
11
|
variables: Variables;
|
|
11
12
|
launchContexts: Record<string, LaunchContext>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { QuestionnaireResponse } from 'fhir/r4';
|
|
2
|
+
import type { Diff } from 'deep-diff';
|
|
2
3
|
export interface UseQuestionnaireResponseStoreType {
|
|
3
4
|
sourceResponse: QuestionnaireResponse;
|
|
4
5
|
updatableResponse: QuestionnaireResponse;
|
|
5
|
-
|
|
6
|
+
formChangesHistory: (Diff<QuestionnaireResponse, QuestionnaireResponse>[] | null)[];
|
|
6
7
|
buildSourceResponse: (response: QuestionnaireResponse) => void;
|
|
7
8
|
setUpdatableResponseAsPopulated: (populatedResponse: QuestionnaireResponse) => void;
|
|
8
9
|
updateResponse: (updatedResponse: QuestionnaireResponse) => void;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { create } from 'zustand';
|
|
2
2
|
import { emptyResponse } from '../utils/emptyResource';
|
|
3
3
|
import cloneDeep from 'lodash.clonedeep';
|
|
4
|
-
|
|
4
|
+
import { diff } from 'deep-diff';
|
|
5
|
+
const useQuestionnaireResponseStore = create()((set, get) => ({
|
|
5
6
|
sourceResponse: cloneDeep(emptyResponse),
|
|
6
7
|
updatableResponse: cloneDeep(emptyResponse),
|
|
7
|
-
|
|
8
|
+
formChangesHistory: [],
|
|
8
9
|
buildSourceResponse: (questionnaireResponse) => {
|
|
9
10
|
set(() => ({
|
|
10
11
|
sourceResponse: questionnaireResponse,
|
|
@@ -12,28 +13,34 @@ const useQuestionnaireResponseStore = create()((set) => ({
|
|
|
12
13
|
}));
|
|
13
14
|
},
|
|
14
15
|
setUpdatableResponseAsPopulated: (populatedResponse) => {
|
|
16
|
+
var _a;
|
|
17
|
+
const formChanges = (_a = diff(get().updatableResponse, populatedResponse)) !== null && _a !== void 0 ? _a : null;
|
|
15
18
|
set(() => ({
|
|
16
19
|
updatableResponse: populatedResponse,
|
|
17
|
-
|
|
20
|
+
formChangesHistory: [...get().formChangesHistory, formChanges]
|
|
21
|
+
}));
|
|
22
|
+
},
|
|
23
|
+
updateResponse: (updatedResponse) => {
|
|
24
|
+
var _a;
|
|
25
|
+
const formChanges = (_a = diff(get().updatableResponse, updatedResponse)) !== null && _a !== void 0 ? _a : null;
|
|
26
|
+
set(() => ({
|
|
27
|
+
updatableResponse: updatedResponse,
|
|
28
|
+
formChangesHistory: [...get().formChangesHistory, formChanges]
|
|
18
29
|
}));
|
|
19
30
|
},
|
|
20
|
-
updateResponse: (updatedResponse) => set(() => ({
|
|
21
|
-
updatableResponse: updatedResponse,
|
|
22
|
-
hasChanges: true
|
|
23
|
-
})),
|
|
24
31
|
setUpdatableResponseAsSaved: (savedResponse) => set(() => ({
|
|
25
32
|
sourceResponse: savedResponse,
|
|
26
33
|
updatableResponse: savedResponse,
|
|
27
|
-
|
|
34
|
+
formChangesHistory: []
|
|
28
35
|
})),
|
|
29
36
|
setUpdatableResponseAsEmpty: (clearedResponse) => set(() => ({
|
|
30
37
|
updatableResponse: clearedResponse,
|
|
31
|
-
|
|
38
|
+
formChangesHistory: []
|
|
32
39
|
})),
|
|
33
40
|
destroySourceResponse: () => set(() => ({
|
|
34
41
|
sourceResponse: cloneDeep(emptyResponse),
|
|
35
42
|
updatableResponse: cloneDeep(emptyResponse),
|
|
36
|
-
|
|
43
|
+
formChangesHistory: []
|
|
37
44
|
}))
|
|
38
45
|
}));
|
|
39
46
|
export default useQuestionnaireResponseStore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useQuestionnaireResponseStore.js","sourceRoot":"","sources":["../../src/stores/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;
|
|
1
|
+
{"version":3,"file":"useQuestionnaireResponseStore.js","sourceRoot":"","sources":["../../src/stores/useQuestionnaireResponseStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,OAAO,EAAE,aAAa,E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AC,GAAG,EAAE,CAAC,CAAC;QACT,cAAc,EAAE,aAAa;QAC7B,iBAAiB,EAAE,aAAa;QAChC,kBAAkB,EAAE,EAAE;KACvB,CAAC,CAAC;IACL,2BAA2B,EAAE,CAAC,eAAsC,EAAE,EAAE,CACtE,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;QACT,iBAAiB,EAAE,eAAe;QAClC,kBAAkB,EAAE,EAAE;KACvB,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,kBAAkB,EAAE,EAAE;KACvB,CAAC,CAAC;CACN,CAAC,CAAC,CAAC;AAEJ,eAAe,6BAA6B,CAAC"}
|
|
@@ -7,6 +7,7 @@ import type { AnswerExpression } from '../interfaces/answerExpression.interface'
|
|
|
7
7
|
import type { Tabs } from '../interfaces/tab.interface';
|
|
8
8
|
export interface UseQuestionnaireStoreType {
|
|
9
9
|
sourceQuestionnaire: Questionnaire;
|
|
10
|
+
itemTypes: Record<string, string>;
|
|
10
11
|
tabs: Tabs;
|
|
11
12
|
currentTabIndex: number;
|
|
12
13
|
variables: Variables;
|
|
@@ -28,7 +29,7 @@ export interface UseQuestionnaireStoreType {
|
|
|
28
29
|
toggleEnableWhenActivation: (isActivated: boolean) => void;
|
|
29
30
|
updateExpressions: (updatedResponse: QuestionnaireResponse) => void;
|
|
30
31
|
addCodingToCache: (valueSetUrl: string, codings: Coding[]) => void;
|
|
31
|
-
updatePopulatedProperties: (populatedResponse: QuestionnaireResponse) => QuestionnaireResponse;
|
|
32
|
+
updatePopulatedProperties: (populatedResponse: QuestionnaireResponse, persistTabIndex?: boolean) => QuestionnaireResponse;
|
|
32
33
|
}
|
|
33
34
|
declare const useQuestionnaireStore: import("zustand").UseBoundStore<import("zustand").StoreApi<UseQuestionnaireStoreType>>;
|
|
34
35
|
export default useQuestionnaireStore;
|
|
@@ -34,6 +34,7 @@ import cloneDeep from 'lodash.clonedeep';
|
|
|
34
34
|
import useTerminologyServerStore from './useTerminologyServerStore';
|
|
35
35
|
const useQuestionnaireStore = create()((set, get) => ({
|
|
36
36
|
sourceQuestionnaire: cloneDeep(emptyQuestionnaire),
|
|
37
|
+
itemTypes: {},
|
|
37
38
|
tabs: {},
|
|
38
39
|
currentTabIndex: 0,
|
|
39
40
|
variables: { fhirPathVariables: {}, xFhirQueryVariables: {} },
|
|
@@ -59,6 +60,7 @@ const useQuestionnaireStore = create()((set, get) => ({
|
|
|
59
60
|
});
|
|
60
61
|
set({
|
|
61
62
|
sourceQuestionnaire: questionnaire,
|
|
63
|
+
itemTypes: questionnaireModel.itemTypes,
|
|
62
64
|
tabs: questionnaireModel.tabs,
|
|
63
65
|
currentTabIndex: firstVisibleTab,
|
|
64
66
|
variables: questionnaireModel.variables,
|
|
@@ -74,6 +76,7 @@ const useQuestionnaireStore = create()((set, get) => ({
|
|
|
74
76
|
}),
|
|
75
77
|
destroySourceQuestionnaire: () => set({
|
|
76
78
|
sourceQuestionnaire: cloneDeep(emptyQuestionnaire),
|
|
79
|
+
itemTypes: {},
|
|
77
80
|
tabs: {},
|
|
78
81
|
currentTabIndex: 0,
|
|
79
82
|
variables: { fhirPathVariables: {}, xFhirQueryVariables: {} },
|
|
@@ -123,7 +126,7 @@ const useQuestionnaireStore = create()((set, get) => ({
|
|
|
123
126
|
addCodingToCache: (valueSetUrl, codings) => set(() => ({
|
|
124
127
|
cachedValueSetCodings: Object.assign(Object.assign({}, get().cachedValueSetCodings), { [valueSetUrl]: codings })
|
|
125
128
|
})),
|
|
126
|
-
updatePopulatedProperties: (populatedResponse) => {
|
|
129
|
+
updatePopulatedProperties: (populatedResponse, persistTabIndex) => {
|
|
127
130
|
const initialCalculatedExpressions = evaluateInitialCalculatedExpressions({
|
|
128
131
|
initialResponse: populatedResponse,
|
|
129
132
|
calculatedExpressions: get().calculatedExpressions,
|
|
@@ -143,7 +146,7 @@ const useQuestionnaireStore = create()((set, get) => ({
|
|
|
143
146
|
enableWhenLinkedQuestions: initialEnableWhenLinkedQuestions,
|
|
144
147
|
enableWhenExpressions: initialEnableWhenExpressions,
|
|
145
148
|
calculatedExpressions: initialCalculatedExpressions,
|
|
146
|
-
currentTabIndex: firstVisibleTab
|
|
149
|
+
currentTabIndex: persistTabIndex ? get().currentTabIndex : firstVisibleTab
|
|
147
150
|
}));
|
|
148
151
|
return updatedResponse;
|
|
149
152
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useQuestionnaireStore.js","sourceRoot":"","sources":["../../src/stores/useQuestionnaireStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAajC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EACL,oCAAoC,EACpC,oCAAoC,EACrC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,0DAA0D,CAAC;AACpG,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,yBAAyB,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"useQuestionnaireStore.js","sourceRoot":"","sources":["../../src/stores/useQuestionnaireStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAajC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,0BA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AAiB;YACpD,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI;SACjB,CAAC,CAAC;QAEH,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;YACT,eAAe,EAAE,sBAAsB;YACvC,yBAAyB,EAAE,gCAAgC;YAC3D,qBAAqB,EAAE,4BAA4B;YACnD,qBAAqB,EAAE,4BAA4B;YACnD,eAAe,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC,eAAe;SAC3E,CAAC,CAAC,CAAC;QAEJ,OAAO,eAAe,CAAC;IACzB,CAAC;CACF,CAAC,CAAC,CAAC;AAEJ,eAAe,qBAAqB,CAAC"}
|
|
@@ -19,12 +19,11 @@ import Paper from './Paper';
|
|
|
19
19
|
import Input from './Input';
|
|
20
20
|
import Table from './Table';
|
|
21
21
|
import Button from './Button';
|
|
22
|
-
import Backdrop from './Backdrop';
|
|
23
22
|
import Autocomplete from './Autocomplete';
|
|
24
23
|
import Accordion from './Accordion';
|
|
25
24
|
import SpeedDial from './SpeedDial';
|
|
26
25
|
function ComponentsOverrides(theme) {
|
|
27
|
-
return Object.assign(Accordion(theme), Card(theme), Table(theme), Input(theme), Paper(), Button(theme),
|
|
26
|
+
return Object.assign(Accordion(theme), Card(theme), Table(theme), Input(theme), Paper(), Button(theme), Autocomplete(theme), SpeedDial(theme));
|
|
28
27
|
}
|
|
29
28
|
export default ComponentsOverrides;
|
|
30
29
|
//# sourceMappingURL=Overrides.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Overrides.js","sourceRoot":"","sources":["../../../src/theme/overrides/Overrides.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,
|
|
1
|
+
{"version":3,"file":"Overrides.js","sourceRoot":"","sources":["../../../src/theme/overrides/Overrides.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,SAAS,MAAM,aAAa,CAAC;AAGpC,SAAS,mBAAmB,CAAC,KAAY;IACvC,OAAO,MAAM,CAAC,MAAM,CAClB,SAAS,CAAC,KAAK,CAAC,EAChB,IAAI,CAAC,KAAK,CAAC,EACX,KAAK,CAAC,KAAK,CAAC,EACZ,KAAK,CAAC,KAAK,CAAC,EACZ,KAAK,EAAE,EACP,MAAM,CAAC,KAAK,CAAC,EACb,YAAY,CAAC,KAAK,CAAC,EACnB,SAAS,CAAC,KAAK,CAAC,CACjB,CAAC;AACJ,CAAC;AAED,eAAe,mBAAmB,CAAC"}
|
|
@@ -20,7 +20,7 @@ import _isEqual from 'lodash/isEqual';
|
|
|
20
20
|
import { emptyResponse } from './emptyResource';
|
|
21
21
|
import { createFhirPathContext } from './fhirpath';
|
|
22
22
|
import { getQrItemsIndex, mapQItemsIndex } from './mapItem';
|
|
23
|
-
import {
|
|
23
|
+
import { updateQrItemsInGroup } from './qrItem';
|
|
24
24
|
import cloneDeep from 'lodash.clonedeep';
|
|
25
25
|
export function evaluateInitialCalculatedExpressions(params) {
|
|
26
26
|
const { initialResponse, calculatedExpressions, variablesFhirPath } = params;
|
|
@@ -124,7 +124,7 @@ function initialiseItemCalculatedExpressionValueRecursive(qItem, qrItem, calcula
|
|
|
124
124
|
continue;
|
|
125
125
|
}
|
|
126
126
|
if (newQrItem) {
|
|
127
|
-
|
|
127
|
+
updateQrItemsInGroup(newQrItem, null, qrItem !== null && qrItem !== void 0 ? qrItem : { linkId: qItem.linkId, text: qItem.text, item: [] }, indexMap);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
return constructGroupItem(qItem, qrItem, calculatedExpressions);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calculatedExpression.js","sourceRoot":"","sources":["../../src/utils/calculatedExpression.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,iBAAiB,MAAM,0BAA0B,CAAC;AASzD,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"calculatedExpression.js","sourceRoot":"","sources":["../../src/utils/calculatedExpression.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,iBAAiB,MAAM,0BAA0B,CAAC;AASzD,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,SAAS,MAAM,kBAAkB,CAAC;AAQzC,MAAM,UAAU,oCAAoC,CAClD,MAAkD;IAElD,MAAM,EAAE,eAAe,EAAE,qBAAqB,EAAE,iBAA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AAE,WAAW,EAAE,KAAK,EAAE,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { QuestionnaireResponseItemAnswer } from 'fhir/r4';
|
|
2
|
+
type JsonDiffOperator = '+' | '-' | '~' | ' ';
|
|
3
|
+
type QuestionnaireResponseItemDiffArray = [JsonDiffOperator, QuestionnaireResponseDiffItem];
|
|
4
|
+
type QuestionnaireResponseItemAnswerDiffArray = [JsonDiffOperator, QuestionnaireResponseItemAnswer];
|
|
5
|
+
interface QuestionnaireResponseDiffItem {
|
|
6
|
+
linkId: string;
|
|
7
|
+
item: QuestionnaireResponseItemDiffArray[] | undefined;
|
|
8
|
+
answer: QuestionnaireResponseItemAnswer[] | QuestionnaireResponseItemAnswerDiffArray[] | undefined;
|
|
9
|
+
}
|
|
10
|
+
interface ItemChange {
|
|
11
|
+
linkId: string;
|
|
12
|
+
itemType: string;
|
|
13
|
+
operation: 'add' | 'remove' | 'update';
|
|
14
|
+
value: QuestionnaireResponseItemAnswer;
|
|
15
|
+
}
|
|
16
|
+
export declare function readFormChanges(formChanges: object, itemTypes: Record<string, string>): Record<string, ItemChange | null>;
|
|
17
|
+
export declare function readItemChangesRecursive(diffArray: QuestionnaireResponseItemDiffArray, itemTypes: Record<string, string>, changedItems: Record<string, ItemChange | null>): Record<string, ItemChange | null>;
|
|
18
|
+
export {};
|