@ovok/native 1.10.2 → 1.10.4
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 +5 -5
- package/lib/commonjs/modules/auth/default-translation.js +22 -0
- package/lib/commonjs/modules/auth/default-translation.js.map +1 -1
- package/lib/commonjs/modules/auth/hooks/use-session.js +3 -0
- package/lib/commonjs/modules/auth/hooks/use-session.js.map +1 -1
- package/lib/commonjs/modules/auth/profile/components/profile-form-provider.js +3 -6
- package/lib/commonjs/modules/auth/profile/components/profile-form-provider.js.map +1 -1
- package/lib/commonjs/modules/auth/register/components/form/register-form-provider.js +1 -0
- package/lib/commonjs/modules/auth/register/components/form/register-form-provider.js.map +1 -1
- package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-form-provider.js +4 -3
- package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-form-provider.js.map +1 -1
- package/lib/commonjs/modules/auth/session/logout-session.js +5 -2
- package/lib/commonjs/modules/auth/session/logout-session.js.map +1 -1
- package/lib/commonjs/modules/auth/session/session-store-refresh.js +125 -0
- package/lib/commonjs/modules/auth/session/session-store-refresh.js.map +1 -0
- package/lib/commonjs/modules/auth/session/session-store-request-state.js +73 -0
- package/lib/commonjs/modules/auth/session/session-store-request-state.js.map +1 -0
- package/lib/commonjs/modules/auth/session/session-store-types.js +17 -0
- package/lib/commonjs/modules/auth/session/session-store-types.js.map +1 -0
- package/lib/commonjs/modules/auth/session/session-store.js +56 -123
- package/lib/commonjs/modules/auth/session/session-store.js.map +1 -1
- package/lib/commonjs/modules/auth/utils/sign-in-error.js +10 -4
- package/lib/commonjs/modules/auth/utils/sign-in-error.js.map +1 -1
- package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js +5 -0
- package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
- package/lib/commonjs/modules/bt-management/hooks/declined-device-storage.js +36 -1
- package/lib/commonjs/modules/bt-management/hooks/declined-device-storage.js.map +1 -1
- package/lib/commonjs/modules/bt-management/hooks/nearby-device-offer-state.js +25 -0
- package/lib/commonjs/modules/bt-management/hooks/nearby-device-offer-state.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/nearby-device-offer-types.js +6 -0
- package/lib/commonjs/modules/bt-management/hooks/nearby-device-offer-types.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/use-nearby-device-offer.js +22 -36
- package/lib/commonjs/modules/bt-management/hooks/use-nearby-device-offer.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/background-sync/background-sync-coordinator.js +11 -0
- package/lib/commonjs/modules/bt-management/services/background-sync/background-sync-coordinator.js.map +1 -1
- package/lib/commonjs/modules/data-sync/components/apple/apple-health-authorization-provider.js.map +1 -1
- package/lib/commonjs/modules/data-sync/hooks/use-listen-changes.js.map +1 -1
- package/lib/commonjs/modules/data-sync/services/apple-health-sync-service.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/convert-generic-health-data.js +74 -34
- package/lib/commonjs/modules/data-sync/utils/convert-generic-health-data.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/convert-records-to-observation.js +19 -16
- package/lib/commonjs/modules/data-sync/utils/convert-records-to-observation.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/convert-samples-to-observation.js +17 -4
- package/lib/commonjs/modules/data-sync/utils/convert-samples-to-observation.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/get-samples-from-health.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/get-total-samples-count.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/health-data-catalog.js +219 -16
- package/lib/commonjs/modules/data-sync/utils/health-data-catalog.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/health-record-timing.js +52 -0
- package/lib/commonjs/modules/data-sync/utils/health-record-timing.js.map +1 -0
- package/lib/commonjs/modules/data-sync/utils/health-units.js +1 -0
- package/lib/commonjs/modules/data-sync/utils/health-units.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/healthkit-data-types.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/normalize-core-health-observation.js +74 -0
- package/lib/commonjs/modules/data-sync/utils/normalize-core-health-observation.js.map +1 -0
- package/lib/commonjs/modules/picker-sheet/components/value-wheel-picker.js +41 -0
- package/lib/commonjs/modules/picker-sheet/components/value-wheel-picker.js.map +1 -0
- package/lib/commonjs/modules/picker-sheet/components/wheel-picker.js +56 -15
- package/lib/commonjs/modules/picker-sheet/components/wheel-picker.js.map +1 -1
- package/lib/commonjs/modules/picker-sheet/index.js +11 -0
- package/lib/commonjs/modules/picker-sheet/index.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/README.md +59 -20
- package/lib/commonjs/modules/questionnaire-response-form/components/content/questionnaire-content-item.js +8 -0
- package/lib/commonjs/modules/questionnaire-response-form/components/content/questionnaire-content-item.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/content/questionnaire-content-specific-item.js +8 -0
- package/lib/commonjs/modules/questionnaire-response-form/components/content/questionnaire-content-specific-item.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/fields/common/questionnaire-field-wrapper.js +8 -3
- package/lib/commonjs/modules/questionnaire-response-form/components/fields/common/questionnaire-field-wrapper.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/fields/questionnaire-choice-field.js +9 -3
- package/lib/commonjs/modules/questionnaire-response-form/components/fields/questionnaire-choice-field.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/fields/questionnaire-date-field.js +18 -8
- package/lib/commonjs/modules/questionnaire-response-form/components/fields/questionnaire-date-field.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/fields/questionnaire-item-renderer.js +41 -2
- package/lib/commonjs/modules/questionnaire-response-form/components/fields/questionnaire-item-renderer.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/fields/questionnaire-text-field.js +43 -5
- package/lib/commonjs/modules/questionnaire-response-form/components/fields/questionnaire-text-field.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/header/questionnaire-header-title.js +3 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/header/questionnaire-header-title.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-form-provider.js +37 -11
- package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-form-provider.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-form.js +1 -0
- package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-form.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js +9 -3
- package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/hooks/use-initial-selected-values.js +5 -3
- package/lib/commonjs/modules/questionnaire-response-form/hooks/use-initial-selected-values.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/hooks/use-navigation-handlers.js +15 -4
- package/lib/commonjs/modules/questionnaire-response-form/hooks/use-navigation-handlers.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/hooks/use-questionnaire-navigation-state.js +14 -7
- package/lib/commonjs/modules/questionnaire-response-form/hooks/use-questionnaire-navigation-state.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/index.js +20 -0
- package/lib/commonjs/modules/questionnaire-response-form/index.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/types/questionnaire-form-values.js +4 -0
- package/lib/commonjs/modules/questionnaire-response-form/types/questionnaire-item-render-props.js +6 -0
- package/lib/commonjs/modules/questionnaire-response-form/types/questionnaire-item-render-props.js.map +1 -0
- package/lib/commonjs/modules/questionnaire-response-form/types/response-values.js +4 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/condition-utils.js +37 -6
- package/lib/commonjs/modules/questionnaire-response-form/utils/condition-utils.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/utils/conditions/fhir-condition.js +148 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/conditions/fhir-condition.js.map +1 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/create-answer-from-value.js +127 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/create-answer-from-value.js.map +1 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/fields/get-option-text.js +4 -3
- package/lib/commonjs/modules/questionnaire-response-form/utils/fields/get-option-text.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/utils/form-utils.js +71 -64
- package/lib/commonjs/modules/questionnaire-response-form/utils/form-utils.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/utils/form-validation.js +23 -5
- package/lib/commonjs/modules/questionnaire-response-form/utils/form-validation.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/utils/is-answerable-questionnaire-item.js +10 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/is-answerable-questionnaire-item.js.map +1 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/is-valid-questionnaire-answer.js +83 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/is-valid-questionnaire-answer.js.map +1 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-date-utils.js +54 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-date-utils.js.map +1 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-item-constraints.js +75 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-item-constraints.js.map +1 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-item-value-constraint-validators.js +63 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-item-value-constraint-validators.js.map +1 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-navigation-utils.js +49 -18
- package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-navigation-utils.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-picker-options.js +117 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-picker-options.js.map +1 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-string-constraint-validator.js +109 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-string-constraint-validator.js.map +1 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-submit-utils.js +2 -2
- package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-submit-utils.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/utils/translate-fhir-text.js +36 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/translate-fhir-text.js.map +1 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/validate-questionnaire-item-value.js +49 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/validate-questionnaire-item-value.js.map +1 -0
- package/lib/commonjs/modules/ui/components/bluetooth-state-notice.js +31 -15
- package/lib/commonjs/modules/ui/components/bluetooth-state-notice.js.map +1 -1
- package/lib/commonjs/modules/ui/components/prerequisite-gate.js +73 -0
- package/lib/commonjs/modules/ui/components/prerequisite-gate.js.map +1 -0
- package/lib/commonjs/modules/ui/default-translation.js +50 -0
- package/lib/commonjs/modules/ui/default-translation.js.map +1 -0
- package/lib/commonjs/modules/ui/index.js +11 -0
- package/lib/commonjs/modules/ui/index.js.map +1 -1
- package/lib/commonjs/polyfills/index.js +9 -7
- package/lib/commonjs/polyfills/index.js.map +1 -1
- package/lib/module/modules/auth/default-translation.js +22 -0
- package/lib/module/modules/auth/default-translation.js.map +1 -1
- package/lib/module/modules/auth/hooks/use-session.js +3 -0
- package/lib/module/modules/auth/hooks/use-session.js.map +1 -1
- package/lib/module/modules/auth/profile/components/profile-form-provider.js +3 -6
- package/lib/module/modules/auth/profile/components/profile-form-provider.js.map +1 -1
- package/lib/module/modules/auth/register/components/form/register-form-provider.js +1 -0
- package/lib/module/modules/auth/register/components/form/register-form-provider.js.map +1 -1
- package/lib/module/modules/auth/reset-password/components/form/reset-password-form-provider.js +3 -3
- package/lib/module/modules/auth/reset-password/components/form/reset-password-form-provider.js.map +1 -1
- package/lib/module/modules/auth/session/logout-session.js +5 -2
- package/lib/module/modules/auth/session/logout-session.js.map +1 -1
- package/lib/module/modules/auth/session/session-store-refresh.js +121 -0
- package/lib/module/modules/auth/session/session-store-refresh.js.map +1 -0
- package/lib/module/modules/auth/session/session-store-request-state.js +69 -0
- package/lib/module/modules/auth/session/session-store-request-state.js.map +1 -0
- package/lib/module/modules/auth/session/session-store-types.js +13 -0
- package/lib/module/modules/auth/session/session-store-types.js.map +1 -0
- package/lib/module/modules/auth/session/session-store.js +56 -123
- package/lib/module/modules/auth/session/session-store.js.map +1 -1
- package/lib/module/modules/auth/utils/sign-in-error.js +9 -4
- package/lib/module/modules/auth/utils/sign-in-error.js.map +1 -1
- package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js +5 -0
- package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
- package/lib/module/modules/bt-management/hooks/declined-device-storage.js +33 -1
- package/lib/module/modules/bt-management/hooks/declined-device-storage.js.map +1 -1
- package/lib/module/modules/bt-management/hooks/nearby-device-offer-state.js +20 -0
- package/lib/module/modules/bt-management/hooks/nearby-device-offer-state.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/nearby-device-offer-types.js +4 -0
- package/lib/module/modules/bt-management/hooks/nearby-device-offer-types.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/use-nearby-device-offer.js +21 -35
- package/lib/module/modules/bt-management/hooks/use-nearby-device-offer.js.map +1 -1
- package/lib/module/modules/bt-management/services/background-sync/background-sync-coordinator.js +11 -0
- package/lib/module/modules/bt-management/services/background-sync/background-sync-coordinator.js.map +1 -1
- package/lib/module/modules/data-sync/components/apple/apple-health-authorization-provider.js.map +1 -1
- package/lib/module/modules/data-sync/hooks/use-listen-changes.js.map +1 -1
- package/lib/module/modules/data-sync/services/apple-health-sync-service.js.map +1 -1
- package/lib/module/modules/data-sync/utils/convert-generic-health-data.js +74 -34
- package/lib/module/modules/data-sync/utils/convert-generic-health-data.js.map +1 -1
- package/lib/module/modules/data-sync/utils/convert-records-to-observation.js +19 -16
- package/lib/module/modules/data-sync/utils/convert-records-to-observation.js.map +1 -1
- package/lib/module/modules/data-sync/utils/convert-samples-to-observation.js +17 -4
- package/lib/module/modules/data-sync/utils/convert-samples-to-observation.js.map +1 -1
- package/lib/module/modules/data-sync/utils/get-samples-from-health.js.map +1 -1
- package/lib/module/modules/data-sync/utils/get-total-samples-count.js.map +1 -1
- package/lib/module/modules/data-sync/utils/health-data-catalog.js +219 -16
- package/lib/module/modules/data-sync/utils/health-data-catalog.js.map +1 -1
- package/lib/module/modules/data-sync/utils/health-record-timing.js +47 -0
- package/lib/module/modules/data-sync/utils/health-record-timing.js.map +1 -0
- package/lib/module/modules/data-sync/utils/health-units.js +1 -0
- package/lib/module/modules/data-sync/utils/health-units.js.map +1 -1
- package/lib/module/modules/data-sync/utils/healthkit-data-types.js.map +1 -1
- package/lib/module/modules/data-sync/utils/normalize-core-health-observation.js +69 -0
- package/lib/module/modules/data-sync/utils/normalize-core-health-observation.js.map +1 -0
- package/lib/module/modules/picker-sheet/components/value-wheel-picker.js +36 -0
- package/lib/module/modules/picker-sheet/components/value-wheel-picker.js.map +1 -0
- package/lib/module/modules/picker-sheet/components/wheel-picker.js +56 -15
- package/lib/module/modules/picker-sheet/components/wheel-picker.js.map +1 -1
- package/lib/module/modules/picker-sheet/index.js +1 -0
- package/lib/module/modules/picker-sheet/index.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/README.md +59 -20
- package/lib/module/modules/questionnaire-response-form/components/content/questionnaire-content-item.js +8 -0
- package/lib/module/modules/questionnaire-response-form/components/content/questionnaire-content-item.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/content/questionnaire-content-specific-item.js +8 -0
- package/lib/module/modules/questionnaire-response-form/components/content/questionnaire-content-specific-item.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/fields/common/questionnaire-field-wrapper.js +8 -3
- package/lib/module/modules/questionnaire-response-form/components/fields/common/questionnaire-field-wrapper.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/fields/questionnaire-choice-field.js +9 -3
- package/lib/module/modules/questionnaire-response-form/components/fields/questionnaire-choice-field.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/fields/questionnaire-date-field.js +18 -8
- package/lib/module/modules/questionnaire-response-form/components/fields/questionnaire-date-field.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/fields/questionnaire-item-renderer.js +42 -3
- package/lib/module/modules/questionnaire-response-form/components/fields/questionnaire-item-renderer.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/fields/questionnaire-text-field.js +41 -3
- package/lib/module/modules/questionnaire-response-form/components/fields/questionnaire-text-field.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/header/questionnaire-header-title.js +3 -1
- package/lib/module/modules/questionnaire-response-form/components/header/questionnaire-header-title.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/questionnaire-form-provider.js +37 -11
- package/lib/module/modules/questionnaire-response-form/components/questionnaire-form-provider.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/questionnaire-form.js +1 -0
- package/lib/module/modules/questionnaire-response-form/components/questionnaire-form.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js +9 -3
- package/lib/module/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/hooks/use-initial-selected-values.js +5 -3
- package/lib/module/modules/questionnaire-response-form/hooks/use-initial-selected-values.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/hooks/use-navigation-handlers.js +15 -4
- package/lib/module/modules/questionnaire-response-form/hooks/use-navigation-handlers.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/hooks/use-questionnaire-navigation-state.js +14 -7
- package/lib/module/modules/questionnaire-response-form/hooks/use-questionnaire-navigation-state.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/index.js +2 -0
- package/lib/module/modules/questionnaire-response-form/index.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/types/questionnaire-form-values.js +2 -0
- package/lib/module/modules/questionnaire-response-form/types/questionnaire-item-render-props.js +4 -0
- package/lib/module/modules/questionnaire-response-form/types/questionnaire-item-render-props.js.map +1 -0
- package/lib/module/modules/questionnaire-response-form/types/response-values.js +2 -0
- package/lib/module/modules/questionnaire-response-form/utils/condition-utils.js +37 -6
- package/lib/module/modules/questionnaire-response-form/utils/condition-utils.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/utils/conditions/fhir-condition.js +140 -0
- package/lib/module/modules/questionnaire-response-form/utils/conditions/fhir-condition.js.map +1 -0
- package/lib/module/modules/questionnaire-response-form/utils/create-answer-from-value.js +122 -0
- package/lib/module/modules/questionnaire-response-form/utils/create-answer-from-value.js.map +1 -0
- package/lib/module/modules/questionnaire-response-form/utils/fields/get-option-text.js +4 -3
- package/lib/module/modules/questionnaire-response-form/utils/fields/get-option-text.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/utils/form-utils.js +71 -64
- package/lib/module/modules/questionnaire-response-form/utils/form-utils.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/utils/form-validation.js +23 -5
- package/lib/module/modules/questionnaire-response-form/utils/form-validation.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/utils/is-answerable-questionnaire-item.js +5 -0
- package/lib/module/modules/questionnaire-response-form/utils/is-answerable-questionnaire-item.js.map +1 -0
- package/lib/module/modules/questionnaire-response-form/utils/is-valid-questionnaire-answer.js +77 -0
- package/lib/module/modules/questionnaire-response-form/utils/is-valid-questionnaire-answer.js.map +1 -0
- package/lib/module/modules/questionnaire-response-form/utils/questionnaire-date-utils.js +49 -0
- package/lib/module/modules/questionnaire-response-form/utils/questionnaire-date-utils.js.map +1 -0
- package/lib/module/modules/questionnaire-response-form/utils/questionnaire-item-constraints.js +71 -0
- package/lib/module/modules/questionnaire-response-form/utils/questionnaire-item-constraints.js.map +1 -0
- package/lib/module/modules/questionnaire-response-form/utils/questionnaire-item-value-constraint-validators.js +57 -0
- package/lib/module/modules/questionnaire-response-form/utils/questionnaire-item-value-constraint-validators.js.map +1 -0
- package/lib/module/modules/questionnaire-response-form/utils/questionnaire-navigation-utils.js +49 -18
- package/lib/module/modules/questionnaire-response-form/utils/questionnaire-navigation-utils.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/utils/questionnaire-picker-options.js +112 -0
- package/lib/module/modules/questionnaire-response-form/utils/questionnaire-picker-options.js.map +1 -0
- package/lib/module/modules/questionnaire-response-form/utils/questionnaire-string-constraint-validator.js +105 -0
- package/lib/module/modules/questionnaire-response-form/utils/questionnaire-string-constraint-validator.js.map +1 -0
- package/lib/module/modules/questionnaire-response-form/utils/questionnaire-submit-utils.js +2 -2
- package/lib/module/modules/questionnaire-response-form/utils/questionnaire-submit-utils.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/utils/translate-fhir-text.js +31 -0
- package/lib/module/modules/questionnaire-response-form/utils/translate-fhir-text.js.map +1 -0
- package/lib/module/modules/questionnaire-response-form/utils/validate-questionnaire-item-value.js +44 -0
- package/lib/module/modules/questionnaire-response-form/utils/validate-questionnaire-item-value.js.map +1 -0
- package/lib/module/modules/ui/components/bluetooth-state-notice.js +31 -15
- package/lib/module/modules/ui/components/bluetooth-state-notice.js.map +1 -1
- package/lib/module/modules/ui/components/prerequisite-gate.js +67 -0
- package/lib/module/modules/ui/components/prerequisite-gate.js.map +1 -0
- package/lib/module/modules/ui/default-translation.js +45 -0
- package/lib/module/modules/ui/default-translation.js.map +1 -0
- package/lib/module/modules/ui/index.js +1 -0
- package/lib/module/modules/ui/index.js.map +1 -1
- package/lib/module/polyfills/index.js +11 -1
- package/lib/module/polyfills/index.js.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/default-translation.d.ts +22 -0
- package/lib/typescript/commonjs/src/modules/auth/default-translation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/hooks/use-session.d.ts +4 -1
- package/lib/typescript/commonjs/src/modules/auth/hooks/use-session.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/profile/components/profile-form-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/register/components/form/register-form-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/reset-password/components/form/reset-password-form-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/session/logout-session.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/session/session-store-refresh.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/auth/session/session-store-refresh.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/session/session-store-request-state.d.ts +23 -0
- package/lib/typescript/commonjs/src/modules/auth/session/session-store-request-state.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/session/session-store-types.d.ts +33 -0
- package/lib/typescript/commonjs/src/modules/auth/session/session-store-types.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/session/session-store.d.ts +1 -18
- package/lib/typescript/commonjs/src/modules/auth/session/session-store.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/utils/sign-in-error.d.ts +4 -2
- package/lib/typescript/commonjs/src/modules/auth/utils/sign-in-error.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/declined-device-storage.d.ts +10 -1
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/declined-device-storage.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/nearby-device-offer-state.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/nearby-device-offer-state.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/nearby-device-offer-types.d.ts +15 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/nearby-device-offer-types.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-nearby-device-offer.d.ts +6 -14
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-nearby-device-offer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/background-sync/background-sync-coordinator.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/background-sync.d.ts +7 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/background-sync.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/components/apple/apple-health-authorization-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/hooks/use-listen-changes.d.ts +2 -3
- package/lib/typescript/commonjs/src/modules/data-sync/hooks/use-listen-changes.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/services/apple-health-sync-service.d.ts +4 -5
- package/lib/typescript/commonjs/src/modules/data-sync/services/apple-health-sync-service.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/apple-health-authorization-provider-props.d.ts +4 -2
- package/lib/typescript/commonjs/src/modules/data-sync/types/apple-health-authorization-provider-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/apple-health-sync-props.d.ts +7 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/apple-health-sync-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/health-authorization-status.d.ts +2 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/health-authorization-status.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/convert-generic-health-data.d.ts +3 -2
- package/lib/typescript/commonjs/src/modules/data-sync/utils/convert-generic-health-data.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/convert-records-to-observation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/convert-samples-to-observation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/get-samples-from-health.d.ts +5 -4
- package/lib/typescript/commonjs/src/modules/data-sync/utils/get-samples-from-health.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/get-total-samples-count.d.ts +2 -2
- package/lib/typescript/commonjs/src/modules/data-sync/utils/get-total-samples-count.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/health-data-catalog.d.ts +5 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/health-data-catalog.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/health-record-timing.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/data-sync/utils/health-record-timing.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/data-sync/utils/health-units.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-data-types.d.ts +6 -5
- package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-data-types.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/normalize-core-health-observation.d.ts +13 -0
- package/lib/typescript/commonjs/src/modules/data-sync/utils/normalize-core-health-observation.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/picker-sheet/components/value-wheel-picker.d.ts +21 -0
- package/lib/typescript/commonjs/src/modules/picker-sheet/components/value-wheel-picker.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/picker-sheet/components/wheel-picker.d.ts +7 -3
- package/lib/typescript/commonjs/src/modules/picker-sheet/components/wheel-picker.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/picker-sheet/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/picker-sheet/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/content/questionnaire-content-item.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/content/questionnaire-content-specific-item.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/fields/common/questionnaire-field-wrapper.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/fields/questionnaire-choice-field.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/fields/questionnaire-date-field.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/fields/questionnaire-date-field.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/fields/questionnaire-item-renderer.d.ts +9 -3
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/fields/questionnaire-item-renderer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/fields/questionnaire-text-field.d.ts +5 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/fields/questionnaire-text-field.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/header/questionnaire-header-title.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/questionnaire-form-provider.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/questionnaire-form-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/questionnaire-form.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/questionnaire-navigation-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-initial-selected-values.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts +6 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation-state.d.ts +2 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation-state.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/index.d.ts +4 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/extended-questionnaire-item.d.ts +7 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/extended-questionnaire-item.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-form-props.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-form-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-form-provider-props.d.ts +11 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-form-provider-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-form-values.d.ts +5 -2
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-form-values.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-item-render-props.d.ts +15 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-item-render-props.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/response-values.d.ts +2 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/response-values.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/condition-utils.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/conditions/fhir-condition.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/conditions/fhir-condition.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/create-answer-from-value.d.ts +7 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/create-answer-from-value.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/fields/get-option-text.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/fields/get-option-text.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/form-utils.d.ts +4 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/form-utils.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/form-validation.d.ts +4 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/form-validation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/is-answerable-questionnaire-item.d.ts +3 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/is-answerable-questionnaire-item.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/is-valid-questionnaire-answer.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/is-valid-questionnaire-answer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/questionnaire-date-utils.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/questionnaire-date-utils.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/questionnaire-item-constraints.d.ts +22 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/questionnaire-item-constraints.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/questionnaire-item-value-constraint-validators.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/questionnaire-item-value-constraint-validators.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/questionnaire-navigation-utils.d.ts +2 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/questionnaire-navigation-utils.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/questionnaire-picker-options.d.ts +15 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/questionnaire-picker-options.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/questionnaire-string-constraint-validator.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/questionnaire-string-constraint-validator.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/questionnaire-submit-utils.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/questionnaire-submit-utils.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/translate-fhir-text.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/translate-fhir-text.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/validate-questionnaire-item-value.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/validate-questionnaire-item-value.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/components/bluetooth-state-notice.d.ts +8 -5
- package/lib/typescript/commonjs/src/modules/ui/components/bluetooth-state-notice.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/ui/components/prerequisite-gate.d.ts +19 -0
- package/lib/typescript/commonjs/src/modules/ui/components/prerequisite-gate.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/default-translation.d.ts +30 -0
- package/lib/typescript/commonjs/src/modules/ui/default-translation.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/ui/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/polyfills/index.d.ts +7 -1
- package/lib/typescript/commonjs/src/polyfills/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/default-translation.d.ts +22 -0
- package/lib/typescript/module/src/modules/auth/default-translation.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/hooks/use-session.d.ts +4 -1
- package/lib/typescript/module/src/modules/auth/hooks/use-session.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/profile/components/profile-form-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/register/components/form/register-form-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/reset-password/components/form/reset-password-form-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/session/logout-session.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/session/session-store-refresh.d.ts +8 -0
- package/lib/typescript/module/src/modules/auth/session/session-store-refresh.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/session/session-store-request-state.d.ts +23 -0
- package/lib/typescript/module/src/modules/auth/session/session-store-request-state.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/session/session-store-types.d.ts +33 -0
- package/lib/typescript/module/src/modules/auth/session/session-store-types.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/session/session-store.d.ts +1 -18
- package/lib/typescript/module/src/modules/auth/session/session-store.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/utils/sign-in-error.d.ts +4 -2
- package/lib/typescript/module/src/modules/auth/utils/sign-in-error.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/hooks/declined-device-storage.d.ts +10 -1
- package/lib/typescript/module/src/modules/bt-management/hooks/declined-device-storage.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/hooks/nearby-device-offer-state.d.ts +6 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/nearby-device-offer-state.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/nearby-device-offer-types.d.ts +15 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/nearby-device-offer-types.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-nearby-device-offer.d.ts +6 -14
- package/lib/typescript/module/src/modules/bt-management/hooks/use-nearby-device-offer.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/background-sync/background-sync-coordinator.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/background-sync.d.ts +7 -0
- package/lib/typescript/module/src/modules/bt-management/types/background-sync.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/components/apple/apple-health-authorization-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/hooks/use-listen-changes.d.ts +2 -3
- package/lib/typescript/module/src/modules/data-sync/hooks/use-listen-changes.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/services/apple-health-sync-service.d.ts +4 -5
- package/lib/typescript/module/src/modules/data-sync/services/apple-health-sync-service.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/types/apple-health-authorization-provider-props.d.ts +4 -2
- package/lib/typescript/module/src/modules/data-sync/types/apple-health-authorization-provider-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/types/apple-health-sync-props.d.ts +7 -1
- package/lib/typescript/module/src/modules/data-sync/types/apple-health-sync-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/types/health-authorization-status.d.ts +2 -1
- package/lib/typescript/module/src/modules/data-sync/types/health-authorization-status.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/convert-generic-health-data.d.ts +3 -2
- package/lib/typescript/module/src/modules/data-sync/utils/convert-generic-health-data.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/convert-records-to-observation.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/convert-samples-to-observation.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/get-samples-from-health.d.ts +5 -4
- package/lib/typescript/module/src/modules/data-sync/utils/get-samples-from-health.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/get-total-samples-count.d.ts +2 -2
- package/lib/typescript/module/src/modules/data-sync/utils/get-total-samples-count.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/health-data-catalog.d.ts +5 -1
- package/lib/typescript/module/src/modules/data-sync/utils/health-data-catalog.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/health-record-timing.d.ts +10 -0
- package/lib/typescript/module/src/modules/data-sync/utils/health-record-timing.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/data-sync/utils/health-units.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/healthkit-data-types.d.ts +6 -5
- package/lib/typescript/module/src/modules/data-sync/utils/healthkit-data-types.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/normalize-core-health-observation.d.ts +13 -0
- package/lib/typescript/module/src/modules/data-sync/utils/normalize-core-health-observation.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/picker-sheet/components/value-wheel-picker.d.ts +21 -0
- package/lib/typescript/module/src/modules/picker-sheet/components/value-wheel-picker.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/picker-sheet/components/wheel-picker.d.ts +7 -3
- package/lib/typescript/module/src/modules/picker-sheet/components/wheel-picker.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/picker-sheet/index.d.ts +1 -0
- package/lib/typescript/module/src/modules/picker-sheet/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/content/questionnaire-content-item.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/content/questionnaire-content-specific-item.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/fields/common/questionnaire-field-wrapper.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/fields/questionnaire-choice-field.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/fields/questionnaire-date-field.d.ts +3 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/fields/questionnaire-date-field.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/fields/questionnaire-item-renderer.d.ts +9 -3
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/fields/questionnaire-item-renderer.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/fields/questionnaire-text-field.d.ts +5 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/fields/questionnaire-text-field.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/header/questionnaire-header-title.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/questionnaire-form-provider.d.ts +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/questionnaire-form-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/questionnaire-form.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/questionnaire-navigation-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-initial-selected-values.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts +6 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation-state.d.ts +2 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation-state.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/index.d.ts +4 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/extended-questionnaire-item.d.ts +7 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/extended-questionnaire-item.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts +6 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-form-props.d.ts +3 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-form-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-form-provider-props.d.ts +11 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-form-provider-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-form-values.d.ts +5 -2
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-form-values.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-item-render-props.d.ts +15 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-item-render-props.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts +5 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/response-values.d.ts +2 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/response-values.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/condition-utils.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/conditions/fhir-condition.d.ts +9 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/conditions/fhir-condition.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/create-answer-from-value.d.ts +7 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/create-answer-from-value.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/fields/get-option-text.d.ts +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/fields/get-option-text.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/form-utils.d.ts +4 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/form-utils.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/form-validation.d.ts +4 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/form-validation.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/is-answerable-questionnaire-item.d.ts +3 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/is-answerable-questionnaire-item.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/is-valid-questionnaire-answer.d.ts +8 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/is-valid-questionnaire-answer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/questionnaire-date-utils.d.ts +5 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/questionnaire-date-utils.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/questionnaire-item-constraints.d.ts +22 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/questionnaire-item-constraints.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/questionnaire-item-value-constraint-validators.d.ts +10 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/questionnaire-item-value-constraint-validators.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/questionnaire-navigation-utils.d.ts +2 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/questionnaire-navigation-utils.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/questionnaire-picker-options.d.ts +15 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/questionnaire-picker-options.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/questionnaire-string-constraint-validator.d.ts +5 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/questionnaire-string-constraint-validator.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/questionnaire-submit-utils.d.ts +3 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/questionnaire-submit-utils.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/translate-fhir-text.d.ts +4 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/translate-fhir-text.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/validate-questionnaire-item-value.d.ts +6 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/validate-questionnaire-item-value.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/components/bluetooth-state-notice.d.ts +8 -5
- package/lib/typescript/module/src/modules/ui/components/bluetooth-state-notice.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/ui/components/prerequisite-gate.d.ts +19 -0
- package/lib/typescript/module/src/modules/ui/components/prerequisite-gate.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/default-translation.d.ts +30 -0
- package/lib/typescript/module/src/modules/ui/default-translation.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/index.d.ts +1 -0
- package/lib/typescript/module/src/modules/ui/index.d.ts.map +1 -1
- package/lib/typescript/module/src/polyfills/index.d.ts +7 -1
- package/lib/typescript/module/src/polyfills/index.d.ts.map +1 -1
- package/package.json +5 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["checkBooleanCondition","checkStringCondition","checkDecimalCondition","checkDateCondition","isConditionSatisfied","condition","responses","questionId","question","response","undefined","answerBoolean","answerString","answerDecimal","answerDate","answerDateTime","isItemEnabled","item","enableWhen","length","enableBehavior","every","some","getEnabledItemsForPage","page","
|
|
1
|
+
{"version":3,"names":["checkBooleanCondition","checkStringCondition","checkDecimalCondition","checkDateCondition","checkCodingCondition","checkQuantityCondition","checkReferenceCondition","checkTimeCondition","getComparableResponse","isConditionSatisfied","condition","responses","questionId","question","response","operator","answerExists","undefined","answerBoolean","comparableResponse","answerString","answerDecimal","answerInteger","answerDate","answerDateTime","answerTime","answerCoding","answerQuantity","answerReference","isItemEnabled","item","enableWhen","length","enableBehavior","every","some","getEnabledItemsForPage","page","_isSyntheticPage","getEnabledDescendants","items","flatMap","descendants","type","ConditionUtils"],"sourceRoot":"../../../../../src","sources":["modules/questionnaire-response-form/utils/condition-utils.ts"],"mappings":";;AAQA,SACEA,qBAAqB,EACrBC,oBAAoB,EACpBC,qBAAqB,EACrBC,kBAAkB,QACb,uBAAc;AACrB,SACEC,oBAAoB,EACpBC,sBAAsB,EACtBC,uBAAuB,EACvBC,kBAAkB,EAClBC,qBAAqB,QAChB,gCAA6B;AAEpC,MAAMC,oBAAoB,GAAGA,CAC3BC,SAAsC,EACtCC,SAAyB,KACb;EACZ,MAAMC,UAAU,GAAGF,SAAS,CAACG,QAAQ;EACrC,MAAMC,QAAQ,GAAGH,SAAS,CAACC,UAAU,CAAC;EAEtC,IAAIF,SAAS,CAACK,QAAQ,KAAK,QAAQ,EAAE;IACnC,MAAMC,YAAY,GAChBF,QAAQ,KAAKG,SAAS,IAAIH,QAAQ,KAAK,IAAI,IAAIA,QAAQ,KAAK,EAAE;IAEhE,OAAOE,YAAY,KAAKN,SAAS,CAACQ,aAAa;EACjD;EAEA,IAAIJ,QAAQ,KAAKG,SAAS,IAAIH,QAAQ,KAAK,IAAI,EAAE;IAC/C,OAAO,KAAK;EACd;EAEA,MAAMK,kBAAkB,GAAGX,qBAAqB,CAACM,QAAQ,CAAC;EAE1D,IAAIJ,SAAS,CAACQ,aAAa,KAAKD,SAAS,EAAE;IACzC,OAAOjB,qBAAqB,CAACU,SAAS,EAAES,kBAAkB,CAAC;EAC7D;EAEA,IAAIT,SAAS,CAACU,YAAY,KAAKH,SAAS,EAAE;IACxC,OAAOhB,oBAAoB,CAACS,SAAS,EA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AAS,EAAEC,SAAS,CAC3C,CAAC;EACH,CAAC,MAAM,IAAIsB,cAAc,KAAK,KAAK,EAAE;IACnC,OAAOH,IAAI,CAACC,UAAU,CAACI,IAAI,CAAEzB,SAAS,IACpCD,oBAAoB,CAACC,SAAS,EAAEC,SAAS,CAC3C,CAAC;EACH;EAEA,OAAO,IAAI;AACb,CAAC;AAED,MAAMyB,sBAAsB,GAAGA,CAC7BC,IAA+B,EAC/B1B,SAAyB,KACO;EAChC,IAAI,CAAC0B,IAAI,CAACP,IAAI,EAAE;IACd,OAAO,EAAE;EACX;EAEA,IAAI,CAACO,IAAI,CAACC,gBAAgB,IAAI,CAACT,aAAa,CAACQ,IAAI,EAAE1B,SAAS,CAAC,EAAE;IAC7D,OAAO,EAAE;EACX;EAEA,MAAM4B,qBAAqB,GACzBC,KAA0B,IAE1BA,KAAK,CAACC,OAAO,CAAEX,IAAI,IAAK;IACtB,IAAI,CAACD,aAAa,CAACC,IAAI,EAAEnB,SAAS,CAAC,EAAE;MACnC,OAAO,EAAE;IACX;IAEA,MAAM+B,WAAW,GAAGH,qBAAqB,CAACT,IAAI,CAACA,IAAI,IAAI,EAAE,CAAC;IAE1D,OAAOA,IAAI,CAACa,IAAI,KAAK,OAAO,GACxBD,WAAW,GACX,CAACZ,IAAI,EAA+B,GAAGY,WAAW,CAAC;EACzD,CAAC,CAAC;EAEJ,OAAOH,qBAAqB,CAACF,IAAI,CAACP,IAAI,CAAC;AACzC,CAAC;AAED,OAAO,MAAMc,cAAc,GAAG;EAC5BnC,oBAAoB;EACpBoB,aAAa;EACbO;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const getComparableResponse = value => {
|
|
4
|
+
if (!value || typeof value !== "object") {
|
|
5
|
+
return value;
|
|
6
|
+
}
|
|
7
|
+
if ("valueBoolean" in value) {
|
|
8
|
+
return value.valueBoolean;
|
|
9
|
+
}
|
|
10
|
+
if ("valueString" in value) {
|
|
11
|
+
return value.valueString;
|
|
12
|
+
}
|
|
13
|
+
if ("valueDecimal" in value) {
|
|
14
|
+
return value.valueDecimal;
|
|
15
|
+
}
|
|
16
|
+
if ("valueInteger" in value) {
|
|
17
|
+
return value.valueInteger;
|
|
18
|
+
}
|
|
19
|
+
if ("valueDate" in value) {
|
|
20
|
+
return value.valueDate;
|
|
21
|
+
}
|
|
22
|
+
if ("valueDateTime" in value) {
|
|
23
|
+
return value.valueDateTime;
|
|
24
|
+
}
|
|
25
|
+
if ("valueTime" in value) {
|
|
26
|
+
return value.valueTime;
|
|
27
|
+
}
|
|
28
|
+
if ("valueUri" in value) {
|
|
29
|
+
return value.valueUri;
|
|
30
|
+
}
|
|
31
|
+
if ("valueQuantity" in value) {
|
|
32
|
+
return value.valueQuantity;
|
|
33
|
+
}
|
|
34
|
+
if ("valueReference" in value) {
|
|
35
|
+
return value.valueReference;
|
|
36
|
+
}
|
|
37
|
+
return value;
|
|
38
|
+
};
|
|
39
|
+
const checkTimeCondition = (condition, response) => {
|
|
40
|
+
const actualSeconds = parseTime(response);
|
|
41
|
+
const expectedSeconds = parseTime(condition.answerTime);
|
|
42
|
+
if (actualSeconds === undefined || expectedSeconds === undefined) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
switch (condition.operator) {
|
|
46
|
+
case "=":
|
|
47
|
+
return actualSeconds === expectedSeconds;
|
|
48
|
+
case "!=":
|
|
49
|
+
return actualSeconds !== expectedSeconds;
|
|
50
|
+
case "<":
|
|
51
|
+
return actualSeconds < expectedSeconds;
|
|
52
|
+
case "<=":
|
|
53
|
+
return actualSeconds <= expectedSeconds;
|
|
54
|
+
case ">":
|
|
55
|
+
return actualSeconds > expectedSeconds;
|
|
56
|
+
case ">=":
|
|
57
|
+
return actualSeconds >= expectedSeconds;
|
|
58
|
+
default:
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
const parseTime = value => {
|
|
63
|
+
if (typeof value !== "string") {
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
const match = /^(\d{2}):(\d{2})(?::(\d{2})(\.\d+)?)?$/.exec(value);
|
|
67
|
+
if (!match) {
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
const [, hours, minutes, seconds = "0", fraction = ""] = match;
|
|
71
|
+
const parsedHours = Number(hours);
|
|
72
|
+
const parsedMinutes = Number(minutes);
|
|
73
|
+
const parsedSeconds = Number(seconds);
|
|
74
|
+
if (parsedHours > 23 || parsedMinutes > 59 || parsedSeconds > 59) {
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
return parsedHours * 3600 + parsedMinutes * 60 + parsedSeconds + (fraction ? Number(fraction) : 0);
|
|
78
|
+
};
|
|
79
|
+
const checkCodingCondition = (condition, response) => {
|
|
80
|
+
const actual = getCoding(response);
|
|
81
|
+
const expected = condition.answerCoding;
|
|
82
|
+
const matches = actual !== undefined && expected !== undefined && actual.code === expected.code && (actual.system === undefined || expected.system === undefined || actual.system === expected.system);
|
|
83
|
+
return condition.operator === "!=" ? !matches : matches;
|
|
84
|
+
};
|
|
85
|
+
const getCoding = value => {
|
|
86
|
+
if (!value || typeof value !== "object") {
|
|
87
|
+
return typeof value === "string" ? {
|
|
88
|
+
code: value
|
|
89
|
+
} : undefined;
|
|
90
|
+
}
|
|
91
|
+
if ("valueCoding" in value) {
|
|
92
|
+
return value.valueCoding;
|
|
93
|
+
}
|
|
94
|
+
if ("code" in value) {
|
|
95
|
+
return value;
|
|
96
|
+
}
|
|
97
|
+
return undefined;
|
|
98
|
+
};
|
|
99
|
+
const checkQuantityCondition = (condition, response) => {
|
|
100
|
+
const actual = getQuantity(response);
|
|
101
|
+
const expected = condition.answerQuantity;
|
|
102
|
+
if (!actual || !expected || actual.value === undefined || expected.value === undefined || actual.code !== expected.code || actual.system !== expected.system || actual.unit !== expected.unit) {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
switch (condition.operator) {
|
|
106
|
+
case "=":
|
|
107
|
+
return actual.value === expected.value;
|
|
108
|
+
case "!=":
|
|
109
|
+
return actual.value !== expected.value;
|
|
110
|
+
case "<":
|
|
111
|
+
return actual.value < expected.value;
|
|
112
|
+
case "<=":
|
|
113
|
+
return actual.value <= expected.value;
|
|
114
|
+
case ">":
|
|
115
|
+
return actual.value > expected.value;
|
|
116
|
+
case ">=":
|
|
117
|
+
return actual.value >= expected.value;
|
|
118
|
+
default:
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
const getQuantity = value => {
|
|
123
|
+
if (!value || typeof value !== "object" || !("value" in value)) {
|
|
124
|
+
return undefined;
|
|
125
|
+
}
|
|
126
|
+
return value;
|
|
127
|
+
};
|
|
128
|
+
const checkReferenceCondition = (condition, response) => {
|
|
129
|
+
const actual = getReference(response);
|
|
130
|
+
const matches = actual !== undefined && actual === condition.answerReference?.reference;
|
|
131
|
+
return condition.operator === "!=" ? !matches : matches;
|
|
132
|
+
};
|
|
133
|
+
const getReference = value => {
|
|
134
|
+
if (!value || typeof value !== "object" || !("reference" in value)) {
|
|
135
|
+
return undefined;
|
|
136
|
+
}
|
|
137
|
+
return typeof value.reference === "string" ? value.reference : undefined;
|
|
138
|
+
};
|
|
139
|
+
export { checkCodingCondition, checkQuantityCondition, checkReferenceCondition, checkTimeCondition, getComparableResponse };
|
|
140
|
+
//# sourceMappingURL=fhir-condition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getComparableResponse","value","valueBoolean","valueString","valueDecimal","valueInteger","valueDate","valueDateTime","valueTime","valueUri","valueQuantity","valueReference","checkTimeCondition","condition","response","actualSeconds","parseTime","expectedSeconds","answerTime","undefined","operator","match","exec","hours","minutes","seconds","fraction","parsedHours","Number","parsedMinutes","parsedSeconds","checkCodingCondition","actual","getCoding","expected","answerCoding","matches","code","system","valueCoding","checkQuantityCondition","getQuantity","answerQuantity","unit","checkReferenceCondition","getReference","answerReference","reference"],"sourceRoot":"../../../../../../src","sources":["modules/questionnaire-response-form/utils/conditions/fhir-condition.ts"],"mappings":";;AAIA,MAAMA,qBAAqB,GAAIC,KAA6B,IAAc;EACxE,IAAI,CAACA,KAAK,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IACvC,OAAOA,KAAK;EACd;EAEA,IAAI,cAAc,IAAIA,KAAK,EAAE;IAC3B,OAAOA,KAAK,CAACC,YAAY;EAC3B;EACA,IAAI,aAAa,IAAID,KAAK,EAAE;IAC1B,OAAOA,KAAK,CAACE,WAAW;EAC1B;EACA,IAAI,cAAc,IAAIF,KAAK,EAAE;IAC3B,OAAOA,KAAK,CAACG,YAAY;EAC3B;EACA,IAAI,cAAc,IAAIH,KAAK,EAAE;IAC3B,OAAOA,KAAK,CAACI,YAAY;EAC3B;EACA,IAAI,WAAW,IAAIJ,KAAK,EAAE;IACxB,OAAOA,KAAK,CAACK,SAAS;EACxB;EACA,IAAI,eAAe,IAAIL,KAAK,EAAE;IAC5B,OAAOA,KAAK,CAACM,aAAa;EAC5B;EACA,IAAI,WAAW,IAAIN,KAAK,EAAE;IACxB,OAAOA,KAAK,CAACO,SAAS;EACxB;EACA,IAAI,UAAU,IAAIP,KAAK,EAAE;IACvB,OAAOA,KAAK,CAACQ,QAAQ;EACvB;EACA,IAAI,eAAe,IAAIR,KAAK,EAAE;IAC5B,OAAOA,KAAK,CAACS,aAAa;EAC5B;EACA,IAAI,gBAAgB,IAAIT,KAAK,EAAE;IAC7B,OAAOA,KAAK,CAACU,cAAc;EAC7B;EAEA,OAAOV,KAAK;AACd,CAAC;AAED,MAAMW,kBAAkB,GAAGA,CACzBC,SAAsC,EACtCC,QAAiB,KACL;EACZ,MAAMC,aAAa,GAAGC,SAAS,CAACF,QAAQ,CAAC;EACzC,MAAMG,eAAe,GAAGD,SAAS,CAACH,SAAS,CAACK,UAAU,CAAC;EAEvD,IAAIH,aAAa,KAAKI,SAAS,IAAIF,eAAe,KAA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,KAAK,KAAK,QAAQ,IAAI,EAAE,WAAW,IAAIA,KAAK,CAAC,EAAE;IAClE,OAAOkB,SAAS;EAClB;EAEA,OAAO,OAAOlB,KAAK,CAAC8C,SAAS,KAAK,QAAQ,GAAG9C,KAAK,CAAC8C,SAAS,GAAG5B,SAAS;AAC1E,CAAC;AAED,SACEY,oBAAoB,EACpBS,sBAAsB,EACtBI,uBAAuB,EACvBhC,kBAAkB,EAClBZ,qBAAqB","ignoreList":[]}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { createTypedAnswer, getAnswerValueKey, validateAnswerForItem } from "./is-valid-questionnaire-answer.js";
|
|
4
|
+
const createNumericAnswer = (value, type) => {
|
|
5
|
+
if (typeof value !== "string" && typeof value !== "number") {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
const number = typeof value === "number" ? value : Number(value.trim());
|
|
9
|
+
if (!Number.isFinite(number) || type === "integer" && !Number.isInteger(number)) {
|
|
10
|
+
return undefined;
|
|
11
|
+
}
|
|
12
|
+
return number;
|
|
13
|
+
};
|
|
14
|
+
const createChoiceAnswer = (value, item) => {
|
|
15
|
+
if (typeof value === "object" && value !== null) {
|
|
16
|
+
if ("code" in value && item.type === "choice") {
|
|
17
|
+
return {
|
|
18
|
+
valueCoding: value
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
if ("reference" in value && item.type === "choice") {
|
|
22
|
+
return {
|
|
23
|
+
valueReference: value
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
if (typeof value !== "string" && typeof value !== "number") {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
const option = item.answerOption?.find(candidate => candidate.valueCoding?.code === value || candidate.valueReference?.reference === value || candidate.valueInteger === value || candidate.valueDate === value || candidate.valueTime === value || candidate.valueString === value);
|
|
32
|
+
if (option?.valueCoding) {
|
|
33
|
+
return {
|
|
34
|
+
valueCoding: option.valueCoding
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
if (option?.valueReference) {
|
|
38
|
+
return {
|
|
39
|
+
valueReference: option.valueReference
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
if (option?.valueInteger !== undefined) {
|
|
43
|
+
return {
|
|
44
|
+
valueInteger: option.valueInteger
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
if (option?.valueDate !== undefined) {
|
|
48
|
+
return {
|
|
49
|
+
valueDate: option.valueDate
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
if (option?.valueTime !== undefined) {
|
|
53
|
+
return {
|
|
54
|
+
valueTime: option.valueTime
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
if (option?.valueString !== undefined) {
|
|
58
|
+
return {
|
|
59
|
+
valueString: option.valueString
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
if (item.type === "open-choice" && typeof value === "string") {
|
|
63
|
+
return {
|
|
64
|
+
valueString: value
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
return typeof value === "string" ? {
|
|
68
|
+
valueCoding: {
|
|
69
|
+
code: value
|
|
70
|
+
}
|
|
71
|
+
} : undefined;
|
|
72
|
+
};
|
|
73
|
+
const createAnswerFromValue = (value, item) => {
|
|
74
|
+
if (value === undefined || value === null || value === "") {
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
if (typeof value === "object") {
|
|
78
|
+
const key = getAnswerValueKey(value);
|
|
79
|
+
if (key) {
|
|
80
|
+
return validateAnswerForItem(value, item.type);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
switch (item.type) {
|
|
84
|
+
case "boolean":
|
|
85
|
+
return createTypedAnswer(item.type, "valueBoolean", value);
|
|
86
|
+
case "date":
|
|
87
|
+
return createTypedAnswer(item.type, "valueDate", value);
|
|
88
|
+
case "dateTime":
|
|
89
|
+
return createTypedAnswer(item.type, "valueDateTime", value);
|
|
90
|
+
case "time":
|
|
91
|
+
return createTypedAnswer(item.type, "valueTime", value);
|
|
92
|
+
case "choice":
|
|
93
|
+
case "open-choice":
|
|
94
|
+
return validateAnswerForItem(createChoiceAnswer(value, item), item.type);
|
|
95
|
+
case "decimal":
|
|
96
|
+
{
|
|
97
|
+
const number = createNumericAnswer(value, "decimal");
|
|
98
|
+
return number === undefined ? undefined : createTypedAnswer(item.type, "valueDecimal", number);
|
|
99
|
+
}
|
|
100
|
+
case "integer":
|
|
101
|
+
{
|
|
102
|
+
const number = createNumericAnswer(value, "integer");
|
|
103
|
+
return number === undefined ? undefined : createTypedAnswer(item.type, "valueInteger", number);
|
|
104
|
+
}
|
|
105
|
+
case "string":
|
|
106
|
+
case "text":
|
|
107
|
+
return createTypedAnswer(item.type, "valueString", value);
|
|
108
|
+
case "url":
|
|
109
|
+
return createTypedAnswer(item.type, "valueUri", value);
|
|
110
|
+
case "attachment":
|
|
111
|
+
return createTypedAnswer(item.type, "valueAttachment", value);
|
|
112
|
+
case "reference":
|
|
113
|
+
return createTypedAnswer(item.type, "valueReference", value);
|
|
114
|
+
case "quantity":
|
|
115
|
+
return createTypedAnswer(item.type, "valueQuantity", value);
|
|
116
|
+
default:
|
|
117
|
+
return undefined;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
const isQuestionnaireItemAnswered = (value, item) => createAnswerFromValue(value, item) !== undefined;
|
|
121
|
+
export { createAnswerFromValue, isQuestionnaireItemAnswered };
|
|
122
|
+
//# sourceMappingURL=create-answer-from-value.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createTypedAnswer","getAnswerValueKey","validateAnswerForItem","createNumericAnswer","value","type","undefined","number","Number","trim","isFinite","isInteger","createChoiceAnswer","item","valueCoding","valueReference","option","answerOption","find","candidate","code","reference","valueInteger","valueDate","valueTime","valueString","createAnswerFromValue","key","isQuestionnaireItemAnswered"],"sourceRoot":"../../../../../src","sources":["modules/questionnaire-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Ac,EAAEE,MAAM,CAAC;MAC1D;IACA,KAAK,QAAQ;IACb,KAAK,MAAM;MACT,OAAOP,iBAAiB,CAACa,IAAI,CAACR,IAAI,EAAE,aAAa,EAAED,KAAK,CAAC;IAC3D,KAAK,KAAK;MACR,OAAOJ,iBAAiB,CAACa,IAAI,CAACR,IAAI,EAAE,UAAU,EAAED,KAAK,CAAC;IACxD,KAAK,YAAY;MACf,OAAOJ,iBAAiB,CAACa,IAAI,CAACR,IAAI,EAAE,iBAAiB,EAAED,KAAK,CAAC;IAC/D,KAAK,WAAW;MACd,OAAOJ,iBAAiB,CAACa,IAAI,CAACR,IAAI,EAAE,gBAAgB,EAAED,KAAK,CAAC;IAC9D,KAAK,UAAU;MACb,OAAOJ,iBAAiB,CAACa,IAAI,CAACR,IAAI,EAAE,eAAe,EAAED,KAAK,CAAC;IAC7D;MACE,OAAOE,SAAS;EACpB;AACF,CAAC;AAED,MAAMsB,2BAA2B,GAAGA,CAClCxB,KAA6B,EAC7BS,IAA+B,KACnBa,qBAAqB,CAACtB,KAAK,EAAES,IAAI,CAAC,KAAKP,SAAS;AAE9D,SAASoB,qBAAqB,EAAEE,2BAA2B","ignoreList":[]}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import { translateFhirText } from "../translate-fhir-text.js";
|
|
4
|
+
export const getOptionText = (option, locale) => {
|
|
4
5
|
if (option.valueCoding?.display) {
|
|
5
|
-
return option.valueCoding.display;
|
|
6
|
+
return translateFhirText(option.valueCoding.display, option.valueCoding._display, locale);
|
|
6
7
|
}
|
|
7
8
|
if (option.valueCoding?.code) {
|
|
8
9
|
return option.valueCoding.code;
|
|
9
10
|
}
|
|
10
11
|
if (option.valueString) {
|
|
11
|
-
return option.valueString;
|
|
12
|
+
return translateFhirText(option.valueString, option._valueString, locale);
|
|
12
13
|
}
|
|
13
14
|
return "";
|
|
14
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getOptionText","option","valueCoding","display","code","valueString"],"sourceRoot":"../../../../../../src","sources":["modules/questionnaire-response-form/utils/fields/get-option-text.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"names":["translateFhirText","getOptionText","option","locale","valueCoding","display","_display","code","valueString","_valueString"],"sourceRoot":"../../../../../../src","sources":["modules/questionnaire-response-form/utils/fields/get-option-text.ts"],"mappings":";;AAGA,SAASA,iBAAiB,QAAQ,2BAAwB;AAE1D,OAAO,MAAMC,aAAa,GAAGA,CAC3BC,MAA6C,EAC7CC,MAAe,KACJ;EACX,IAAID,MAAM,CAACE,WAAW,EAAEC,OAAO,EAAE;IAC/B,OAAOL,iBAAiB,CACtBE,MAAM,CAACE,WAAW,CAACC,OAAO,EACzBH,MAAM,CAACE,WAAW,CAAqCE,QAAQ,EAChEH,MACF,CAAC;EACH;EACA,IAAID,MAAM,CAACE,WAAW,EAAEG,IAAI,EAAE;IAC5B,OAAOL,MAAM,CAACE,WAAW,CAACG,IAAI;EAChC;EACA,IAAIL,MAAM,CAACM,WAAW,EAAE;IACtB,OAAOR,iBAAiB,CAACE,MAAM,CAACM,WAAW,EAAEN,MAAM,CAACO,YAAY,EAAEN,MAAM,CAAC;EAC3E;EAEA,OAAO,EAAE;AACX,CAAC","ignoreList":[]}
|
|
@@ -1,83 +1,86 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import { ConditionUtils } from "./condition-utils.js";
|
|
4
|
+
import { createAnswerFromValue } from "./create-answer-from-value.js";
|
|
5
|
+
import { FormValidation } from "./form-validation.js";
|
|
6
|
+
import { isAnswerableQuestionnaireItem } from "./is-answerable-questionnaire-item.js";
|
|
3
7
|
const extractPagesFromQuestionnaire = questionnaire => {
|
|
4
8
|
if (!questionnaire.item || !questionnaire.item.length) {
|
|
5
9
|
return [];
|
|
6
10
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
text: questionnaire.title || "Questionnaire",
|
|
13
|
-
type: "group",
|
|
14
|
-
item: questionnaire.item
|
|
15
|
-
}];
|
|
16
|
-
};
|
|
17
|
-
const getItemType = (linkId, pages) => {
|
|
18
|
-
for (const page of pages) {
|
|
19
|
-
if (!page.item) {
|
|
20
|
-
continue;
|
|
11
|
+
const pages = [];
|
|
12
|
+
let ungroupedItems = [];
|
|
13
|
+
const flushUngroupedItems = () => {
|
|
14
|
+
if (!ungroupedItems.length) {
|
|
15
|
+
return;
|
|
21
16
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
pages.push({
|
|
18
|
+
linkId: `page-${pages.length + 1}`,
|
|
19
|
+
text: questionnaire.title || "Questionnaire",
|
|
20
|
+
type: "group",
|
|
21
|
+
item: ungroupedItems,
|
|
22
|
+
_isSyntheticPage: true
|
|
23
|
+
});
|
|
24
|
+
ungroupedItems = [];
|
|
25
|
+
};
|
|
26
|
+
questionnaire.item.forEach(item => {
|
|
27
|
+
if (item.type === "group") {
|
|
28
|
+
flushUngroupedItems();
|
|
29
|
+
pages.push(item);
|
|
30
|
+
} else {
|
|
31
|
+
ungroupedItems.push(item);
|
|
25
32
|
}
|
|
26
|
-
}
|
|
27
|
-
|
|
33
|
+
});
|
|
34
|
+
flushUngroupedItems();
|
|
35
|
+
return pages;
|
|
28
36
|
};
|
|
29
|
-
const
|
|
30
|
-
if (
|
|
37
|
+
const createResponseItem = (item, responses) => {
|
|
38
|
+
if (!ConditionUtils.isItemEnabled(item, responses)) {
|
|
31
39
|
return undefined;
|
|
32
40
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return {
|
|
48
|
-
valueCoding: {
|
|
49
|
-
code: value
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
case "decimal":
|
|
53
|
-
return {
|
|
54
|
-
valueDecimal: parseFloat(value)
|
|
55
|
-
};
|
|
56
|
-
case "integer":
|
|
57
|
-
return {
|
|
58
|
-
valueInteger: parseInt(value, 10)
|
|
59
|
-
};
|
|
60
|
-
case "string":
|
|
61
|
-
case "text":
|
|
62
|
-
default:
|
|
63
|
-
return {
|
|
64
|
-
valueString: value
|
|
65
|
-
};
|
|
41
|
+
const nestedItems = (item.item ?? []).flatMap(nestedItem => {
|
|
42
|
+
const responseItem = createResponseItem(nestedItem, responses);
|
|
43
|
+
return responseItem ? [responseItem] : [];
|
|
44
|
+
});
|
|
45
|
+
if (item.type === "group") {
|
|
46
|
+
return {
|
|
47
|
+
linkId: item.linkId || "",
|
|
48
|
+
text: item.text,
|
|
49
|
+
item: nestedItems.length ? nestedItems : undefined
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
const answer = createAnswerFromValue(responses[item.linkId || ""], item);
|
|
53
|
+
if (!answer && !nestedItems.length) {
|
|
54
|
+
return undefined;
|
|
66
55
|
}
|
|
56
|
+
return {
|
|
57
|
+
linkId: item.linkId || "",
|
|
58
|
+
answer: answer ? [{
|
|
59
|
+
...answer,
|
|
60
|
+
...(nestedItems.length ? {
|
|
61
|
+
item: nestedItems
|
|
62
|
+
} : {})
|
|
63
|
+
}] : undefined
|
|
64
|
+
};
|
|
67
65
|
};
|
|
68
66
|
const createQuestionnaireResponseItems = (responses, pages) => {
|
|
69
|
-
return
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
67
|
+
return pages.flatMap(page => {
|
|
68
|
+
if (!page._isSyntheticPage && !ConditionUtils.isItemEnabled(page, responses)) {
|
|
69
|
+
return [];
|
|
70
|
+
}
|
|
71
|
+
if (page._isSyntheticPage) {
|
|
72
|
+
return (page.item ?? []).flatMap(item => {
|
|
73
|
+
const responseItem = createResponseItem(item, responses);
|
|
74
|
+
return responseItem ? [responseItem] : [];
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
const responseItem = createResponseItem(page, responses);
|
|
78
|
+
return responseItem ? [responseItem] : [];
|
|
76
79
|
});
|
|
77
80
|
};
|
|
78
81
|
const initializeDefaultValues = pages => {
|
|
79
82
|
const defaults = {};
|
|
80
|
-
const allItems = pages.flatMap(page => page.
|
|
83
|
+
const allItems = getItems(pages.flatMap(page => page._isSyntheticPage ? page.item ?? [] : [page]));
|
|
81
84
|
allItems.forEach(item => {
|
|
82
85
|
const hasEnableWhenConditions = item.enableWhen && item.enableWhen.length > 0;
|
|
83
86
|
if (!hasEnableWhenConditions) {
|
|
@@ -97,10 +100,14 @@ const initializeDefaultValues = pages => {
|
|
|
97
100
|
});
|
|
98
101
|
return defaults;
|
|
99
102
|
};
|
|
103
|
+
const getItems = items => items.flatMap(item => [item, ...getItems(item.item ?? [])]);
|
|
104
|
+
const getAllQuestionnaireItems = pages => pages.flatMap(page => getItems(page.item ?? []));
|
|
105
|
+
const hasUnansweredRequiredItems = (pages, responses, renderItem, resolver, unitOptionsResolver) => pages.some(page => ConditionUtils.getEnabledItemsForPage(page, responses).some(item => item.type !== "display" && item.required && !isAnswerableQuestionnaireItem(item) && !renderItem)) || !FormValidation.validateRequiredFields(pages, responses, renderItem, resolver, unitOptionsResolver).isValid;
|
|
100
106
|
export const FormUtils = {
|
|
101
107
|
extractPagesFromQuestionnaire,
|
|
102
|
-
getItemType,
|
|
103
108
|
createQuestionnaireResponseItems,
|
|
104
|
-
initializeDefaultValues
|
|
109
|
+
initializeDefaultValues,
|
|
110
|
+
getAllQuestionnaireItems,
|
|
111
|
+
hasUnansweredRequiredItems
|
|
105
112
|
};
|
|
106
113
|
//# sourceMappingURL=form-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["extractPagesFromQuestionnaire","questionnaire","item","length","
|
|
1
|
+
{"version":3,"names":["ConditionUtils","createAnswerFromValue","FormValidation","isAnswerableQuestionnaireItem","extractPagesFromQuestionnaire","questionnaire","item","length","pages","ungroupedItems","flushUngroupedItems","push","linkId","text","title","type","_isSyntheticPage","forEach","createResponseItem","responses","isItemEnabled","undefined","nestedItems","flatMap","nestedItem","responseItem","answer","createQuestionnaireResponseItems","page","initializeDefaultValues","defaults","allItems","getItems","hasEnableWhenConditions","enableWhen","answerOption","initialSelectedOption","find","option","initialSelected","valueCoding","code","valueString","items","getAllQuestionnaireItems","hasUnansweredRequiredItems","renderItem","resolver","unitOptionsResolver","some","getEnabledItemsForPage","required","validateRequiredFields","isValid","FormUtils"],"sourceRoot":"../../../../../src","sources":["modules/questionnaire-response-form/utils/form-utils.ts"],"mappings":";;AAMA,SAASA,cAAc,QAAQ,sBAAmB;AAClD,SAASC,qBAAqB,QAAQ,+BAA4B;AAClE,SAASC,cAAc,QAAQ,sBAAmB;AAClD,SAASC,6BAA6B,QAAQ,uCAAoC;AAMlF,MAAMC,6BAA6B,GACjCC,aAA4B,IACI;EAChC,IAAI,CAACA,aAAa,CAACC,IAAI,IAAI,CAACD,aAAa,CAACC,IAAI,CAACC,MAAM,EAAE;IACrD,OAAO,EAAE;EACX;EAEA,MAAMC,KAAkC,GAAG,EAAE;EAC7C,IAAIC,cAA2C,GAAG,EAAE;EAEpD,MAAMC,mBAAmB,GAAGA,CAAA,KAAM;IAChC,IAAI,CAACD,cAAc,CAACF,MAAM,EAAE;MAC1B;IACF;IAEAC,KAAK,CAACG,IAAI,CAAC;MACTC,MAAM,EAAE,QAAQJ,KAAK,CAACD,MAAM,GAAG,CAAC,EAAE;MAClCM,IAAI,EAAER,aAAa,CAACS,KAAK,IAAI,eAAe;MAC5CC,IAAI,EAAE,OAAO;MACbT,IAAI,EAAEG,cAAc;MACpBO,gBAAgB,EAAE;IACpB,CAAC,CAAC;IACFP,cAAc,GAAG,EAAE;EACrB,CAAC;EAEDJ,aAAa,CAACC,IAAI,CAACW,OAAO,CAAEX,IAAI,IAAK;IACnC,IAAIA,IAAI,CAACS,IAAI,K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CACxD3C,IAAI,IACHA,IAAI,CAACS,IAAI,KAAK,SAAS,IACvBT,IAAI,CAAC6C,QAAQ,IACb,CAAChD,6BAA6B,CAACG,IAAI,CAAC,IACpC,CAACwC,UACL,CACF,CAAC,IACD,CAAC5C,cAAc,CAACkD,sBAAsB,CACpC5C,KAAK,EACLW,SAAS,EACT2B,UAAU,EACVC,QAAQ,EACRC,mBACF,CAAC,CAACK,OAAO;AAEX,OAAO,MAAMC,SAAS,GAAG;EACvBlD,6BAA6B;EAC7BuB,gCAAgC;EAChCE,uBAAuB;EACvBe,wBAAwB;EACxBC;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { ConditionUtils } from "./condition-utils.js";
|
|
4
|
+
import { isQuestionnaireItemAnswered } from "./create-answer-from-value.js";
|
|
5
|
+
import { isAnswerableQuestionnaireItem } from "./is-answerable-questionnaire-item.js";
|
|
6
|
+
import { validateQuestionnaireItemValue } from "./validate-questionnaire-item-value.js";
|
|
4
7
|
|
|
5
8
|
/**
|
|
6
9
|
* Validates all required and enabled items have answers
|
|
@@ -8,21 +11,36 @@ import { ConditionUtils } from "./condition-utils.js";
|
|
|
8
11
|
* @param responses Current responses
|
|
9
12
|
* @returns Object containing validation result and first unanswered item location if any
|
|
10
13
|
*/
|
|
11
|
-
const validateRequiredFields = (pages, responses) => {
|
|
14
|
+
const validateRequiredFields = (pages, responses, renderItem, resolver, unitOptionsResolver) => {
|
|
12
15
|
for (let pageIndex = 0; pageIndex < pages.length; pageIndex++) {
|
|
13
16
|
const page = pages[pageIndex];
|
|
14
17
|
if (!page || !page.item) {
|
|
15
18
|
continue;
|
|
16
19
|
}
|
|
17
20
|
const enabledItems = ConditionUtils.getEnabledItemsForPage(page, responses);
|
|
18
|
-
const
|
|
19
|
-
|
|
21
|
+
const failureIndex = enabledItems.findIndex(item => {
|
|
22
|
+
if (item.type === "group" || item.type === "display") {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
const value = responses[item.linkId || ""];
|
|
26
|
+
const answered = isQuestionnaireItemAnswered(value, item);
|
|
27
|
+
const isRequired = item.required === true;
|
|
28
|
+
if (isRequired && (isAnswerableQuestionnaireItem(item) || renderItem) && !answered) {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
return validateQuestionnaireItemValue(value, item, responses, resolver, unitOptionsResolver) !== undefined;
|
|
32
|
+
});
|
|
33
|
+
if (failureIndex !== -1) {
|
|
34
|
+
const item = enabledItems[failureIndex];
|
|
35
|
+
const value = item ? responses[item.linkId || ""] : undefined;
|
|
36
|
+
const answered = item ? isQuestionnaireItemAnswered(value, item) : false;
|
|
20
37
|
return {
|
|
21
38
|
isValid: false,
|
|
22
39
|
firstUnansweredLocation: {
|
|
23
40
|
pageIndex,
|
|
24
|
-
itemIndex:
|
|
25
|
-
}
|
|
41
|
+
itemIndex: failureIndex
|
|
42
|
+
},
|
|
43
|
+
failureReason: item?.required && !answered ? "required" : "invalid-answer"
|
|
26
44
|
};
|
|
27
45
|
}
|
|
28
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ConditionUtils","validateRequiredFields","pages","responses","pageIndex","length","page","item","enabledItems","getEnabledItemsForPage","
|
|
1
|
+
{"version":3,"names":["ConditionUtils","isQuestionnaireItemAnswered","isAnswerableQuestionnaireItem","validateQuestionnaireItemValue","validateRequiredFields","pages","responses","renderItem","resolver","unitOptionsResolver","pageIndex","length","page","item","enabledItems","getEnabledItemsForPage","failureIndex","findIndex","type","value","linkId","answered","isRequired","required","undefined","isValid","firstUnansweredLocation","itemIndex","failureReason","FormValidation"],"sourceRoot":"../../../../../src","sources":["modules/questionnaire-response-form/utils/form-validation.ts"],"mappings":";;AAIA,SAASA,cAAc,QAAQ,sBAAmB;AAClD,SAASC,2BAA2B,QAAQ,+BAA4B;AACxE,SAASC,6BAA6B,QAAQ,uCAAoC;AAKlF,SAASC,8BAA8B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AACO,MAAM,IAAI,EAAE,CAAC,GAAGI,SAAS;MAC7D,MAAMH,QAAQ,GAAGR,IAAI,GAAGZ,2BAA2B,CAACkB,KAAK,EAAEN,IAAI,CAAC,GAAG,KAAK;MAExE,OAAO;QACLY,OAAO,EAAE,KAAK;QACdC,uBAAuB,EAAE;UACvBhB,SAAS;UACTiB,SAAS,EAAEX;QACb,CAAC;QACDY,aAAa,EACXf,IAAI,EAAEU,QAAQ,IAAI,CAACF,QAAQ,GAAG,UAAU,GAAG;MAC/C,CAAC;IACH;EACF;EAEA,OAAO;IACLI,OAAO,EAAE,IAAI;IACbC,uBAAuB,EAAE;EAC3B,CAAC;AACH,CAAC;AAED,OAAO,MAAMG,cAAc,GAAG;EAC5BzB;AACF,CAAC","ignoreList":[]}
|
package/lib/module/modules/questionnaire-response-form/utils/is-answerable-questionnaire-item.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const ANSWERABLE_ITEM_TYPES = new Set(["boolean", "choice", "date", "dateTime", "decimal", "integer", "string", "text", "time"]);
|
|
4
|
+
export const isAnswerableQuestionnaireItem = item => ANSWERABLE_ITEM_TYPES.has(item.type);
|
|
5
|
+
//# sourceMappingURL=is-answerable-questionnaire-item.js.map
|
package/lib/module/modules/questionnaire-response-form/utils/is-answerable-questionnaire-item.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ANSWERABLE_ITEM_TYPES","Set","isAnswerableQuestionnaireItem","item","has","type"],"sourceRoot":"../../../../../src","sources":["modules/questionnaire-response-form/utils/is-answerable-questionnaire-item.ts"],"mappings":";;AAEA,MAAMA,qBAAqB,GAAG,IAAIC,GAAG,CAA4B,CAC/D,SAAS,EACT,QAAQ,EACR,MAAM,EACN,UAAU,EACV,SAAS,EACT,SAAS,EACT,QAAQ,EACR,MAAM,EACN,MAAM,CACP,CAAC;AAEF,OAAO,MAAMC,6BAA6B,GACxCC,IAAuB,IACXH,qBAAqB,CAACI,GAAG,CAACD,IAAI,CAACE,IAAI,CAAC","ignoreList":[]}
|