@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,33 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
/* eslint-disable import/group-exports */
|
|
4
|
-
|
|
5
3
|
import * as React from "react";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { toBluetoothError } from "../types/bluetooth-error.js";
|
|
5
|
+
import { getDeclinedDeviceState, loadDeclinedDeviceIds, publishDeclinedDeviceIds, updateDeclinedDeviceIds } from "./declined-device-storage.js";
|
|
6
|
+
import { getDismissedLater, notNearbyError } from "./nearby-device-offer-state.js";
|
|
8
7
|
import { useBluetoothRuntime, useBluetoothSelector } from "./runtime-context.js";
|
|
9
8
|
import { useNearbyDevices } from "./use-nearby-devices.js";
|
|
10
9
|
import { DEFAULT_PAIRED_DEVICE_STORAGE_KEY, usePairedDevices } from "./use-paired-devices.js";
|
|
11
|
-
const dismissedLaterByRuntime = new WeakMap();
|
|
12
|
-
const getDismissedLater = (runtime, storageKey) => {
|
|
13
|
-
let byStorageKey = dismissedLaterByRuntime.get(runtime);
|
|
14
|
-
if (!byStorageKey) {
|
|
15
|
-
byStorageKey = new Map();
|
|
16
|
-
dismissedLaterByRuntime.set(runtime, byStorageKey);
|
|
17
|
-
}
|
|
18
|
-
let dismissed = byStorageKey.get(storageKey);
|
|
19
|
-
if (!dismissed) {
|
|
20
|
-
dismissed = new Set();
|
|
21
|
-
byStorageKey.set(storageKey, dismissed);
|
|
22
|
-
}
|
|
23
|
-
return dismissed;
|
|
24
|
-
};
|
|
25
|
-
const notNearbyError = () => new BluetoothError(BluetoothErrorCode.CONNECTION_FAILED, "The device is no longer nearby.");
|
|
26
10
|
export const useNearbyDeviceOffer = ({
|
|
27
11
|
storage,
|
|
28
12
|
storageKey = DEFAULT_PAIRED_DEVICE_STORAGE_KEY,
|
|
29
13
|
declinedStorageKey = `${storageKey}.declined-nearby-devices`,
|
|
30
14
|
enabled = true,
|
|
15
|
+
shouldOffer,
|
|
31
16
|
onPaired,
|
|
32
17
|
onError
|
|
33
18
|
}) => {
|
|
@@ -43,7 +28,8 @@ export const useNearbyDeviceOffer = ({
|
|
|
43
28
|
storage,
|
|
44
29
|
storageKey
|
|
45
30
|
});
|
|
46
|
-
const
|
|
31
|
+
const declinedState = React.useMemo(() => getDeclinedDeviceState(runtime, declinedStorageKey), [runtime, declinedStorageKey]);
|
|
32
|
+
const declinedIds = declinedState.ids;
|
|
47
33
|
const [status, setStatus] = React.useState("idle");
|
|
48
34
|
const [error, setError] = React.useState(undefined);
|
|
49
35
|
const [, redraw] = React.useReducer(value => value + 1, 0);
|
|
@@ -56,11 +42,9 @@ export const useNearbyDeviceOffer = ({
|
|
|
56
42
|
const pairedIdsLoaded = runtime.getPairedDeviceIds(storageKey) !== undefined;
|
|
57
43
|
React.useEffect(() => {
|
|
58
44
|
let active = true;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
}).catch(cause => {
|
|
45
|
+
const notify = () => redraw();
|
|
46
|
+
declinedState.listeners.add(notify);
|
|
47
|
+
void loadDeclinedDeviceIds(declinedState, storage, declinedStorageKey).catch(cause => {
|
|
64
48
|
if (active) {
|
|
65
49
|
const normalized = toBluetoothError(cause);
|
|
66
50
|
setError(normalized);
|
|
@@ -70,9 +54,10 @@ export const useNearbyDeviceOffer = ({
|
|
|
70
54
|
});
|
|
71
55
|
return () => {
|
|
72
56
|
active = false;
|
|
57
|
+
declinedState.listeners.delete(notify);
|
|
73
58
|
};
|
|
74
|
-
}, [declinedStorageKey, storage]);
|
|
75
|
-
const device = enabled && pairedIdsLoaded && declinedIds !== undefined ? devices.find(candidate => !paired.includes(candidate.id) && !declinedIds.includes(candidate.id) && !dismissedLater.has(candidate.id)) : undefined;
|
|
59
|
+
}, [declinedState, declinedStorageKey, storage]);
|
|
60
|
+
const device = enabled && pairedIdsLoaded && declinedIds !== undefined ? devices.find(candidate => !paired.includes(candidate.id) && !declinedIds.includes(candidate.id) && !dismissedLater.has(candidate.id) && (shouldOffer?.(candidate) ?? true)) : undefined;
|
|
76
61
|
deviceRef.current = device;
|
|
77
62
|
const deviceId = device?.id;
|
|
78
63
|
const hasDevice = device !== undefined;
|
|
@@ -117,28 +102,29 @@ export const useNearbyDeviceOffer = ({
|
|
|
117
102
|
busyRef.current = false;
|
|
118
103
|
}
|
|
119
104
|
}, [onError, onPaired, pair, remember]);
|
|
120
|
-
const decline = React.useCallback(async
|
|
105
|
+
const decline = React.useCallback(async deviceId => {
|
|
121
106
|
const selected = deviceRef.current;
|
|
122
|
-
|
|
107
|
+
const selectedId = deviceId ?? selected?.id;
|
|
108
|
+
if (!selectedId) {
|
|
123
109
|
return;
|
|
124
110
|
}
|
|
125
111
|
try {
|
|
126
|
-
const next = await updateDeclinedDeviceIds(storage, declinedStorageKey, ids => [...new Set([...ids,
|
|
127
|
-
|
|
112
|
+
const next = await updateDeclinedDeviceIds(storage, declinedStorageKey, ids => [...new Set([...ids, selectedId])]);
|
|
113
|
+
publishDeclinedDeviceIds(declinedState, next);
|
|
128
114
|
setError(undefined);
|
|
129
115
|
setStatus("idle");
|
|
130
116
|
} catch (cause) {
|
|
131
117
|
const normalized = toBluetoothError(cause);
|
|
132
|
-
onError?.(normalized, selected);
|
|
118
|
+
onError?.(normalized, selected?.id === selectedId ? selected : undefined);
|
|
133
119
|
throw normalized;
|
|
134
120
|
}
|
|
135
|
-
}, [declinedStorageKey, onError, storage]);
|
|
121
|
+
}, [declinedState, declinedStorageKey, onError, storage]);
|
|
136
122
|
const undecline = React.useCallback(async deviceId => {
|
|
137
123
|
const next = await updateDeclinedDeviceIds(storage, declinedStorageKey, ids => ids.filter(id => id !== deviceId));
|
|
138
|
-
|
|
124
|
+
publishDeclinedDeviceIds(declinedState, next);
|
|
139
125
|
setError(undefined);
|
|
140
126
|
setStatus("idle");
|
|
141
|
-
}, [declinedStorageKey, storage]);
|
|
127
|
+
}, [declinedState, declinedStorageKey, storage]);
|
|
142
128
|
const later = React.useCallback(() => {
|
|
143
129
|
const selected = deviceRef.current;
|
|
144
130
|
if (!selected) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","
|
|
1
|
+
{"version":3,"names":["React","toBluetoothError","getDeclinedDeviceState","loadDeclinedDeviceIds","publishDeclinedDeviceIds","updateDeclinedDeviceIds","getDismissedLater","notNearbyError","useBluetoothRuntime","useBluetoothSelector","useNearbyDevices","DEFAULT_PAIRED_DEVICE_STORAGE_KEY","usePairedDevices","useNearbyDeviceOffer","storage","storageKey","declinedStorageKey","enabled","shouldOffer","onPaired","onError","runtime","devices","snapshot","pair","paired","remember","declinedState","useMemo","declinedIds","ids","status","setStatus","useState","error","setError","undefined","redraw","useReducer","value","busyRef","useRef","deviceRef","previousDeviceIdRef","onErrorRef","current","dismissedLater","pairedIdsLoaded","getPairedDeviceIds","useEffect","active","notify","listeners","add","catch","cause","normalized","delete","device","find","candidate","includes","id","has","deviceId","hasDevice","accept","useCallback","selected","missing","connected","decline","selectedId","next","Set","undecline","filter","later"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/hooks/use-nearby-device-offer.ts"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAQ9B,SAEEC,gBAAgB,QACX,6BAA0B;AAEjC,SACEC,sBAAsB,EACtBC,qBAAqB,EACrBC,wBAAwB,EACxBC,uBAAuB,QAClB,8BAA2B;AAClC,SAASC,iBAAiB,EAAEC,cAAc,QAAQ,gCAA6B;AAC/E,SAASC,mBAAmB,EAAEC,oBAAoB,QAAQ,sBAAmB;AAC7E,SAASC,gBAAgB,QAAQ,yBAAsB;AACvD,SACEC,iCAAiC,EACjCC,gBAAgB,QACX,yBAAsB;AAO7B,OAAO,MAAMC,oBAAoB,GAAGA,CAAC;EACnCC,OAAO;EACPC,UAAU,GAAGJ,iCAAiC;EAC9CK,kBAAkB,GAAG,GAAGD,UAAU,0BAA0B;EAC5DE,OAAO,GAAG,IAAI;EACdC,WAAW;EACXC,QAAQ;EACRC;AAC2B,CAAC,KAQzB;EACH,MAAMC,OAAO,GAAGb,mBAAmB,CAAC,CAAC;EACrC,MAAMc,OAAO,GAAGb,oBAAoB,CAAEc,QAAQ,IAAKA,QAAQ,CAACD,OAAO,CAAC;EACpE,MAAM;IAAEE;EAAK,CAAC,GAAGd,gBAAgB,CAAC,CAAC;EACnC,MAAM;IAAEe,MAAM;IAAED,IAAI,EAAEE;EAAS,CAAC,GAAGd,gBAAgB,CAAC;IAAEE,OAAO;IAAEC;EA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C7C,CAAC;EAED,MAAM+D,KAAK,GAAG7E,KAAK,CAACmE,WAAW,CAAC,MAAM;IACpC,MAAMC,QAAQ,GAAG1B,SAAS,CAACG,OAAO;IAElC,IAAI,CAACuB,QAAQ,EAAE;MACb;IACF;IAEAtB,cAAc,CAACO,GAAG,CAACe,QAAQ,CAACN,EAAE,CAAC;IAC/B3B,QAAQ,CAACC,SAAS,CAAC;IACnBJ,SAAS,CAAC,MAAM,CAAC;IACjBK,MAAM,CAAC,CAAC;EACV,CAAC,EAAE,CAACS,cAAc,CAAC,CAAC;EAEpB,OAAO;IACLY,MAAM;IACN3B,MAAM,EAAE2B,MAAM,IAAI3B,MAAM,KAAK,MAAM,GAAG,SAAS,GAAGA,MAAM;IACxDG,KAAK;IACLgC,MAAM;IACNK,OAAO;IACPI,SAAS;IACTE;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
package/lib/module/modules/bt-management/services/background-sync/background-sync-coordinator.js
CHANGED
|
@@ -31,8 +31,13 @@ class BackgroundSyncCoordinator {
|
|
|
31
31
|
enqueue = result => this.runExclusive(async () => {
|
|
32
32
|
const queue = await this.readQueue();
|
|
33
33
|
const stableId = result.id ?? createResultId();
|
|
34
|
+
const ownerKey = this.options.getOwnerKey?.();
|
|
35
|
+
if (typeof ownerKey !== "string" || !ownerKey.trim()) {
|
|
36
|
+
throw new Error("Background sync requires a stable owner key before queueing a result.");
|
|
37
|
+
}
|
|
34
38
|
queue.push({
|
|
35
39
|
queueId: createQueueId(),
|
|
40
|
+
ownerKey,
|
|
36
41
|
queuedAt: new Date().toISOString(),
|
|
37
42
|
attempt: 0,
|
|
38
43
|
nextAttemptAt: 0,
|
|
@@ -89,7 +94,13 @@ class BackgroundSyncCoordinator {
|
|
|
89
94
|
flushQueue = async (queue, options = {}) => {
|
|
90
95
|
let changed = false;
|
|
91
96
|
const now = Date.now();
|
|
97
|
+
const ownerKey = this.options.getOwnerKey?.();
|
|
92
98
|
for (const item of [...queue]) {
|
|
99
|
+
// Legacy items have no owner and are deliberately retained. Guessing here
|
|
100
|
+
// could deliver one person's private reading to the next signed-in account.
|
|
101
|
+
if (!ownerKey || item.ownerKey !== ownerKey) {
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
93
104
|
if (item.exhausted && options.resetExhausted) {
|
|
94
105
|
item.attempt = 0;
|
|
95
106
|
item.exhausted = false;
|
package/lib/module/modules/bt-management/services/background-sync/background-sync-coordinator.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["recordOvokMetric","reviveResultDates","DEFAULT_QUEUE_KEY","DEFAULT_MAX_RETRIES","DEFAULT_RETRY_BACKOFF_MS","resultSequence","createResultId","Date","now","Math","random","toString","slice","createQueueId","BackgroundSyncCoordinator","operation","Promise","resolve","constructor","options","storageKey","maxRetries","max","retryBackoffMs","enqueue","result","runExclusive","queue","readQueue","stableId","id","push","queueId","queuedAt","toISOString","attempt","nextAttemptAt","writeQueue","length","flushQueue","flush","next","then","catch","undefined","serialized","storage","getItem","parsed","JSON","parse","Array","isArray","
|
|
1
|
+
{"version":3,"names":["recordOvokMetric","reviveResultDates","DEFAULT_QUEUE_KEY","DEFAULT_MAX_RETRIES","DEFAULT_RETRY_BACKOFF_MS","resultSequence","createResultId","Date","now","Math","random","toString","slice","createQueueId","BackgroundSyncCoordinator","operation","Promise","resolve","constructor","options","storageKey","maxRetries","max","retryBackoffMs","enqueue","result","runExclusive","queue","readQueue","stableId","id","ownerKey","getOwnerKey","trim","Error","push","queueId","queuedAt","toISOString","attempt","nextAttemptAt","writeQueue","length","flushQueue","flush","next","then","catch","undefined","serialized","storage","getItem","parsed","JSON","parse","Array","isArray","map","item","typed","error","queueError","message","String","setItem","onError","stringify","changed","exhausted","resetExhausted","includeExhausted","onResult","splice","indexOf","measurementTypeKey","data","Number","MAX_SAFE_INTEGER"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/background-sync/background-sync-coordinator.ts"],"mappings":";;AAAA,SAASA,gBAAgB,QAAQ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sync/components/apple/apple-health-authorization-provider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getRequestStatusForAuthorization","HKAuthorizationRequestStatus","useHealthkitAuthorization","React","HealthAuthorizationContext","AppleHealthAuthorizationContext","getNotRequestedIdentifiers","Fragment","_Fragment","jsx","_jsx","AppleHealthAuthorizationProvider","memo","readIdentifiers","writeIdentifiers","dataToSync","fallback","children","skipRequest","renderManualRequestUI","onAuthorizationStatusChange","authorizationStatus","requestAuthorization","requestState","setRequestState","useState","notRequestedReadIdentifiers","setNotRequestedReadIdentifiers","notRequestedWriteIdentifiers","setNotRequestedWriteIdentifiers","requestError","setRequestError","requestKey","join","identifiersRef","useRef","current","previousRequestKey","status","useMemo","error","state","notRequestedMeasurementTypes","Object","entries","filter","data","typeIdentifiers","some","typeIdentifier","includes","map","key","useEffect","inspectAuthorization","useCallback","currentRead","currentWrite","notRequestedRead","notRequestedWrite","Promise","all","identifier","requestAccess","undefined","normalizedError","Error","String","shouldRequest","currentState","then","catch","needsAuthorization","shouldRenderManualRequestUI","shouldRenderFallback","exposedStatus","authorizationValue","platform","missingTypes","request","content","unknown","unnecessary","Provider","value"],"sourceRoot":"../../../../../../src","sources":["modules/data-sync/components/apple/apple-health-authorization-provider.tsx"],"mappings":";;AAAA,SACEA,gCAAgC,EAChCC,4BAA4B,
|
|
1
|
+
{"version":3,"names":["getRequestStatusForAuthorization","HKAuthorizationRequestStatus","useHealthkitAuthorization","React","HealthAuthorizationContext","AppleHealthAuthorizationContext","getNotRequestedIdentifiers","Fragment","_Fragment","jsx","_jsx","AppleHealthAuthorizationProvider","memo","readIdentifiers","writeIdentifiers","dataToSync","fallback","children","skipRequest","renderManualRequestUI","onAuthorizationStatusChange","authorizationStatus","requestAuthorization","requestState","setRequestState","useState","notRequestedReadIdentifiers","setNotRequestedReadIdentifiers","notRequestedWriteIdentifiers","setNotRequestedWriteIdentifiers","requestError","setRequestError","requestKey","join","identifiersRef","useRef","current","previousRequestKey","status","useMemo","error","state","notRequestedMeasurementTypes","Object","entries","filter","data","typeIdentifiers","some","typeIdentifier","includes","map","key","useEffect","inspectAuthorization","useCallback","currentRead","currentWrite","notRequestedRead","notRequestedWrite","Promise","all","identifier","requestAccess","undefined","normalizedError","Error","String","shouldRequest","currentState","then","catch","needsAuthorization","shouldRenderManualRequestUI","shouldRenderFallback","exposedStatus","authorizationValue","platform","missingTypes","request","content","unknown","unnecessary","Provider","value"],"sourceRoot":"../../../../../../src","sources":["modules/data-sync/components/apple/apple-health-authorization-provider.tsx"],"mappings":";;AAAA,SACEA,gCAAgC,EAChCC,4BAA4B,EAE5BC,yBAAyB,QACpB,oCAAoC;AAC3C,OAAO,KAAKC,KAAK,MAAM,OAAO;AAE9B,SAASC,0BAA0B,QAAQ,gDAA6C;AAIxF,SAASC,+BAA+B,QAAQ,yCAAsC;AACtF,SAASC,0BAA0B,QAAQ,uCAAoC;AAAC,SAAAC,QAAA,IAAAC,SAAA,EAAAC,GAAA,IAAAC,IAAA;AAEhF,OAAO,MAAMC,gCAAgC,gBAAGR,KAAK,CAACS,IAAI,CACxD,CAAC;EACCC,eAAe;EACfC,gBAAgB;EAChBC,UAAU;EACVC,QAAQ;EACRC,QAAQ;EACRC,WAAW;EACXC,qBAAqB;EACrBC;AAC8D,CAAC,KAAK;EACpE,MAAM,CAACC,mBAAmB,EAAEC,oBAAoB,CAAC,GAC/CpB,yBAAyB,CACvBW,eAAe,EACfC,gBACF,CAAC;EAEH,MAAM,CAACS,YAAY,EAAEC,eAAe,CAAC,GACnCrB,KAAK,CAACsB,QAAQ,CAA0C,SAAS,CAAC;EAEpE,MAAM,CAACC,2BAA2B,EAAEC,8BAA8B,CAAC,GACjExB,KAAK,CAACsB,QAAQ,CAACZ,eAAe,CAAC;EAEjC,MAAM,CAACe,4BAA4B,EAAEC,+BAA+B,CAAC,GACnE1B,KAAK,CAACsB,QAAQ,CAACX,gBAAgB,IAAI,EAAE,CAAC;EAExC,MAAM,CAACgB,YA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,CAAAF,SAAA;MAAAS,QAAA,EAAGA;IAAQ,CAAG,CAAC;EAC3B,CAAC,MAAM,IAAIwD,2BAA2B,EAAE;IACtCO,OAAO,GAAG7D,qBAAqB,GAAG4C,aAAa,CAAC;EAClD,CAAC,MAAM,IAAIW,oBAAoB,EAAE;IAC/BM,OAAO,gBAAGtE,IAAA,CAAAF,SAAA;MAAAS,QAAA,EAAGD,QAAQ,IAAI;IAAI,CAAG,CAAC;EACnC;EAEA,oBACEN,IAAA,CAACN,0BAA0B,CAAC+E,QAAQ;IAACC,KAAK,EAAER,kBAAmB;IAAA3D,QAAA,eAC7DP,IAAA,CAACL,+BAA+B,CAAC8E,QAAQ;MAACC,KAAK,EAAET,aAAc;MAAA1D,QAAA,EAC5D+D;IAAO,CACgC;EAAC,CACR,CAAC;AAE1C,CACF,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Healthkit","HKUpdateFrequency","React","useListenChanges","dataToSync","onChange","backgroundDelivery","onError","timeoutRef","useRef","undefined","onChangeRef","onErrorRef","identifiers","useMemo","Object","values","flatMap","data","typeIdentifiers","map","identifier","typeIdentifier","backgroundDeliveryEnabled","backgroundDeliveryFrequency","frequency","hourly","debouncedOnChange","useCallback","current","clearTimeout","setTimeout","useEffect","subscriptions","initSubscriptions","Promise","all","enableBackgroundDelivery","subscription","subscribeToChanges","push","error","forEach","disableBackgroundDelivery","catch"],"sourceRoot":"../../../../../src","sources":["modules/data-sync/hooks/use-listen-changes.ts"],"mappings":";;AAAA,OAAOA,SAAS,IAEdC,iBAAiB,QACZ,oCAAoC;AAC3C,OAAO,KAAKC,KAAK,MAAM,OAAO;
|
|
1
|
+
{"version":3,"names":["Healthkit","HKUpdateFrequency","React","useListenChanges","dataToSync","onChange","backgroundDelivery","onError","timeoutRef","useRef","undefined","onChangeRef","onErrorRef","identifiers","useMemo","Object","values","flatMap","data","typeIdentifiers","map","identifier","typeIdentifier","backgroundDeliveryEnabled","backgroundDeliveryFrequency","frequency","hourly","debouncedOnChange","useCallback","current","clearTimeout","setTimeout","useEffect","subscriptions","initSubscriptions","Promise","all","enableBackgroundDelivery","subscription","subscribeToChanges","push","error","forEach","disableBackgroundDelivery","catch"],"sourceRoot":"../../../../../src","sources":["modules/data-sync/hooks/use-listen-changes.ts"],"mappings":";;AAAA,OAAOA,SAAS,IAEdC,iBAAiB,QACZ,oCAAoC;AAC3C,OAAO,KAAKC,KAAK,MAAM,OAAO;AAO9B,OAAO,MAAMC,gBAAgB,GAAGA,CAC9BC,UAA8C,EAC9CC,QAAyD,EACzDC,kBAA+D,EAC/DC,OAAgC,KAC7B;EACH,MAAMC,UAAU,GAAGN,KAAK,CAACO,MAAM,CAA6BC,SAAS,CAAC;EAEtE,MAAMC,WAAW,GAAGT,KAAK,CAACO,MAAM,CAACJ,QAAQ,CAAC;EAC1C,MAAMO,UAAU,GAAGV,KAAK,CAACO,MAAM,CAACF,OAAO,CAAC;EAExC,MAAMM,WAAW,GAAGX,KAAK,CAACY,OAAO,CAAC,MAAM;IACtC,OAAOC,MAAM,CAACC,MAAM,CAACZ,UAAU,CAAC,CAACa,OAAO,CAAEC,IAAI,IAC5CA,IAAI,EAAEC,eAAe,CAACC,GAAG,CAAEC,UAAU,IAAKA,UAAU,CAACC,cAAc,CACrE,CAAC;EACH,CAAC,EAAE,CAAClB,UAAU,CAAC,CAAC;EAEhB,MAAMmB,yBAAyB,GAAGjB,kBAAkB,KAAKI,SAAS;EAElE,MAAMc,2BAA2B,GAC/BlB,kBAAkB,EAAEmB,SAAS,IAAIxB,iBAAiB,CAACyB,MAAM;EAE3D,MAAMC,iBAAiB,GAAGzB,KAAK,CAAC0B,WAAW,CACxCP,UAAyC,IAAK;IAC7C,IAAIb,UAAU,CAACqB,OAAO,EAAE;MACtBC,YAAY,CAACtB,UAAU,CAACqB,OAAO,CAAC;IAClC;IAEArB,UAAU,CAACqB,OAAO,GAAGE,UAAU,CAAC,MAAM;MACpCpB,WAAW,CAACk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,iBAAiB,CAAC,CAAC;IAEnB,OAAO,MAAM;MACXD,aAAa,CAACS,OAAO,CAAEJ,YAAY,IAAK;QACtCA,YAAY,GAAG,CAAC;MAClB,CAAC,CAAC;MAEF,IAAIf,yBAAyB,EAAE;QAC7B,KAAKY,OAAO,CAACC,GAAG,CACdvB,WAAW,CAACO,GAAG,CAAEC,UAAU,IACzBrB,SAAS,CAAC2C,yBAAyB,CACjCtB,UACF,CACF,CACF,CAAC,CAACuB,KAAK,CAAEH,KAAc,IAAK7B,UAAU,CAACiB,OAAO,GAAGY,KAAc,CAAC,CAAC;MACnE;IACF,CAAC;EACH,CAAC,EAAE,CACD5B,WAAW,EACXc,iBAAiB,EACjBJ,yBAAyB,EACzBC,2BAA2B,CAC5B,CAAC;AACJ,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["convertSamplesToObservation","getSamplesFromHealth","getTotalSamplesCount","BaseHealthSyncService","InstanceManager","AppleHealthSyncService","constructor","props","getProviderName","getTotalCountsFunction","getDataFromProviderFunction","getConverterFunction","getInstance","getInstanceInternal"],"sourceRoot":"../../../../../src","sources":["modules/data-sync/services/apple-health-sync-service.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"names":["convertSamplesToObservation","getSamplesFromHealth","getTotalSamplesCount","BaseHealthSyncService","InstanceManager","AppleHealthSyncService","constructor","props","getProviderName","getTotalCountsFunction","getDataFromProviderFunction","getConverterFunction","getInstance","getInstanceInternal"],"sourceRoot":"../../../../../src","sources":["modules/data-sync/services/apple-health-sync-service.ts"],"mappings":";;AAYA,SAASA,2BAA2B,QAAQ,4CAAyC;AACrF,SAASC,oBAAoB,QAAQ,qCAAkC;AACvE,SAASC,oBAAoB,QAAQ,qCAAkC;AAEvE,SAASC,qBAAqB,QAAQ,+BAA4B;AAClE,SAASC,eAAe,QAAQ,gCAA6B;AAM7D,OAAO,MAAMC,sBAAsB,SAASF,qBAAqB,CAI/D;EACQG,WAAWA,CAACC,KAAkC,EAAE;IACtD,KAAK,CAACA,KAAK,CAAC;EACd;EAEUC,eAAeA,CAAA,EAAmB;IAC1C,OAAO,cAAc;EACvB;EAEUC,sBAAsBA,CAAA,EAEX;IACnB,OAAOP,oBAAoB;EAC7B;EAEUQ,2BAA2BA,CAAA,EAOnC;IACA,OAAOT,oBAAoB;EAC7B;EAEUU,oBAAoBA,CAAA,EAEF;IAC1B,OAAOX,2BAA2B;EACpC;EAEA,OAAOY,WAAWA,CAChBL,KAAkC,EACV;IACxB,OAAOH,eAAe,CAACS,mBAAmB,CACxC,wBAAwB,EACxBN,KAAK,EACL,MAAM,IAAIF,sBAAsB,CAACE,KAAK,CACxC,CAAC;EACH;AACF","ignoreList":[]}
|
|
@@ -7,7 +7,8 @@ import { getHealthObservationDevice } from "./health-observation-device.js";
|
|
|
7
7
|
const FHIR_UNIT_SYSTEM = "http://unitsofmeasure.org";
|
|
8
8
|
const LOINC_SYSTEM = "http://loinc.org";
|
|
9
9
|
const HEALTH_RECORD_DATA_EXTENSION = "https://api.ovok.com/fhir/StructureDefinition/health-record-data";
|
|
10
|
-
|
|
10
|
+
const HEALTHKIT_BODY_MASS_INDEX = "HKQuantityTypeIdentifierBodyMassIndex";
|
|
11
|
+
const convertGenericHealthDataToObservation = async ({
|
|
11
12
|
data,
|
|
12
13
|
patientId,
|
|
13
14
|
mode,
|
|
@@ -27,7 +28,7 @@ export const convertGenericHealthDataToObservation = async ({
|
|
|
27
28
|
const configuredSystem = typeIdentifierCodeSystems?.[typeIdentifier];
|
|
28
29
|
const system = configuredSystem === LOINC_SYSTEM ? configuredCode && isLoincCode(configuredCode) ? LOINC_SYSTEM : undefined : configuredSystem;
|
|
29
30
|
const interval = getInterval(data);
|
|
30
|
-
const measurement = getMeasurement(first, mode, interval);
|
|
31
|
+
const measurement = getMeasurement(first, mode, interval, typeIdentifier);
|
|
31
32
|
if (!measurement || !patientId) {
|
|
32
33
|
return [];
|
|
33
34
|
}
|
|
@@ -103,14 +104,14 @@ const toPortableRecordData = value => {
|
|
|
103
104
|
}
|
|
104
105
|
return Object.fromEntries(Object.entries(value).filter(([key]) => !OMITTED_RECORD_FIELDS.has(key)).map(([key, child]) => [key, toPortableRecordData(child)]));
|
|
105
106
|
};
|
|
106
|
-
const getMeasurement = (value, mode, interval) => {
|
|
107
|
+
const getMeasurement = (value, mode, interval, typeIdentifier) => {
|
|
107
108
|
const raw = value;
|
|
108
109
|
if (isAggregatedHealthData(value)) {
|
|
109
110
|
const number = value.kind === "daily-summary" ? value.average : value.value;
|
|
110
111
|
return number === undefined ? {
|
|
111
112
|
valueString: JSON.stringify(toPortableRecordData(value)) ?? String(value)
|
|
112
113
|
} : {
|
|
113
|
-
valueQuantity: quantity(number, value.unit)
|
|
114
|
+
valueQuantity: quantity(number, value.unit, typeIdentifier)
|
|
114
115
|
};
|
|
115
116
|
}
|
|
116
117
|
if (mode === "session" && interval) {
|
|
@@ -120,7 +121,7 @@ const getMeasurement = (value, mode, interval) => {
|
|
|
120
121
|
}
|
|
121
122
|
const extracted = extractValue(raw);
|
|
122
123
|
return extracted ? {
|
|
123
|
-
valueQuantity: quantity(extracted.value, extracted.unit)
|
|
124
|
+
valueQuantity: quantity(extracted.value, typeIdentifier === HEALTHKIT_BODY_MASS_INDEX && mode === "point" ? "kg/m2" : extracted.unit, typeIdentifier)
|
|
124
125
|
} : {
|
|
125
126
|
valueString: JSON.stringify(toPortableRecordData(raw)) ?? String(raw)
|
|
126
127
|
};
|
|
@@ -132,6 +133,13 @@ const extractValue = raw => {
|
|
|
132
133
|
unit: String(raw.unit ?? "1")
|
|
133
134
|
};
|
|
134
135
|
}
|
|
136
|
+
const quantity = raw.quantity;
|
|
137
|
+
if (typeof quantity?.value === "number") {
|
|
138
|
+
return {
|
|
139
|
+
value: quantity.value,
|
|
140
|
+
unit: String(quantity.unit ?? raw.unit ?? "1")
|
|
141
|
+
};
|
|
142
|
+
}
|
|
135
143
|
const candidates = [["height", "inMeters", "m"], ["bodyFat", "percentage", "%"], ["mass", "inKilograms", "kg"], ["weight", "inKilograms", "kg"], ["distance", "inMeters", "m"], ["energy", "inKilocalories", "kcal"]];
|
|
136
144
|
for (const [containerKey, valueKey, fallbackUnit] of candidates) {
|
|
137
145
|
const container = raw[containerKey];
|
|
@@ -166,9 +174,12 @@ const extractValue = raw => {
|
|
|
166
174
|
const getInterval = data => {
|
|
167
175
|
const intervals = data.map(item => {
|
|
168
176
|
const raw = item;
|
|
169
|
-
const startValue = raw.startDate ?? raw.startTime ??
|
|
177
|
+
const startValue = raw.startDate ?? raw.startTime ?? raw.time ?? raw.endDate ?? raw.endTime;
|
|
178
|
+
if (startValue === undefined) {
|
|
179
|
+
return undefined;
|
|
180
|
+
}
|
|
170
181
|
const start = new Date(startValue);
|
|
171
|
-
const endValue = raw.endDate ?? raw.endTime ??
|
|
182
|
+
const endValue = raw.endDate ?? raw.endTime ?? raw.time ?? raw.startDate ?? raw.startTime;
|
|
172
183
|
const end = new Date(endValue);
|
|
173
184
|
return Number.isNaN(start.getTime()) || Number.isNaN(end.getTime()) ? undefined : {
|
|
174
185
|
start,
|
|
@@ -178,14 +189,16 @@ const getInterval = data => {
|
|
|
178
189
|
if (intervals.length === 0) {
|
|
179
190
|
return undefined;
|
|
180
191
|
}
|
|
181
|
-
|
|
182
|
-
start
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
end
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
192
|
+
const start = new Date(Math.min(...intervals.map(({
|
|
193
|
+
start
|
|
194
|
+
}) => start.getTime())));
|
|
195
|
+
const end = new Date(Math.max(...intervals.map(({
|
|
196
|
+
end
|
|
197
|
+
}) => end.getTime())));
|
|
198
|
+
return end.getTime() > start.getTime() ? {
|
|
199
|
+
start,
|
|
200
|
+
end
|
|
201
|
+
} : undefined;
|
|
189
202
|
};
|
|
190
203
|
const getDate = value => {
|
|
191
204
|
const raw = value;
|
|
@@ -232,25 +245,51 @@ const component = (label, value, unit) => ({
|
|
|
232
245
|
},
|
|
233
246
|
valueQuantity: quantity(value, unit)
|
|
234
247
|
});
|
|
235
|
-
const quantity = (value, unit) =>
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}
|
|
248
|
+
const quantity = (value, unit, typeIdentifier) => {
|
|
249
|
+
const code = getUcumCode(unit, typeIdentifier);
|
|
250
|
+
return {
|
|
251
|
+
value,
|
|
252
|
+
unit,
|
|
253
|
+
...(code ? {
|
|
254
|
+
system: FHIR_UNIT_SYSTEM,
|
|
255
|
+
code
|
|
256
|
+
} : {})
|
|
257
|
+
};
|
|
258
|
+
};
|
|
259
|
+
const getUcumCode = (unit, typeIdentifier) => {
|
|
260
|
+
if (unit === "count/min") {
|
|
261
|
+
if (["HKQuantityTypeIdentifierHeartRate", "HKQuantityTypeIdentifierRestingHeartRate", "HKQuantityTypeIdentifierWalkingHeartRateAverage", "HeartRate", "RestingHeartRate"].includes(typeIdentifier ?? "")) {
|
|
262
|
+
return "{beats}/min";
|
|
263
|
+
}
|
|
264
|
+
if (["HKQuantityTypeIdentifierRespiratoryRate", "RespiratoryRate"].includes(typeIdentifier ?? "")) {
|
|
265
|
+
return "{breaths}/min";
|
|
266
|
+
}
|
|
267
|
+
return "{counts}/min";
|
|
268
|
+
}
|
|
269
|
+
const normalized = {
|
|
270
|
+
kilometers: "km",
|
|
271
|
+
meters: "m",
|
|
272
|
+
miles: "[mi_i]",
|
|
273
|
+
count: "{count}",
|
|
274
|
+
steps: "{steps}",
|
|
275
|
+
kilograms: "kg",
|
|
276
|
+
grams: "g",
|
|
277
|
+
milligrams: "mg",
|
|
278
|
+
kilocalories: "kcal",
|
|
279
|
+
calories: "cal",
|
|
280
|
+
minutes: "min",
|
|
281
|
+
seconds: "s",
|
|
282
|
+
beatsPerMinute: "{beats}/min",
|
|
283
|
+
bpm: "{beats}/min",
|
|
284
|
+
"breaths/min": "{breaths}/min",
|
|
285
|
+
"°C": "Cel",
|
|
286
|
+
mmHg: "mm[Hg]",
|
|
287
|
+
degC: "Cel"
|
|
288
|
+
}[unit] ?? unit;
|
|
289
|
+
return UCUM_CODES.has(normalized) ? normalized : undefined;
|
|
290
|
+
};
|
|
291
|
+
const UCUM_CODES = new Set(["1", "%", "Cel", "cal", "g", "h", "kcal", "kg", "kg/m2", "km", "m", "mL/kg/min", "mg", "mg/dL", "min", "[mi_i]", "mm[Hg]", "mmol/L", "ms", "mV", "s", "{beats}/min", "{breaths}/min", "{count}", "{counts}/min", "{ratio}", "{steps}"]);
|
|
292
|
+
const normalizeUnit = (unit, typeIdentifier) => getUcumCode(unit, typeIdentifier) ?? unit;
|
|
254
293
|
const getStableObservationId = ({
|
|
255
294
|
typeIdentifier,
|
|
256
295
|
code,
|
|
@@ -262,4 +301,5 @@ const getStableObservationId = ({
|
|
|
262
301
|
const value = measurement.valueQuantity?.value ?? measurement.valueString ?? "empty";
|
|
263
302
|
return `health-${[typeIdentifier, code, time, value].join("-").replace(/[^a-zA-Z0-9.-]/g, "-").slice(0, 64)}`;
|
|
264
303
|
};
|
|
304
|
+
export { convertGenericHealthDataToObservation, getUcumCode };
|
|
265
305
|
//# sourceMappingURL=convert-generic-health-data.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isAggregatedHealthData","getHealthObservationDevice","FHIR_UNIT_SYSTEM","LOINC_SYSTEM","HEALTH_RECORD_DATA_EXTENSION","convertGenericHealthDataToObservation","data","patientId","mode","typeIdentifier","configuredTypeIdentifier","typeIdentifierCodes","typeIdentifierCodeSystems","typeIdentifierCodeDisplays","first","value","String","quantityType","categoryType","recordType","configuredCode","code","configuredSystem","system","isLoincCode","undefined","interval","getInterval","measurement","getMeasurement","metadata","getMetadata","device","observationDate","start","getDate","observation","resourceType","id","getStableObservationId","date","status","subject","reference","coding","display","extension","url","valueString","JSON","stringify","map","toPortableRecordData","effectivePeriod","toISOString","end","effectiveDateTime","component","minimum","unit","maximum","stageComponents","getSleepStageComponents","length","test","OMITTED_RECORD_FIELDS","Set","Date","Array","isArray","Object","fromEntries","entries","filter","key","has","child","raw","number","kind","average","valueQuantity","quantity","getTime","extracted","extractValue","candidates","containerKey","valueKey","fallbackUnit","container","normalizeUnit","alternateCandidates","scalarCandidates","intervals","item","startValue","startDate","startTime","endValue","endDate","endTime","Number","isNaN","Boolean","Math","min","max","time","parsed","sourceRevision","source","manufacturer","dataOrigin","model","sourceApp","name","recordingMethod","flatMap","stages","duration","isFinite","stage","label","text","kilometers","meters","miles","kilograms","grams","milligrams","kilocalories","calories","minutes","seconds","beatsPerMinute","join","replace","slice"],"sourceRoot":"../../../../../src","sources":["modules/data-sync/utils/convert-generic-health-data.ts"],"mappings":";;AAAA;;AAKA,SAASA,sBAAsB,QAAQ,yBAAsB;AAG7D,SAASC,0BAA0B,QAAQ,gCAA6B;AAMxE,MAAMC,gBAAgB,GAAG,2BAA2B;AACpD,MAAMC,YAAY,GAAG,kBAAkB;AAEvC,MAAMC,4BAA4B,GAChC,kEAAkE;AAEpE,OAAO,MAAMC,qCAAqC,GAAG,MAAAA,CAAO;EAC1DC,IAAI;EACJC,SAAS;EACTC,IAAI;EACJC,cAAc,EAAEC,wBAAwB;EACxCC,mBAAmB;EACnBC,yBAAyB;EACzBC;AACsB,CAAC,KAA6B;EACpD,MAAMC,KAAK,GAAGR,IAAI,CAAC,CAAC,CAAC;EAErB,IAAI,CAACQ,KAAK,EAAE;IACV,OAAO,EAAE;EACX;EAEA,MAAMC,KAAK,GAAGD,KAAgC;EAE9C,MAAML,cAAc,GAAGO,MAAM,CAC3BN,wBAAwB,IACtBK,KAAK,CAACN,cAAc,IACpBM,KAAK,CAACE,YAAY,IAClBF,KAAK,CAACG,YAAY,IAClBH,KAAK,CAACI,UAAU,IAChB,aACJ,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U,EAAE,IAAI;EAChBC,YAAY,EAAE,MAAM;EACpBC,QAAQ,EAAE,KAAK;EACfC,OAAO,EAAE,KAAK;EACdC,OAAO,EAAE,GAAG;EACZC,cAAc,EAAE;AAClB,CAAC,EAAE5E,IAAI,CAAC,IAAIA,IAAI;AAElB,MAAMpB,sBAAsB,GAAGA,CAAC;EAC9B9B,cAAc;EACdY,IAAI;EACJK,QAAQ;EACRc,IAAI;EACJZ;AAOF,CAAC,KAAa;EACZ,MAAMgF,IAAI,GAAGlF,QAAQ,GACjB,GAAGA,QAAQ,CAACQ,KAAK,CAACoB,WAAW,CAAC,CAAC,IAAI5B,QAAQ,CAAC6B,GAAG,CAACD,WAAW,CAAC,CAAC,EAAE,GAC/Dd,IAAI,EAAEc,WAAW,CAAC,CAAC,IAAI,SAAS;EAEpC,MAAMvC,KAAK,GACTa,WAAW,CAACqD,aAAa,EAAElE,KAAK,IAAIa,WAAW,CAACoB,WAAW,IAAI,OAAO;EAExE,OAAO,UAAU,CAACvC,cAAc,EAAEY,IAAI,EAAEuF,IAAI,EAAE7F,KAAK,CAAC,CACjDyH,IAAI,CAAC,GAAG,CAAC,CACTC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAC/BC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE;AACnB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["isAggregatedHealthData","getHealthObservationDevice","FHIR_UNIT_SYSTEM","LOINC_SYSTEM","HEALTH_RECORD_DATA_EXTENSION","HEALTHKIT_BODY_MASS_INDEX","convertGenericHealthDataToObservation","data","patientId","mode","typeIdentifier","configuredTypeIdentifier","typeIdentifierCodes","typeIdentifierCodeSystems","typeIdentifierCodeDisplays","first","value","String","quantityType","categoryType","recordType","configuredCode","code","configuredSystem","system","isLoincCode","undefined","interval","getInterval","measurement","getMeasurement","metadata","getMetadata","device","observationDate","start","getDate","observation","resourceType","id","getStableObservationId","date","status","subject","reference","coding","display","extension","url","valueString","JSON","stringify","map","toPortableRecordData","effectivePeriod","toISOString","end","effectiveDateTime","component","minimum","unit","maximum","stageComponents","getSleepStageComponents","length","test","OMITTED_RECORD_FIELDS","Set","Date","Array","isArray","Object","fromEntries","entries","filter","key","has","child","raw","number","kind","average","valueQuantity","quantity","getTime","extracted","extractValue","candidates","containerKey","valueKey","fallbackUnit","container","normalizeUnit","alternateCandidates","scalarCandidates","intervals","item","startValue","startDate","startTime","time","endDate","endTime","endValue","Number","isNaN","Boolean","Math","min","max","parsed","sourceRevision","source","manufacturer","dataOrigin","model","sourceApp","name","recordingMethod","flatMap","stages","duration","isFinite","stage","label","text","getUcumCode","includes","normalized","kilometers","meters","miles","count","steps","kilograms","grams","milligrams","kilocalories","calories","minutes","seconds","beatsPerMinute","bpm","mmHg","degC","UCUM_CODES","join","replace","slice"],"sourceRoot":"../../../../../src","sources":["modules/data-sync/utils/convert-generic-health-data.ts"],"mappings":";;AAAA;;AAKA,SAASA,sBAAsB,QAAQ,yBAAsB;AAG7D,SAASC,0BAA0B,QAAQ,gCAA6B;AAMxE,MAAMC,gBAAgB,GAAG,2BAA2B;AACpD,MAAMC,YAAY,GAAG,kBAAkB;AAEvC,MAAMC,4BAA4B,GAChC,kEAAkE;AAEpE,MAAMC,yBAAyB,GAAG,uCAAuC;AAEzE,MAAMC,qCAAqC,GAAG,MAAAA,CAAO;EACnDC,IAAI;EACJC,SAAS;EACTC,IAAI;EACJC,cAAc,EAAEC,wBAAwB;EACxCC,mBAAmB;EACnBC,yBAAyB;EACzBC;AACsB,CAAC,KAA6B;EACpD,MAAMC,KAAK,GAAGR,IAAI,CAAC,CAAC,CAAC;EAErB,IAAI,CAACQ,KAAK,EAAE;IACV,OAAO,EAAE;EACX;EAEA,MAAMC,KAAK,GAAGD,KAAgC;EAE9C,MAAML,cAAc,GAAGO,MAAM,CAC3BN,wBAAwB,IACtBK,KAAK,CAACN,cAAc,IACpBM,KAAK,CAACE,YAAY,IAClBF,KAAK,CAACG,YAAY,IAClBH,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AI,EAAEc,WAAW,CAAC,CAAC,IAAI,SAAS;EAEpC,MAAMvC,KAAK,GACTa,WAAW,CAACqD,aAAa,EAAElE,KAAK,IAAIa,WAAW,CAACoB,WAAW,IAAI,OAAO;EAExE,OAAO,UAAU,CAACvC,cAAc,EAAEY,IAAI,EAAE8E,IAAI,EAAEpF,KAAK,CAAC,CACjDkI,IAAI,CAAC,GAAG,CAAC,CACTC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAC/BC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE;AACnB,CAAC;AAED,SAAS9I,qCAAqC,EAAEwH,WAAW","ignoreList":[]}
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
import { MeasurementTypeKey, ObservationServiceCreator } from "@ovok/core";
|
|
4
4
|
import { convertGenericHealthDataToObservation } from "./convert-generic-health-data.js";
|
|
5
5
|
import { getHealthObservationDevice } from "./health-observation-device.js";
|
|
6
|
+
import { withHealthRecordTiming } from "./health-record-timing.js";
|
|
7
|
+
import { hasConfiguredNonLoincCoding, normalizeCoreHealthObservation } from "./normalize-core-health-observation.js";
|
|
6
8
|
export const convertRecordsToObservation = async props => {
|
|
7
9
|
const {
|
|
8
10
|
data,
|
|
@@ -20,6 +22,12 @@ export const convertRecordsToObservation = async props => {
|
|
|
20
22
|
if (!record) {
|
|
21
23
|
return [];
|
|
22
24
|
}
|
|
25
|
+
if (hasConfiguredNonLoincCoding(props)) {
|
|
26
|
+
return convertGenericHealthDataToObservation({
|
|
27
|
+
...props,
|
|
28
|
+
mode
|
|
29
|
+
});
|
|
30
|
+
}
|
|
23
31
|
if (!isCoreMeasurementTypeKey(measurementTypeKey)) {
|
|
24
32
|
return convertGenericHealthDataToObservation({
|
|
25
33
|
...props,
|
|
@@ -35,35 +43,30 @@ export const convertRecordsToObservation = async props => {
|
|
|
35
43
|
const observationBody = await client.generateObservationBodiesByMeasurement({
|
|
36
44
|
measurement
|
|
37
45
|
});
|
|
38
|
-
const
|
|
46
|
+
const typedRecordTiming = record;
|
|
39
47
|
const device = getHealthObservationDevice({
|
|
40
48
|
manufacturer: typedRecord.metadata?.device?.manufacturer,
|
|
41
49
|
model: typedRecord.metadata?.device?.model,
|
|
42
50
|
sourceApp: typedRecord.metadata?.dataOrigin,
|
|
43
51
|
recordingMethod: typedRecord.metadata?.recordingMethod
|
|
44
52
|
});
|
|
45
|
-
return observationBody.map(observation => ({
|
|
53
|
+
return observationBody.map(observation => normalizeCoreHealthObservation(withHealthRecordTiming({
|
|
46
54
|
...observation,
|
|
47
55
|
...(device ? {
|
|
48
56
|
device: {
|
|
49
57
|
...(observation.device ?? {}),
|
|
50
58
|
...device
|
|
51
59
|
}
|
|
52
|
-
} : {})
|
|
53
|
-
|
|
60
|
+
} : {})
|
|
61
|
+
}, typedRecordTiming.time !== undefined ? {
|
|
62
|
+
point: typedRecordTiming.time
|
|
63
|
+
} : {
|
|
64
|
+
start: typedRecordTiming.startTime,
|
|
65
|
+
end: typedRecordTiming.endTime
|
|
66
|
+
}), {
|
|
67
|
+
...props,
|
|
68
|
+
applyCatalogCoding: observationBody.length === 1 && data.length === 1
|
|
54
69
|
}));
|
|
55
70
|
};
|
|
56
71
|
const isCoreMeasurementTypeKey = value => Object.values(MeasurementTypeKey).includes(value);
|
|
57
|
-
const getRecordTime = record => {
|
|
58
|
-
if ("time" in record) {
|
|
59
|
-
return record.time;
|
|
60
|
-
}
|
|
61
|
-
if ("endTime" in record) {
|
|
62
|
-
return record.endTime;
|
|
63
|
-
}
|
|
64
|
-
if ("startTime" in record) {
|
|
65
|
-
return record.startTime;
|
|
66
|
-
}
|
|
67
|
-
return undefined;
|
|
68
|
-
};
|
|
69
72
|
//# sourceMappingURL=convert-records-to-observation.js.map
|