@ovok/native 1.10.3 → 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/lib/commonjs/modules/auth/default-translation.js +17 -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/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 +1 -0
- package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-form-provider.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.map +1 -1
- package/lib/commonjs/modules/auth/session/session-store.js +36 -115
- package/lib/commonjs/modules/auth/session/session-store.js.map +1 -1
- package/lib/commonjs/modules/auth/utils/sign-in-error.js +4 -2
- package/lib/commonjs/modules/auth/utils/sign-in-error.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 +47 -21
- 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 +168 -5
- 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/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/prerequisite-gate.js +73 -0
- package/lib/commonjs/modules/ui/components/prerequisite-gate.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 +17 -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/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 +1 -0
- package/lib/module/modules/auth/reset-password/components/form/reset-password-form-provider.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.map +1 -1
- package/lib/module/modules/auth/session/session-store.js +36 -115
- package/lib/module/modules/auth/session/session-store.js.map +1 -1
- package/lib/module/modules/auth/utils/sign-in-error.js +4 -2
- package/lib/module/modules/auth/utils/sign-in-error.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 +47 -21
- 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 +168 -5
- 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/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/prerequisite-gate.js +67 -0
- package/lib/module/modules/ui/components/prerequisite-gate.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 +17 -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/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/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 +8 -2
- package/lib/typescript/commonjs/src/modules/auth/session/session-store-types.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/session/session-store.d.ts +1 -1
- 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 +2 -1
- package/lib/typescript/commonjs/src/modules/auth/utils/sign-in-error.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 +3 -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/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/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/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 +17 -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/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/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 +8 -2
- package/lib/typescript/module/src/modules/auth/session/session-store-types.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/session/session-store.d.ts +1 -1
- 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 +2 -1
- package/lib/typescript/module/src/modules/auth/utils/sign-in-error.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 +3 -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/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/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/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 +3 -3
package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-item-constraints.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getQuestionnaireItemConstraints = void 0;
|
|
7
|
+
const MIN_VALUE_URL = "http://hl7.org/fhir/StructureDefinition/minValue";
|
|
8
|
+
const MAX_VALUE_URL = "http://hl7.org/fhir/StructureDefinition/maxValue";
|
|
9
|
+
const SLIDER_STEP_URL = "http://hl7.org/fhir/StructureDefinition/questionnaire-sliderStepValue";
|
|
10
|
+
const MIN_QUANTITY_URL = "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-minQuantity";
|
|
11
|
+
const MAX_QUANTITY_URL = "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-maxQuantity";
|
|
12
|
+
const UNIT_OPTION_URL = "http://hl7.org/fhir/StructureDefinition/questionnaire-unitOption";
|
|
13
|
+
const UNIT_VALUE_SET_URL = "http://hl7.org/fhir/StructureDefinition/questionnaire-unitValueSet";
|
|
14
|
+
const UNIT_OPEN_URL = "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-unitOpen";
|
|
15
|
+
const MIN_LENGTH_URL = "http://hl7.org/fhir/StructureDefinition/minLength";
|
|
16
|
+
const getExtension = (item, url) => item.extension?.find(extension => extension.url === url);
|
|
17
|
+
const getExtensionValue = extension => {
|
|
18
|
+
if (!extension) {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
return extension.valueInteger ?? extension.valueDecimal ?? extension.valueDate ?? extension.valueDateTime ?? extension.valueTime ?? extension.valueQuantity ?? extension.valueCoding ?? extension.valueCanonical ?? extension.valueUri ?? extension.valueCode ?? extension.valueString;
|
|
22
|
+
};
|
|
23
|
+
const hasCalculatedValue = extension => {
|
|
24
|
+
if (!extension) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
const primitiveExtensions = Object.entries(extension).filter(([key]) => key.startsWith("_value")).flatMap(([, value]) => typeof value === "object" && value !== null && "extension" in value ? value.extension ?? [] : []);
|
|
28
|
+
const extensions = [...(extension.extension ?? []), ...primitiveExtensions];
|
|
29
|
+
return extensions.some(child => child.url === "http://hl7.org/fhir/StructureDefinition/cqf-calculatedValue");
|
|
30
|
+
};
|
|
31
|
+
const resolveBound = (key, extension, item, answers, resolver, unresolvedDynamicBounds) => {
|
|
32
|
+
if (!extension) {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
const resolved = resolver?.(extension, item, answers);
|
|
36
|
+
if (resolved !== undefined && resolved !== null) {
|
|
37
|
+
return resolved;
|
|
38
|
+
}
|
|
39
|
+
if (hasCalculatedValue(extension)) {
|
|
40
|
+
unresolvedDynamicBounds.push(key);
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
return getExtensionValue(extension);
|
|
44
|
+
};
|
|
45
|
+
const getQuestionnaireItemConstraints = (item, answers = {}, resolver, unitOptionsResolver) => {
|
|
46
|
+
const unresolvedDynamicBounds = [];
|
|
47
|
+
const minValue = resolveBound("minValue", getExtension(item, MIN_VALUE_URL), item, answers, resolver, unresolvedDynamicBounds);
|
|
48
|
+
const maxValue = resolveBound("maxValue", getExtension(item, MAX_VALUE_URL), item, answers, resolver, unresolvedDynamicBounds);
|
|
49
|
+
const minQuantity = resolveBound("minQuantity", getExtension(item, MIN_QUANTITY_URL), item, answers, resolver, unresolvedDynamicBounds);
|
|
50
|
+
const maxQuantity = resolveBound("maxQuantity", getExtension(item, MAX_QUANTITY_URL), item, answers, resolver, unresolvedDynamicBounds);
|
|
51
|
+
const step = getExtensionValue(getExtension(item, SLIDER_STEP_URL));
|
|
52
|
+
const minLength = getExtensionValue(getExtension(item, MIN_LENGTH_URL));
|
|
53
|
+
const unitOptions = (item.extension ?? []).flatMap(extension => extension.url === UNIT_OPTION_URL && extension.valueCoding ? [extension.valueCoding] : []);
|
|
54
|
+
const unitValueSet = getExtensionValue(getExtension(item, UNIT_VALUE_SET_URL));
|
|
55
|
+
const unitOpen = getExtensionValue(getExtension(item, UNIT_OPEN_URL));
|
|
56
|
+
const unitValueSetCanonical = typeof unitValueSet === "string" ? unitValueSet : undefined;
|
|
57
|
+
const expandedUnitOptions = unitValueSetCanonical ? unitOptionsResolver?.(unitValueSetCanonical, item, answers) : undefined;
|
|
58
|
+
const uniqueUnitOptions = [...new Map([...unitOptions, ...(expandedUnitOptions ?? [])].map(coding => [`${coding.system ?? ""}|${coding.code ?? coding.display ?? ""}`, coding])).values()];
|
|
59
|
+
return {
|
|
60
|
+
minValue: typeof minValue === "number" || typeof minValue === "string" ? minValue : undefined,
|
|
61
|
+
maxValue: typeof maxValue === "number" || typeof maxValue === "string" ? maxValue : undefined,
|
|
62
|
+
minQuantity: typeof minQuantity === "object" && minQuantity !== null ? minQuantity : undefined,
|
|
63
|
+
maxQuantity: typeof maxQuantity === "object" && maxQuantity !== null ? maxQuantity : undefined,
|
|
64
|
+
step: typeof step === "number" && step > 0 ? step : undefined,
|
|
65
|
+
minLength: typeof minLength === "number" ? minLength : undefined,
|
|
66
|
+
maxLength: item.maxLength,
|
|
67
|
+
unitOptions: uniqueUnitOptions,
|
|
68
|
+
unitValueSet: unitValueSetCanonical,
|
|
69
|
+
unitOpen: typeof unitOpen === "string" ? unitOpen : "optionsOnly",
|
|
70
|
+
unresolvedUnitValueSet: unitValueSetCanonical !== undefined && expandedUnitOptions === undefined,
|
|
71
|
+
unresolvedDynamicBounds
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
exports.getQuestionnaireItemConstraints = getQuestionnaireItemConstraints;
|
|
75
|
+
//# sourceMappingURL=questionnaire-item-constraints.js.map
|
package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-item-constraints.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MIN_VALUE_URL","MAX_VALUE_URL","SLIDER_STEP_URL","MIN_QUANTITY_URL","MAX_QUANTITY_URL","UNIT_OPTION_URL","UNIT_VALUE_SET_URL","UNIT_OPEN_URL","MIN_LENGTH_URL","getExtension","item","url","extension","find","getExtensionValue","undefined","valueInteger","valueDecimal","valueDate","valueDateTime","valueTime","valueQuantity","valueCoding","valueCanonical","valueUri","valueCode","valueString","hasCalculatedValue","primitiveExtensions","Object","entries","filter","key","startsWith","flatMap","value","extensions","some","child","resolveBound","answers","resolver","unresolvedDynamicBounds","resolved","push","getQuestionnaireItemConstraints","unitOptionsResolver","minValue","maxValue","minQuantity","maxQuantity","step","minLength","unitOptions","unitValueSet","unitOpen","unitValueSetCanonical","expandedUnitOptions","uniqueUnitOptions","Map","map","coding","system","code","display","values","maxLength","unresolvedUnitValueSet","exports"],"sourceRoot":"../../../../../src","sources":["modules/questionnaire-response-form/utils/questionnaire-item-constraints.ts"],"mappings":";;;;;;AAKA,MAAMA,aAAa,GAAG,kDAAkD;AACxE,MAAMC,aAAa,GAAG,kDAAkD;AAExE,MAAMC,eAAe,GACnB,uEAAuE;AAEzE,MAAMC,gBAAgB,GACpB,8EAA8E;AAEhF,MAAM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DH,MAAM,CACP,CACH,CAAC,CAACI,MAAM,CAAC,CAAC,CACX;EAED,OAAO;IACLlB,QAAQ,EACN,OAAOA,QAAQ,KAAK,QAAQ,IAAI,OAAOA,QAAQ,KAAK,QAAQ,GACxDA,QAAQ,GACRhC,SAAS;IACfiC,QAAQ,EACN,OAAOA,QAAQ,KAAK,QAAQ,IAAI,OAAOA,QAAQ,KAAK,QAAQ,GACxDA,QAAQ,GACRjC,SAAS;IACfkC,WAAW,EACT,OAAOA,WAAW,KAAK,QAAQ,IAAIA,WAAW,KAAK,IAAI,GAClDA,WAAW,GACZlC,SAAS;IACfmC,WAAW,EACT,OAAOA,WAAW,KAAK,QAAQ,IAAIA,WAAW,KAAK,IAAI,GAClDA,WAAW,GACZnC,SAAS;IACfoC,IAAI,EAAE,OAAOA,IAAI,KAAK,QAAQ,IAAIA,IAAI,GAAG,CAAC,GAAGA,IAAI,GAAGpC,SAAS;IAC7DqC,SAAS,EAAE,OAAOA,SAAS,KAAK,QAAQ,GAAGA,SAAS,GAAGrC,SAAS;IAChEmD,SAAS,EAAExD,IAAI,CAACwD,SAAS;IACzBb,WAAW,EAAEK,iBAAiB;IAC9BJ,YAAY,EAAEE,qBAAqB;IACnCD,QAAQ,EAAE,OAAOA,QAAQ,KAAK,QAAQ,GAAGA,QAAQ,GAAG,aAAa;IACjEY,sBAAsB,EACpBX,qBAAqB,KAAKzC,SAAS,IAAI0C,mBAAmB,KAAK1C,SAAS;IAC1E2B;EACF,CAAC;AACH,CAAC;AAAC0B,OAAA,CAAAvB,+BAAA,GAAAA,+BAAA","ignoreList":[]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.validateQuantityConstraints = exports.validateNumberConstraints = exports.validateAnswerLength = void 0;
|
|
7
|
+
const LENGTH_TYPES = new Set(["date", "dateTime", "decimal", "integer", "string", "text", "time", "url"]);
|
|
8
|
+
const hasSameUcumUnit = (value, bound) => value.system === "http://unitsofmeasure.org" && bound.system === "http://unitsofmeasure.org" && value.code === bound.code;
|
|
9
|
+
const validateAnswerLength = (value, answer, item, constraints) => {
|
|
10
|
+
if (constraints.minLength === undefined && constraints.maxLength === undefined || !LENGTH_TYPES.has(item.type)) {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
const textValue = typeof value === "string" ? value : String(answer);
|
|
14
|
+
return constraints.minLength !== undefined && textValue.length < constraints.minLength || constraints.maxLength !== undefined && textValue.length > constraints.maxLength ? "invalid-length" : undefined;
|
|
15
|
+
};
|
|
16
|
+
exports.validateAnswerLength = validateAnswerLength;
|
|
17
|
+
const validateNumberConstraints = (answer, constraints) => {
|
|
18
|
+
const min = typeof constraints.minValue === "number" ? constraints.minValue : undefined;
|
|
19
|
+
const max = typeof constraints.maxValue === "number" ? constraints.maxValue : undefined;
|
|
20
|
+
if (min !== undefined && max !== undefined && min > max || min !== undefined && answer < min || max !== undefined && answer > max) {
|
|
21
|
+
return "out-of-range";
|
|
22
|
+
}
|
|
23
|
+
if (constraints.step !== undefined) {
|
|
24
|
+
const baseline = min ?? 0;
|
|
25
|
+
const steps = (answer - baseline) / constraints.step;
|
|
26
|
+
if (Math.abs(steps - Math.round(steps)) > 1e-9) {
|
|
27
|
+
return "invalid-step";
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return undefined;
|
|
31
|
+
};
|
|
32
|
+
exports.validateNumberConstraints = validateNumberConstraints;
|
|
33
|
+
const validateQuantityConstraints = (answer, constraints) => {
|
|
34
|
+
if (constraints.unresolvedUnitValueSet) {
|
|
35
|
+
return "invalid-unit";
|
|
36
|
+
}
|
|
37
|
+
for (const bound of [constraints.minQuantity, constraints.maxQuantity]) {
|
|
38
|
+
if (!bound) {
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
if (!hasSameUcumUnit(answer, bound) || typeof answer.value !== "number" || typeof bound.value !== "number") {
|
|
42
|
+
return "invalid-unit";
|
|
43
|
+
}
|
|
44
|
+
if (bound === constraints.minQuantity && answer.value < bound.value || bound === constraints.maxQuantity && answer.value > bound.value) {
|
|
45
|
+
return "out-of-range";
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (constraints.minQuantity && constraints.maxQuantity && typeof constraints.minQuantity.value === "number" && typeof constraints.maxQuantity.value === "number" && constraints.minQuantity.value > constraints.maxQuantity.value) {
|
|
49
|
+
return "out-of-range";
|
|
50
|
+
}
|
|
51
|
+
if (constraints.unitOpen === "optionsOnly" && constraints.unitValueSet !== undefined && constraints.unitOptions.length === 0) {
|
|
52
|
+
return "invalid-unit";
|
|
53
|
+
}
|
|
54
|
+
if (constraints.unitOpen === "optionsOnly" && constraints.unitOptions.length > 0 && !constraints.unitOptions.some(({
|
|
55
|
+
system,
|
|
56
|
+
code
|
|
57
|
+
}) => system === answer.system && code === answer.code)) {
|
|
58
|
+
return "invalid-unit";
|
|
59
|
+
}
|
|
60
|
+
return undefined;
|
|
61
|
+
};
|
|
62
|
+
exports.validateQuantityConstraints = validateQuantityConstraints;
|
|
63
|
+
//# sourceMappingURL=questionnaire-item-value-constraint-validators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["LENGTH_TYPES","Set","hasSameUcumUnit","value","bound","system","code","validateAnswerLength","answer","item","constraints","minLength","undefined","maxLength","has","type","textValue","String","length","exports","validateNumberConstraints","min","minValue","max","maxValue","step","baseline","steps","Math","abs","round","validateQuantityConstraints","unresolvedUnitValueSet","minQuantity","maxQuantity","unitOpen","unitValueSet","unitOptions","some"],"sourceRoot":"../../../../../src","sources":["modules/questionnaire-response-form/utils/questionnaire-item-value-constraint-validators.ts"],"mappings":";;;;;;AAcA,MAAMA,YAAY,GAAG,IAAIC,GAAG,CAAC,CAC3B,MAAM,EACN,UAAU,EACV,SAAS,EACT,SAAS,EACT,QAAQ,EACR,MAAM,EACN,MAAM,EACN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AAW,CAACuB,WAAW,CAAC9B,KAAK,KAAK,QAAQ,IACjD,OAAOO,WAAW,CAACwB,WAAW,CAAC/B,KAAK,KAAK,QAAQ,IACjDO,WAAW,CAACuB,WAAW,CAAC9B,KAAK,GAAGO,WAAW,CAACwB,WAAW,CAAC/B,KAAK,EAC7D;IACA,OAAO,cAAc;EACvB;EAEA,IACEO,WAAW,CAACyB,QAAQ,KAAK,aAAa,IACtCzB,WAAW,CAAC0B,YAAY,KAAKxB,SAAS,IACtCF,WAAW,CAAC2B,WAAW,CAACnB,MAAM,KAAK,CAAC,EACpC;IACA,OAAO,cAAc;EACvB;EAEA,IACER,WAAW,CAACyB,QAAQ,KAAK,aAAa,IACtCzB,WAAW,CAAC2B,WAAW,CAACnB,MAAM,GAAG,CAAC,IAClC,CAACR,WAAW,CAAC2B,WAAW,CAACC,IAAI,CAC3B,CAAC;IAAEjC,MAAM;IAAEC;EAAK,CAAC,KAAKD,MAAM,KAAKG,MAAM,CAACH,MAAM,IAAIC,IAAI,KAAKE,MAAM,CAACF,IACpE,CAAC,EACD;IACA,OAAO,cAAc;EACvB;EAEA,OAAOM,SAAS;AAClB,CAAC;AAACO,OAAA,CAAAY,2BAAA,GAAAA,2BAAA","ignoreList":[]}
|
package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-navigation-utils.js
CHANGED
|
@@ -5,14 +5,37 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.QuestionnaireNavigationUtils = void 0;
|
|
7
7
|
var _conditionUtils = require("./condition-utils.js");
|
|
8
|
+
var _createAnswerFromValue = require("./create-answer-from-value.js");
|
|
9
|
+
var _isAnswerableQuestionnaireItem = require("./is-answerable-questionnaire-item.js");
|
|
10
|
+
const findNextEnabledPageIndex = (pages, startIndex, responses) => {
|
|
11
|
+
for (let pageIndex = startIndex; pageIndex < pages.length; pageIndex++) {
|
|
12
|
+
const page = pages[pageIndex];
|
|
13
|
+
if (page && _conditionUtils.ConditionUtils.getEnabledItemsForPage(page, responses).length) {
|
|
14
|
+
return pageIndex;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return undefined;
|
|
18
|
+
};
|
|
8
19
|
class QuestionnaireNavigationUtils {
|
|
9
|
-
static handleNext(currentPage, enabledItems, currentItem, currentItemIndex, currentPageIndex, pages, responses) {
|
|
10
|
-
if (!currentPage || !
|
|
20
|
+
static handleNext(currentPage, enabledItems, currentItem, currentItemIndex, currentPageIndex, pages, responses, renderItem) {
|
|
21
|
+
if (!currentPage || !pages[currentPageIndex]) {
|
|
11
22
|
return {
|
|
12
23
|
hasError: true
|
|
13
24
|
};
|
|
14
25
|
}
|
|
15
|
-
if (currentItem
|
|
26
|
+
if (!currentItem) {
|
|
27
|
+
if (enabledItems.length) {
|
|
28
|
+
return {
|
|
29
|
+
hasError: true,
|
|
30
|
+
errorMessage: "This question is required"
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const nextPageIndex = findNextEnabledPageIndex(pages, currentPageIndex + 1, responses);
|
|
34
|
+
return nextPageIndex === undefined ? {} : {
|
|
35
|
+
newPageIndex: nextPageIndex
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
if (currentItem.required && ((0, _isAnswerableQuestionnaireItem.isAnswerableQuestionnaireItem)(currentItem) || !!renderItem && currentItem.type !== "group" && currentItem.type !== "display") && !(0, _createAnswerFromValue.isQuestionnaireItemAnswered)(responses[currentItem.linkId || ""], currentItem)) {
|
|
16
39
|
return {
|
|
17
40
|
hasError: true,
|
|
18
41
|
errorMessage: "This question is required"
|
|
@@ -22,28 +45,36 @@ class QuestionnaireNavigationUtils {
|
|
|
22
45
|
return {
|
|
23
46
|
newItemIndex: currentItemIndex + 1
|
|
24
47
|
};
|
|
25
|
-
} else
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
48
|
+
} else {
|
|
49
|
+
const nextPageIndex = findNextEnabledPageIndex(pages, currentPageIndex + 1, responses);
|
|
50
|
+
if (nextPageIndex !== undefined) {
|
|
51
|
+
return {
|
|
52
|
+
newPageIndex: nextPageIndex
|
|
53
|
+
};
|
|
54
|
+
}
|
|
29
55
|
}
|
|
30
56
|
return {};
|
|
31
57
|
}
|
|
32
58
|
static handlePrevious(currentItemIndex, currentPageIndex, pages, responses) {
|
|
33
|
-
|
|
59
|
+
const currentPage = pages[currentPageIndex];
|
|
60
|
+
const currentPageItems = currentPage ? _conditionUtils.ConditionUtils.getEnabledItemsForPage(currentPage, responses) : [];
|
|
61
|
+
if (currentItemIndex > 0 && currentPageItems.length) {
|
|
34
62
|
return {
|
|
35
|
-
newItemIndex: currentItemIndex - 1
|
|
63
|
+
newItemIndex: Math.min(currentItemIndex - 1, currentPageItems.length - 1)
|
|
36
64
|
};
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
65
|
+
}
|
|
66
|
+
for (let pageIndex = currentPageIndex - 1; pageIndex >= 0; pageIndex--) {
|
|
67
|
+
const page = pages[pageIndex];
|
|
68
|
+
if (!page) {
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
const previousItems = _conditionUtils.ConditionUtils.getEnabledItemsForPage(page, responses);
|
|
72
|
+
if (previousItems.length) {
|
|
73
|
+
return {
|
|
74
|
+
newPageIndex: pageIndex,
|
|
75
|
+
lastItemIndex: previousItems.length - 1
|
|
76
|
+
};
|
|
41
77
|
}
|
|
42
|
-
const prevPageEnabledItems = _conditionUtils.ConditionUtils.getEnabledItemsForPage(prevPage, responses);
|
|
43
|
-
return {
|
|
44
|
-
newPageIndex: currentPageIndex - 1,
|
|
45
|
-
lastItemIndex: prevPageEnabledItems.length ? prevPageEnabledItems.length - 1 : 0
|
|
46
|
-
};
|
|
47
78
|
}
|
|
48
79
|
return {};
|
|
49
80
|
}
|
package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-navigation-utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_conditionUtils","require","QuestionnaireNavigationUtils","handleNext","currentPage","enabledItems","currentItem","currentItemIndex","currentPageIndex","
|
|
1
|
+
{"version":3,"names":["_conditionUtils","require","_createAnswerFromValue","_isAnswerableQuestionnaireItem","findNextEnabledPageIndex","pages","startIndex","responses","pageIndex","length","page","ConditionUtils","getEnabledItemsForPage","undefined","QuestionnaireNavigationUtils","handleNext","currentPage","enabledItems","currentItem","currentItemIndex","currentPageIndex","renderItem","hasError","errorMessage","nextPageIndex","newPageIndex","required","isAnswerableQuestionnaireItem","type","isQuestionnaireItemAnswered","linkId","newItemIndex","handlePrevious","currentPageItems","Math","min","previousItems","lastItemIndex","exports"],"sourceRoot":"../../../../../src","sources":["modules/questionnaire-response-form/utils/questionnaire-navigation-utils.ts"],"mappings":";;;;;;AAIA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AACA,IAAAE,8BAAA,GAAAF,OAAA;AAUA,MAAMG,wBAAwB,GAAGA,CAC/BC,KAAkC,EAClCC,UAAkB,EAClBC,SAAyB,KACF;EACvB,KAAK,IAAIC,SAAS,GAAGF,UAAU,EAAEE,SAAS,GAAGH,KAAK,CAACI,MAAM,EAAED,SAAS,EAAE,EAAE;IACtE,MAAME,IAAI,GAAGL,KAAK,CAACG,SAAS,CAAC;IAE7B,IAAIE,IAAI,IAAIC,8BAAc,CAACC,sBAAsB,CAACF,IAAI,EAAEH,SAAS,CAAC,CAACE,MAAM,EAAE;MACzE,OAAOD,SAAS;IAClB;EACF;EAEA,OAAOK,SAAS;AAClB,CAAC;AAEM,MAAMC,4BAA4B,CAAC;EACxC,OAAOC,UAAUA,CACfC,WAAkD,EAClDC,YAAyC,EACzCC,WAAkD,EAClDC,gBAAwB,EACxBC,gBAAwB,EACxBf,KAAkC,EAClCE,SAAyB,EACzBc,UAAsC,EACpB;IAClB,IAAI,CAACL,WAAW,IAAI,CAACX,KAAK,CAACe,gBAAgB,CAAC,EAAE;MAC5C,OAAO;QAAEE,QAAQ,EAAE;MA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gB,GAAGjB,WAAW,GAChCL,8BAAc,CAACC,sBAAsB,CAACI,WAAW,EAAET,SAAS,CAAC,GAC7D,EAAE;IAEN,IAAIY,gBAAgB,GAAG,CAAC,IAAIc,gBAAgB,CAACxB,MAAM,EAAE;MACnD,OAAO;QACLsB,YAAY,EAAEG,IAAI,CAACC,GAAG,CACpBhB,gBAAgB,GAAG,CAAC,EACpBc,gBAAgB,CAACxB,MAAM,GAAG,CAC5B;MACF,CAAC;IACH;IAEA,KAAK,IAAID,SAAS,GAAGY,gBAAgB,GAAG,CAAC,EAAEZ,SAAS,IAAI,CAAC,EAAEA,SAAS,EAAE,EAAE;MACtE,MAAME,IAAI,GAAGL,KAAK,CAACG,SAAS,CAAC;MAE7B,IAAI,CAACE,IAAI,EAAE;QACT;MACF;MAEA,MAAM0B,aAAa,GAAGzB,8BAAc,CAACC,sBAAsB,CACzDF,IAAI,EACJH,SACF,CAAC;MAED,IAAI6B,aAAa,CAAC3B,MAAM,EAAE;QACxB,OAAO;UACLgB,YAAY,EAAEjB,SAAS;UACvB6B,aAAa,EAAED,aAAa,CAAC3B,MAAM,GAAG;QACxC,CAAC;MACH;IACF;IAEA,OAAO,CAAC,CAAC;EACX;AACF;AAAC6B,OAAA,CAAAxB,4BAAA,GAAAA,4BAAA","ignoreList":[]}
|
package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-picker-options.js
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getQuestionnaireNumericPickerOptions = exports.getQuestionnaireAnswerPickerOptions = void 0;
|
|
7
|
+
var _getOptionText = require("./fields/get-option-text.js");
|
|
8
|
+
const getQuestionnaireNumericPickerOptions = (item, constraints, locale, maximumOptions = 1000) => {
|
|
9
|
+
const {
|
|
10
|
+
minValue,
|
|
11
|
+
maxValue
|
|
12
|
+
} = constraints;
|
|
13
|
+
if (item.type !== "integer" && item.type !== "decimal" || typeof minValue !== "number" || typeof maxValue !== "number" || !Number.isFinite(minValue) || !Number.isFinite(maxValue) || maxValue < minValue || !Number.isInteger(maximumOptions) || maximumOptions < 1 || maximumOptions > 5000) {
|
|
14
|
+
return [];
|
|
15
|
+
}
|
|
16
|
+
const step = constraints.step ?? (item.type === "integer" ? 1 : undefined);
|
|
17
|
+
if (step === undefined || !Number.isFinite(step) || step <= 0) {
|
|
18
|
+
return [];
|
|
19
|
+
}
|
|
20
|
+
if (item.type === "integer" && ![minValue, maxValue, step].every(Number.isInteger)) {
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
const precision = Math.min(12, Math.max(...[minValue, maxValue, step].map(number => {
|
|
24
|
+
const decimalPart = String(number).split(".")[1];
|
|
25
|
+
return decimalPart?.length ?? 0;
|
|
26
|
+
})));
|
|
27
|
+
const scale = 10 ** precision;
|
|
28
|
+
const start = Math.round(minValue * scale);
|
|
29
|
+
const end = Math.round(maxValue * scale);
|
|
30
|
+
const increment = Math.round(step * scale);
|
|
31
|
+
if (increment <= 0) {
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
34
|
+
const count = Math.floor((end - start) / increment + 1e-9) + 1;
|
|
35
|
+
if (count > maximumOptions) {
|
|
36
|
+
return [];
|
|
37
|
+
}
|
|
38
|
+
const formatter = new Intl.NumberFormat(locale, {
|
|
39
|
+
maximumFractionDigits: precision
|
|
40
|
+
});
|
|
41
|
+
return Array.from({
|
|
42
|
+
length: count
|
|
43
|
+
}, (_, index) => {
|
|
44
|
+
const value = (start + index * increment) / scale;
|
|
45
|
+
return {
|
|
46
|
+
label: formatter.format(value),
|
|
47
|
+
value
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
exports.getQuestionnaireNumericPickerOptions = getQuestionnaireNumericPickerOptions;
|
|
52
|
+
const getOptionAnswer = option => {
|
|
53
|
+
if (option.valueCoding !== undefined) {
|
|
54
|
+
return {
|
|
55
|
+
valueCoding: option.valueCoding
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
if (option.valueReference !== undefined) {
|
|
59
|
+
return {
|
|
60
|
+
valueReference: option.valueReference
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
if (option.valueInteger !== undefined) {
|
|
64
|
+
return {
|
|
65
|
+
valueInteger: option.valueInteger
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
if (option.valueDate !== undefined) {
|
|
69
|
+
return {
|
|
70
|
+
valueDate: option.valueDate
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
if (option.valueTime !== undefined) {
|
|
74
|
+
return {
|
|
75
|
+
valueTime: option.valueTime
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
if (option.valueString !== undefined) {
|
|
79
|
+
return {
|
|
80
|
+
valueString: option.valueString
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
return undefined;
|
|
84
|
+
};
|
|
85
|
+
const getOptionLabel = (option, locale) => {
|
|
86
|
+
const localizedLabel = (0, _getOptionText.getOptionText)(option, locale);
|
|
87
|
+
if (localizedLabel) {
|
|
88
|
+
return localizedLabel;
|
|
89
|
+
}
|
|
90
|
+
if (option.valueInteger !== undefined) {
|
|
91
|
+
return String(option.valueInteger);
|
|
92
|
+
}
|
|
93
|
+
if (option.valueDate !== undefined) {
|
|
94
|
+
return option.valueDate;
|
|
95
|
+
}
|
|
96
|
+
if (option.valueTime !== undefined) {
|
|
97
|
+
return option.valueTime;
|
|
98
|
+
}
|
|
99
|
+
if (option.valueReference?.display) {
|
|
100
|
+
return option.valueReference.display;
|
|
101
|
+
}
|
|
102
|
+
return option.valueReference?.reference ?? "";
|
|
103
|
+
};
|
|
104
|
+
const getQuestionnaireAnswerPickerOptions = (item, locale) => {
|
|
105
|
+
if (item.type !== "choice" && item.type !== "open-choice") {
|
|
106
|
+
return [];
|
|
107
|
+
}
|
|
108
|
+
return (item.answerOption ?? []).flatMap(option => {
|
|
109
|
+
const value = getOptionAnswer(option);
|
|
110
|
+
return value ? [{
|
|
111
|
+
label: getOptionLabel(option, locale),
|
|
112
|
+
value
|
|
113
|
+
}] : [];
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
exports.getQuestionnaireAnswerPickerOptions = getQuestionnaireAnswerPickerOptions;
|
|
117
|
+
//# sourceMappingURL=questionnaire-picker-options.js.map
|
package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-picker-options.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_getOptionText","require","getQuestionnaireNumericPickerOptions","item","constraints","locale","maximumOptions","minValue","maxValue","type","Number","isFinite","isInteger","step","undefined","every","precision","Math","min","max","map","number","decimalPart","String","split","length","scale","start","round","end","increment","count","floor","formatter","Intl","NumberFormat","maximumFractionDigits","Array","from","_","index","value","label","format","exports","getOptionAnswer","option","valueCoding","valueReference","valueInteger","valueDate","valueTime","valueString","getOptionLabel","localizedLabel","getOptionText","display","reference","getQuestionnaireAnswerPickerOptions","answerOption","flatMap"],"sourceRoot":"../../../../../src","sources":["modules/questionnaire-response-form/utils/questionnaire-picker-options.ts"],"mappings":";;;;;;AAOA,IAAAA,cAAA,GAAAC,OAAA;AAaA,MAAMC,oCAAoC,GAAGA,CAC3CC,IAA+B,EAC/BC,WAAyC,EACzCC,MAAe,EACfC,cAAc,GAAG,IAAI,KACkB;EACvC,MAAM;IAAEC,QAAQ;IAAEC;EAAS,CAAC,GAAGJ,WAAW;EAE1C,IACGD,IAAI,CAACM,IAAI,KAAK,SAAS,IAAIN,IAAI,CAACM,IAAI,KAAK,SAAS,IACnD,OAAOF,QAAQ,KAAK,QAAQ,IAC5B,OAAOC,QAAQ,KAAK,QAAQ,IAC5B,CAACE,MAAM,CAACC,QAAQ,CAACJ,QAAQ,CAAC,IAC1B,CAACG,MAAM,CAACC,QAAQ,CAACH,QAAQ,CAAC,IAC1BA,QAAQ,GAAGD,QAAQ,IACnB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CAAC,CAAC,GAAG,EAAE;EACxE,CAAC,CAAC;AACJ,CAAC;AAACG,OAAA,CAAAc,mCAAA,GAAAA,mCAAA","ignoreList":[]}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.validateStringConstraints = void 0;
|
|
7
|
+
const compare = (value, bound) => {
|
|
8
|
+
if (typeof value === "number" && typeof bound === "number") {
|
|
9
|
+
return value - bound;
|
|
10
|
+
}
|
|
11
|
+
if (typeof value === "string" && typeof bound === "string") {
|
|
12
|
+
if (/^\d{4}(?:-\d{2}){0,2}$/.test(value) && /^\d{4}(?:-\d{2}){0,2}$/.test(bound)) {
|
|
13
|
+
return value.localeCompare(bound);
|
|
14
|
+
}
|
|
15
|
+
if (value.includes("T") && bound.includes("T")) {
|
|
16
|
+
const valueTime = Date.parse(value);
|
|
17
|
+
const boundTime = Date.parse(bound);
|
|
18
|
+
if (Number.isFinite(valueTime) && Number.isFinite(boundTime)) {
|
|
19
|
+
return valueTime - boundTime;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return value.localeCompare(bound);
|
|
23
|
+
}
|
|
24
|
+
return Number.NaN;
|
|
25
|
+
};
|
|
26
|
+
const getDateInterval = value => {
|
|
27
|
+
if (value.includes("T")) {
|
|
28
|
+
const timestamp = Date.parse(value);
|
|
29
|
+
return Number.isFinite(timestamp) ? {
|
|
30
|
+
start: timestamp,
|
|
31
|
+
end: timestamp
|
|
32
|
+
} : undefined;
|
|
33
|
+
}
|
|
34
|
+
const match = /^(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?$/.exec(value);
|
|
35
|
+
if (!match) {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
const year = Number(match[1]);
|
|
39
|
+
const month = Number(match[2] ?? 1);
|
|
40
|
+
const startDay = Number(match[3] ?? 1);
|
|
41
|
+
const endDay = match[3] ? startDay : match[2] ? new Date(year, month, 0).getDate() : 31;
|
|
42
|
+
const start = new Date(year, month - 1, startDay).getTime();
|
|
43
|
+
const end = new Date(year, match[2] ? month - 1 : 11, endDay, 23, 59, 59, 999).getTime();
|
|
44
|
+
return {
|
|
45
|
+
start,
|
|
46
|
+
end
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
const getTimeValue = value => {
|
|
50
|
+
const match = /^(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?$/.exec(value);
|
|
51
|
+
if (!match) {
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
const hours = Number(match[1]);
|
|
55
|
+
const minutes = Number(match[2]);
|
|
56
|
+
const seconds = Number(match[3] ?? 0);
|
|
57
|
+
if (hours > 23 || minutes > 59 || seconds > 59) {
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
const fractionalSeconds = match[4] ? Number(`0.${match[4]}`) : 0;
|
|
61
|
+
return hours * 3600 + minutes * 60 + seconds + fractionalSeconds;
|
|
62
|
+
};
|
|
63
|
+
const validateDateConstraints = (answer, constraints) => {
|
|
64
|
+
const {
|
|
65
|
+
minValue: min,
|
|
66
|
+
maxValue: max
|
|
67
|
+
} = constraints;
|
|
68
|
+
const answerInterval = getDateInterval(answer);
|
|
69
|
+
const minInterval = typeof min === "string" ? getDateInterval(min) : undefined;
|
|
70
|
+
const maxInterval = typeof max === "string" ? getDateInterval(max) : undefined;
|
|
71
|
+
if (!answerInterval || min !== undefined && !minInterval || max !== undefined && !maxInterval) {
|
|
72
|
+
return "invalid-answer";
|
|
73
|
+
}
|
|
74
|
+
return minInterval && answerInterval.start < minInterval.start || maxInterval && answerInterval.end > maxInterval.end ? "out-of-range" : undefined;
|
|
75
|
+
};
|
|
76
|
+
const validateTimeConstraints = (answer, constraints) => {
|
|
77
|
+
const {
|
|
78
|
+
minValue: min,
|
|
79
|
+
maxValue: max
|
|
80
|
+
} = constraints;
|
|
81
|
+
const answerTime = getTimeValue(answer);
|
|
82
|
+
const minTime = typeof min === "string" ? getTimeValue(min) : undefined;
|
|
83
|
+
const maxTime = typeof max === "string" ? getTimeValue(max) : undefined;
|
|
84
|
+
if (answerTime === undefined || min !== undefined && minTime === undefined || max !== undefined && maxTime === undefined) {
|
|
85
|
+
return "invalid-answer";
|
|
86
|
+
}
|
|
87
|
+
return minTime !== undefined && answerTime < minTime || maxTime !== undefined && answerTime > maxTime ? "out-of-range" : undefined;
|
|
88
|
+
};
|
|
89
|
+
const validateOtherStringConstraints = (answer, constraints) => {
|
|
90
|
+
const {
|
|
91
|
+
minValue: min,
|
|
92
|
+
maxValue: max
|
|
93
|
+
} = constraints;
|
|
94
|
+
if (min !== undefined && max !== undefined && compare(min, max) > 0) {
|
|
95
|
+
return "out-of-range";
|
|
96
|
+
}
|
|
97
|
+
return min !== undefined && compare(answer, min) < 0 || max !== undefined && compare(answer, max) > 0 ? "out-of-range" : undefined;
|
|
98
|
+
};
|
|
99
|
+
const validateStringConstraints = (answer, item, constraints) => {
|
|
100
|
+
if (item.type === "date" || item.type === "dateTime") {
|
|
101
|
+
return validateDateConstraints(answer, constraints);
|
|
102
|
+
}
|
|
103
|
+
if (item.type === "time") {
|
|
104
|
+
return validateTimeConstraints(answer, constraints);
|
|
105
|
+
}
|
|
106
|
+
return validateOtherStringConstraints(answer, constraints);
|
|
107
|
+
};
|
|
108
|
+
exports.validateStringConstraints = validateStringConstraints;
|
|
109
|
+
//# sourceMappingURL=questionnaire-string-constraint-validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["compare","value","bound","test","localeCompare","includes","valueTime","Date","parse","boundTime","Number","isFinite","NaN","getDateInterval","timestamp","start","end","undefined","match","exec","year","month","startDay","endDay","getDate","getTime","getTimeValue","hours","minutes","seconds","fractionalSeconds","validateDateConstraints","answer","constraints","minValue","min","maxValue","max","answerInterval","minInterval","maxInterval","validateTimeConstraints","answerTime","minTime","maxTime","validateOtherStringConstraints","validateStringConstraints","item","type","exports"],"sourceRoot":"../../../../../src","sources":["modules/questionnaire-response-form/utils/questionnaire-string-constraint-validator.ts"],"mappings":";;;;;;AAIA,MAAMA,OAAO,GAAGA,CAACC,KAAsB,EAAEC,KAAsB,KAAa;EAC1E,IAAI,OAAOD,KAAK,KAAK,QAAQ,IAAI,OAAOC,KAAK,KAAK,QAAQ,EAAE;IAC1D,OAAOD,KAAK,GAAGC,KAAK;EACtB;EAEA,IAAI,OAAOD,KAAK,KAAK,QAAQ,IAAI,OAAOC,KAAK,KAAK,QAAQ,EAAE;IAC1D,IACE,wBAAwB,CAACC,IAAI,CAACF,KAAK,CAAC,IACpC,wBAAwB,CAACE,IAAI,CAACD,KAAK,CAAC,EACpC;MACA,OAAOD,KAAK,CAACG,aAAa,CAACF,KAAK,CAAC;IACnC;IAEA,IAAID,KAAK,CAACI,QAAQ,CAAC,GAAG,CAAC,IAAIH,KAAK,CAACG,QAAQ,CAAC,GAAG,CAAC,EAAE;MAC9C,MAAMC,SAAS,GAAGC,IAAI,CAACC,KAAK,CAACP,KAAK,CAAC;MACnC,MAAMQ,SAAS,GAAGF,IAAI,CAACC,KAAK,CAACN,KAAK,CAAC;MAEnC,IAAIQ,MAAM,CAACC,QAAQ,CAACL,SAAS,CAAC,IAAII,MAAM,CAACC,QAAQ,CAACF,SAAS,CAAC,EAAE;QAC5D,OAAOH,SAAS,GAAGG,SAAS;MAC9B;IACF;IAEA,OAAOR,KAAK,CAACG,aAAa,CAACF,KAAK,CAAC;EACnC;EAEA,OAAOQ,MAAM,CAACE,GAAG;AACnB,CAAC;AAED,MAAMC,eAAe,GACnBZ,KAAa,IACkC;EAC/C,IAAIA,KAAK,CAACI,QAAQ,CAAC,GAAG,CAAC,EAAE;IACvB,MAAMS,SAAS,GAAGP,IAAI,CAACC,KAAK,CAACP,KAAK,CAAC;IAEnC,OAAOS,MAAM,CAACC,QAAQ,CAACG,SAAS,CAAC,GAC7B;MAAEC,KAAK,EAAED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SAAS;AACf,CAAC;AAED,MAAM6B,yBAAyB,GAAGA,CAChCd,MAAc,EACde,IAA+B,EAC/Bd,WAAyC,KACS;EAClD,IAAIc,IAAI,CAACC,IAAI,KAAK,MAAM,IAAID,IAAI,CAACC,IAAI,KAAK,UAAU,EAAE;IACpD,OAAOjB,uBAAuB,CAACC,MAAM,EAAEC,WAAW,CAAC;EACrD;EAEA,IAAIc,IAAI,CAACC,IAAI,KAAK,MAAM,EAAE;IACxB,OAAOP,uBAAuB,CAACT,MAAM,EAAEC,WAAW,CAAC;EACrD;EAEA,OAAOY,8BAA8B,CAACb,MAAM,EAAEC,WAAW,CAAC;AAC5D,CAAC;AAACgB,OAAA,CAAAH,yBAAA,GAAAA,yBAAA","ignoreList":[]}
|
package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-submit-utils.js
CHANGED
|
@@ -6,12 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.QuestionnaireSubmitUtils = void 0;
|
|
7
7
|
var _formUtils = require("./form-utils.js");
|
|
8
8
|
class QuestionnaireSubmitUtils {
|
|
9
|
-
static createQuestionnaireResponse(responses, pages, questionnaire) {
|
|
9
|
+
static createQuestionnaireResponse(responses, pages, questionnaire, renderItem, resolver, unitOptionsResolver) {
|
|
10
10
|
const responseItems = _formUtils.FormUtils.createQuestionnaireResponseItems(responses, pages);
|
|
11
11
|
const response = {
|
|
12
12
|
resourceType: "QuestionnaireResponse",
|
|
13
13
|
questionnaire: `Questionnaire/${questionnaire.id}`,
|
|
14
|
-
status: "completed",
|
|
14
|
+
status: _formUtils.FormUtils.hasUnansweredRequiredItems(pages, responses, renderItem, resolver, unitOptionsResolver) ? "in-progress" : "completed",
|
|
15
15
|
item: responseItems,
|
|
16
16
|
authored: new Date().toISOString()
|
|
17
17
|
};
|
package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-submit-utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_formUtils","require","QuestionnaireSubmitUtils","createQuestionnaireResponse","responses","pages","questionnaire","responseItems","FormUtils","createQuestionnaireResponseItems","response","resourceType","id","status","item","authored","Date","toISOString","exports"],"sourceRoot":"../../../../../src","sources":["modules/questionnaire-response-form/utils/questionnaire-submit-utils.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"names":["_formUtils","require","QuestionnaireSubmitUtils","createQuestionnaireResponse","responses","pages","questionnaire","renderItem","resolver","unitOptionsResolver","responseItems","FormUtils","createQuestionnaireResponseItems","response","resourceType","id","status","hasUnansweredRequiredItems","item","authored","Date","toISOString","exports"],"sourceRoot":"../../../../../src","sources":["modules/questionnaire-response-form/utils/questionnaire-submit-utils.ts"],"mappings":";;;;;;AAMA,IAAAA,UAAA,GAAAC,OAAA;AAMO,MAAMC,wBAAwB,CAAC;EACpC,OAAOC,2BAA2BA,CAChCC,SAAyB,EACzBC,KAAkC,EAClCC,aAA4B,EAC5BC,UAAsC,EACtCC,QAA0C,EAC1CC,mBAAsD,EAC/B;IACvB,MAAMC,aAAa,GAAGC,oBAAS,CAACC,gCAAgC,CAC9DR,SAAS,EACTC,KACF,CAAC;IAED,MAAMQ,QAA+B,GAAG;MACtCC,YAAY,EAAE,uBAAuB;MACrCR,aAAa,EAAE,iBAAiBA,aAAa,CAACS,EAAE,EAAE;MAClDC,MAAM,EAAEL,oBAAS,CAACM,0BAA0B,CAC1CZ,KAAK,EACLD,SAAS,EACTG,UAAU,EACVC,QAAQ,EACRC,mBACF,CAAC,GACG,aAAa,GACb,WAAW;MACfS,IAAI,EAAER,aAAa;MACnBS,QAAQ,EAAE,IAAIC,IAAI,CAAC,CAAC,CAACC,WAAW,CAAC;IACnC,CAAC;IAED,OAAOR,QAAQ;EACjB;AACF;AAACS,OAAA,CAAApB,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.translateFhirText = void 0;
|
|
7
|
+
const TRANSLATION_EXTENSION = "http://hl7.org/fhir/StructureDefinition/translation";
|
|
8
|
+
const normalizeLanguage = language => language.trim().replace(/_/g, "-").toLowerCase();
|
|
9
|
+
|
|
10
|
+
/** Resolves the standard FHIR translation extension for a primitive string. */
|
|
11
|
+
const translateFhirText = (value, element, language) => {
|
|
12
|
+
const requestedLanguage = normalizeLanguage(language ?? "");
|
|
13
|
+
const requestedBaseLanguage = requestedLanguage.split("-")[0];
|
|
14
|
+
const translations = (element?.extension ?? []).filter(({
|
|
15
|
+
url
|
|
16
|
+
}) => url === TRANSLATION_EXTENSION).map(({
|
|
17
|
+
extension = []
|
|
18
|
+
}) => {
|
|
19
|
+
const translationLanguage = extension.find(({
|
|
20
|
+
url
|
|
21
|
+
}) => url === "lang")?.valueCode;
|
|
22
|
+
const content = extension.find(({
|
|
23
|
+
url
|
|
24
|
+
}) => url === "content");
|
|
25
|
+
const translatedValue = content?.valueString ?? content?.valueMarkdown;
|
|
26
|
+
return typeof translationLanguage === "string" && typeof translatedValue === "string" ? {
|
|
27
|
+
language: normalizeLanguage(translationLanguage),
|
|
28
|
+
value: translatedValue
|
|
29
|
+
} : undefined;
|
|
30
|
+
}).filter(translation => translation !== undefined);
|
|
31
|
+
const exactTranslation = translations.find(translation => translation.language === requestedLanguage);
|
|
32
|
+
const baseTranslation = translations.find(translation => translation.language.split("-")[0] === requestedBaseLanguage);
|
|
33
|
+
return exactTranslation?.value ?? baseTranslation?.value ?? value ?? "";
|
|
34
|
+
};
|
|
35
|
+
exports.translateFhirText = translateFhirText;
|
|
36
|
+
//# sourceMappingURL=translate-fhir-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TRANSLATION_EXTENSION","normalizeLanguage","language","trim","replace","toLowerCase","translateFhirText","value","element","requestedLanguage","requestedBaseLanguage","split","translations","extension","filter","url","map","translationLanguage","find","valueCode","content","translatedValue","valueString","valueMarkdown","undefined","translation","exactTranslation","baseTranslation","exports"],"sourceRoot":"../../../../../src","sources":["modules/questionnaire-response-form/utils/translate-fhir-text.ts"],"mappings":";;;;;;AAEA,MAAMA,qBAAqB,GACzB,qDAAqD;AAEvD,MAAMC,iBAAiB,GAAIC,QAAgB,IACzCA,QAAQ,CAACC,IAAI,CAAC,CAAC,CAACC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAACC,WAAW,CAAC,CAAC;;AAElD;AACO,MAAMC,iBAAiB,GAAGA,CAC/BC,KAAyB,EACzBC,OAA4B,EAC5BN,QAA4B,KACjB;EACX,MAAMO,iBAAiB,GAAGR,iBAAiB,CAACC,QAAQ,IAAI,EAAE,CAAC;EAC3D,MAAMQ,qBAAqB,GAAGD,iBAAiB,CAACE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;EAE7D,MAAMC,YAAY,GAAG,CAACJ,OAAO,EAAEK,SAAS,IAAI,EAAE,EAC3CC,MAAM,CAAC,CAAC;IAAEC;EAAI,CAAC,KAAKA,GAAG,KAAKf,qBAAqB,CAAC,CAClDgB,GAAG,CAAC,CAAC;IAAEH,SAAS,GAAG;EAAG,CAAC,KAAK;IAC3B,MAAMI,mBAAmB,GAAGJ,SAAS,CAACK,IAAI,CACxC,CAAC;MAAEH;IAAI,CAAC,KAAKA,GAAG,KAAK,MACvB,CAAC,EAAEI,SAAS;IAEZ,MAAMC,OAAO,GAAGP,SAAS,CAACK,IAAI,CAAC,CAAC;MAAEH;IAAI,CAAC,KAAKA,GAAG,KAAK,SAAS,CAAC;IAC9D,MAAMM,eAAe,GAAGD,OAAO,EAAEE,WAAW,IAAIF,OAAO,EAAEG,aAAa;IAEtE,OAAO,OAAON,mBAAmB,KAAK,QAAQ,IAC5C,OAAOI,eAAe,KAAK,QAAQ,GACjC;MAAEnB,QAAQ,EAAED,iBAAiB,CAACgB,mBAAmB,CAAC;MAAEV,KAAK,EAAEc;IAAgB,CAAC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