@d4l/collect-lib 1.19.0 → 1.20.1

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 CHANGED
@@ -174,7 +174,6 @@ Update the types by running `yarn run readme:update`.
174
174
  | Properties | Required | Type | Description |
175
175
  | ------------- | -------- | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
176
176
  | blur | false | object | The set of blurring settings that should be applied to the resource. |
177
- | blur.location | true | string | The timezone location of the resource, e.g `"Europe/Berlin"`. |
178
177
  | blur.authored | false | [DateBlurringFunction](#DateBlurringFunction) | The name of the default blurring function which is used to blur the authored timestamp of every QuestionnaireResponse. |
179
178
  | blur.authored | false | [DateBlurringFunction](#DateBlurringFunction) | The name of the default blurring function which is used to blur the period start and end of every ResearchSubject. |
180
179
 
@@ -237,7 +236,6 @@ Update the types by running `yarn run readme:update`.
237
236
  | type | true | [FrequencyType](#FrequencyType) | Defines how often and when a questionnaire is triggered/added for the survey |
238
237
  | start | true | ISO 8601 date with timezone | Determines the global starting date of the survey. The time component is also used for when the events should be available on the day they become available. |
239
238
  | end | false | ISO 8601 date with timezone | Determines the global ending date of the survey. |
240
- | location | false | Timezone Location | Determines the location for the defined date, so that timezone problems can be handled. |
241
239
  | factor | false | integer | For `daily`, `weekly` and `monthly` this factor is used to manipulate the cycle length, e.g. `daily` with a factor of 7 makes it a survey that is repeated every week, but doesn't necessarily start on monday. |
242
240
  | editDuration | false | ISO 8601 duration string | Enables editing events of this survey for the given duration. |
243
241
  | skipFirst | false | boolean | Determines if the first iteration of the survey after subscription should be skipped. Skipping it means the questionnaire won't open in the middle of the window and instead at the start of the next full window. Defaults to `false`. |
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as fhir_r5 from 'fhir/r5';
2
- import { Duration } from 'luxon';
2
+ import { DateTimeUnit, Duration } from 'luxon';
3
3
 
4
4
  type ConsentTimes = {
5
5
  [key: string]: Date | null;
@@ -37,7 +37,6 @@ type TaskFrequency = {
37
37
  type: FrequencyType;
38
38
  start: string;
39
39
  end?: string;
40
- location?: string;
41
40
  factor?: number;
42
41
  editDuration?: string;
43
42
  skipFirst?: boolean;
@@ -165,6 +164,10 @@ interface QuestionnaireScore {
165
164
  * The actual score
166
165
  */
167
166
  value: number;
167
+ /**
168
+ * The minimum score
169
+ */
170
+ min: number;
168
171
  /**
169
172
  * The maximum score
170
173
  */
@@ -284,7 +287,6 @@ type ProgramDonation = {
284
287
  };
285
288
  type ProgramAnonymization = {
286
289
  blur?: {
287
- location: string;
288
290
  authored?: DateBlurringFunction;
289
291
  researchSubject?: DateBlurringFunction;
290
292
  };
@@ -777,10 +779,25 @@ declare function getText<K>(content: any, path: K, lng: string): string;
777
779
  * @returns The value at the path or undefined
778
780
  */
779
781
  declare function get(obj: Record<string, any>, path: string): string | undefined;
782
+ /**
783
+ * Create an index map out of an array
784
+ * @param array Any array that contains objects
785
+ * @param keyField The key which is used to index
786
+ * @returns An object which contains the elements from the array indexed by _keyField_
787
+ */
788
+ declare const indexArrayBy: <T extends Record<string, any>, K extends keyof T>(array: T[] | undefined, keyField: K) => Record<T[K], T>;
780
789
 
781
790
  declare function generateFHIRQuestionnaireScore(id: string, data: QuestionnaireScore & {
782
791
  createdAt: string;
783
792
  }, stringTemplater: StringTemplater): fhir5.Observation;
793
+ type Range = {
794
+ min: number;
795
+ max: number;
796
+ };
797
+ declare function calculateQuestionnaireScoreRange(questionnaire: fhir5.Questionnaire, scoring: SurveyScoring | undefined): Range;
798
+ declare function calculateScoreRangeForItem(item: fhir5.QuestionnaireItem, valueSets: {
799
+ [key: string]: fhir5.ValueSet;
800
+ }, scoring: SurveyScoring): Range;
784
801
 
785
802
  declare function generateFHIRResponse(id: string, { programName, effectiveDate, language, questionnaire, createdAt, status, answers, }: QuestionnaireResponse): fhir5.QuestionnaireResponse;
786
803
  declare const toQuestionnaireResponseItem: (answer: {
@@ -805,6 +822,87 @@ declare function generateFHIRTag(id: string, code: string, date: string, labels:
805
822
  [key: string]: string;
806
823
  }, stringTemplater: StringTemplater): fhir5.Observation;
807
824
 
825
+ type TimeWindow = {
826
+ start: Date;
827
+ end: Date;
828
+ };
829
+ /**
830
+ * Subset of TaskFrequency type required for time functions.
831
+ * Start is an ISO 8601 timestamp indicating the starting point for the frequency subset.
832
+ */
833
+ type FrequencySubset = {
834
+ factor?: number;
835
+ start?: string;
836
+ type: FrequencyType;
837
+ };
838
+
839
+ /**
840
+ * Returns the timeFuncs for the given parameters.
841
+ * Can be used with task.frequency and an optional overwrite for the startDate
842
+ * @param parameters subset of task frequency
843
+ * @param startDate startDate as a means to overwrite date part of the frequency start
844
+ * @returns
845
+ */
846
+ declare const getTimeFuncs: (parameters: FrequencySubset, startDate?: Date) => TimeFuncs;
847
+ /**
848
+ * Abstract class for functions to manipulate time based on a given window size
849
+ */
850
+ declare abstract class TimeFuncs {
851
+ abstract unit: DateTimeUnit;
852
+ factor: number;
853
+ start?: string;
854
+ constructor(parameters?: {
855
+ factor?: number;
856
+ start?: string;
857
+ });
858
+ abstract addFunc(base: Date, x: number): Date;
859
+ add(base: Date, x: number): Date;
860
+ abstract diffFunc(later: Date, earlier: Date): number;
861
+ diff(later: Date, earlier: Date): number;
862
+ abstract formatFunc(date: Date): string;
863
+ group(date: Date): string;
864
+ private startOfUnit;
865
+ private endOfUnit;
866
+ window(date: Date): TimeWindow;
867
+ }
868
+
869
+ declare const dayFormat: (date: Date) => string;
870
+ /**
871
+ * Checks if the given date is not after the effective end date
872
+ * @param effectiveEndDate
873
+ * @param date
874
+ * @returns true if there is no endDate or if the date is not after the endDate
875
+ */
876
+ declare const isNotAfterEndDate: (effectiveEndDate: Date | undefined, date: Date) => boolean;
877
+ /**
878
+ * Checks if the given date is not before the start date
879
+ * @param startDate
880
+ * @param date
881
+ * @returns true if there is no startDate or if the date is not before the startDate
882
+ */
883
+ declare const isNotBeforeStartDate: (startDate: Date | undefined, date: Date) => boolean;
884
+ /**
885
+ * Checks if the given date is before the start date
886
+ * @param start
887
+ * @param date
888
+ * @returns true if there is a start and the date is before the start date
889
+ */
890
+ declare const isBeforeStartDate: (start: string | Date | undefined, date: Date) => boolean | "" | undefined;
891
+ /**
892
+ * Overwrite the time of a date with a given timestamp (ignoring timezone information)
893
+ * @param date the date the time should be applied to
894
+ * @param timeComponent ISO 8601 timestamp string to take the time from
895
+ * @returns
896
+ */
897
+ declare const overwriteTime: (date: Date | null | undefined, timeComponent: string | undefined) => Date | undefined;
898
+ /**
899
+ * Converts a ISO 8601 timestamp string to a Date ignoring the timezone
900
+ * Uses luxon for date parsing (allows setting default timezone in tests)
901
+ * @param input
902
+ * @returns timestamp without timezone information
903
+ */
904
+ declare const timezonelessDate: (input: string) => Date;
905
+
808
906
  interface CryptoModule {
809
907
  deriveEncryptionKey(recoveryKey: Uint8Array, salt: string): Promise<Uint8Array>;
810
908
  generateKey(size: number): Uint8Array;
@@ -1316,4 +1414,4 @@ declare const API_TARGET_MAP: {
1316
1414
  };
1317
1415
  };
1318
1416
 
1319
- export { ANDROID_SENSORS_CONSTANT_NAMES, type API, type APIConfig, type APIDeviceConfig, API_TARGET_MAP, APPLE_HEALTH_ACTIVE_ENERGY_ANNOTATION, APPLE_HEALTH_ANNOTATION_ITEM_ACTIVE_ENERGY, APPLE_HEALTH_ANNOTATION_ITEM_SLEEP_DURATION, APPLE_HEALTH_ANNOTATION_ITEM_SLEEP_STATE, APPLE_HEALTH_ANNOTATION_ITEM_STEP_COUNT, APPLE_HEALTH_ANNOTATION_ITEM_WALKING_RUNNING_DISTANCE, APPLE_HEALTH_SIGNAL_TYPE_ANNOTATIONS, APPLE_HEALTH_SLEEP_ANALYSIS_ANNOTATION, APPLE_HEALTH_SLEEP_STATE_MAP, APPLE_HEALTH_STEP_COUNT_ANNOTATION, APPLE_HEALTH_WALKING_RUNNING_DISTANCE_ANNOTATION, ASMSECGMeasurementAnnotation, ASMSSpO2MeasurementAnnotation, type Answer, AnswerCodeCondition, type Answers, AppIDNamingSystem, type AppleHealthSleepStates, type BLEDeviceConfig, BLE_ASMS_ANNOTATION_ITEM_ECG, BLE_ASMS_ANNOTATION_ITEM_SPO2, BLE_CPMS_ANNOTATION_ITEM_ACTIVITY_TYPE, BLE_CPMS_ANNOTATION_ITEM_DAILY_CALORIES, BLE_CPMS_ANNOTATION_ITEM_DAILY_DISTANCE, BLE_CPMS_ANNOTATION_ITEM_DAILY_ELEVATION_GAIN, BLE_CPMS_ANNOTATION_ITEM_DAILY_FLOORS, BLE_CPMS_ANNOTATION_ITEM_DAILY_STEPS, BLE_PAMS_ANNOTATION_ITEM_ABSOLUTE_ELEVATION, BLE_PAMS_ANNOTATION_ITEM_AVERAGE_MOTION_CADENCE, BLE_PAMS_ANNOTATION_ITEM_AVERAGE_SPEED, BLE_PAMS_ANNOTATION_ITEM_BYTE, BLE_PAMS_ANNOTATION_ITEM_CALORIES_TOTAL, BLE_PAMS_ANNOTATION_ITEM_DISTANCE_TOTAL, BLE_PAMS_ANNOTATION_ITEM_FLAGS_16, BLE_PAMS_ANNOTATION_ITEM_FLAGS_24, BLE_PAMS_ANNOTATION_ITEM_FLAGS_32, BLE_PAMS_ANNOTATION_ITEM_FLAGS_8, BLE_PAMS_ANNOTATION_ITEM_FLOORS_TOTAL, BLE_PAMS_ANNOTATION_ITEM_FOUR_BYTES, BLE_PAMS_ANNOTATION_ITEM_HEADER, BLE_PAMS_ANNOTATION_ITEM_HEART_RATE, BLE_PAMS_ANNOTATION_ITEM_MAXIMUM_MOTION_CADENCE, BLE_PAMS_ANNOTATION_ITEM_MAXIMUM_SPEED, BLE_PAMS_ANNOTATION_ITEM_MINIMUM_MOTION_CADENCE, BLE_PAMS_ANNOTATION_ITEM_MINIMUM_SPEED, BLE_PAMS_ANNOTATION_ITEM_MOTION_CADENCE, BLE_PAMS_ANNOTATION_ITEM_NEGATIVE_ELEVATION_GAIN, BLE_PAMS_ANNOTATION_ITEM_POSITIVE_ELEVATION_GAIN, BLE_PAMS_ANNOTATION_ITEM_RUNNING_STEPS_TOTAL, BLE_PAMS_ANNOTATION_ITEM_SPEED, BLE_PAMS_ANNOTATION_ITEM_STEPS_TOTAL, BLE_PAMS_ANNOTATION_ITEM_THREE_BYTES, BLE_PAMS_ANNOTATION_ITEM_TWO_BYTES, BLE_PAMS_ANNOTATION_ITEM_VO2_MAX, BLE_PSMS_ANNOTATION_ITEM_HEART_RATE, BLE_PSMS_ANNOTATION_ITEM_IBI, BLE_PSMS_ANNOTATION_ITEM_PPG_GREEN, BLE_PSMS_ANNOTATION_ITEM_PPG_IR, BLE_PSMS_ANNOTATION_ITEM_PPG_RED, BLE_PSMS_ANNOTATION_ITEM_SKIN_TEMPERATURE, type BaseDeviceConfig, type BleDeviceMetaLabel, BoolCondition, CPMSHealthServicesActivityDetectionAnnotation, CPMSHealthServicesPassiveDataAnnotation, CommunicationTypeSystem, type ComparisonOperator, type ConditionOperatorType, type ConditionQuestionType, type ConditionSorting, type ConditionType, Conjunction, type Consent, ConsentCondition, ConsentNameSystem, type ConsentPath, type ConsentTimes, ConsentVersionSystem, type ContentBlock, type Converter, type CryptoModule, CustomExtensionDate, CustomExtensionStudyName, CustomQuestionSystem, type DEVICE_ANNOTATION, type DEVICE_ANNOTATION_DATA_FORMAT, type DEVICE_ANNOTATION_DATA_TYPE, DEVICE_ANNOTATION_HEARTRATE, type DEVICE_ANNOTATION_ITEM, DEVICE_ANNOTATION_ITEM_ACCELERATION, DEVICE_ANNOTATION_ITEM_ANGULAR_SPEED, DEVICE_ANNOTATION_ITEM_BEACON_ID, DEVICE_ANNOTATION_ITEM_DISTANCE, DEVICE_ANNOTATION_ITEM_EGVS, DEVICE_ANNOTATION_ITEM_HEARTRATE, DEVICE_ANNOTATION_ITEM_MAGNETIC_FIELD, DEVICE_ANNOTATION_ITEM_REMOTE_DISTANCE, DEVICE_ANNOTATION_ITEM_RSSI, DEVICE_ANNOTATION_ITEM_UNIX_TIMESTAMP, DEVICE_ANNOTATION_TIMESTAMP_NOTE, DEVICE_ANNOTATION_TIMESTAMP_SIZE, DEVICE_ANNOTATION_TIMESTAMP_UNIT, DEVICE_D4L_COMPANION_ANNOTATION_ITEM_DATA_TYPES_FLAG, DEVICE_D4L_COMPANION_ANNOTATION_ITEM_TIMESTAMP, DEVICE_DISPLAY_LABEL_CODING, type DEVICE_KEY, type DEVICE_KEY_API, type DEVICE_KEY_BLE, type DEVICE_KEY_INTERNAL, type DEVICE_KEY_SDK, DEVICE_KEY_TO_NAME, DEVICE_LABEL_CODING, type DEVICE_MOVELLA_PAYLOAD_MODES, DEVICE_OUTPUT_RATE_CODING, DEVICE_SENSOR_DELAY_CODING, type DEVICE_SIGNAL_TYPE, type DateBlurringFunction, DateCondition, DecimalCondition, type DeviceConfig, type DeviceName, Disjunction, type Display, type DisplayContent, type DisplayContentPath, type DisplayPath, type DisplayType, type DonationRecord, DonationSDK, type DonorIdentity, ERROR_CODES, ExistsCondition, type ExtendedProgramDevicesDataType, FITBIT_ANNOTATION_ITEM_BREATHING_RATE, FITBIT_ANNOTATION_ITEM_CALORIES, FITBIT_ANNOTATION_ITEM_HEART_RATE, FITBIT_ANNOTATION_ITEM_HEART_RATE_VARIABILITY, FITBIT_ANNOTATION_ITEM_SKIN_TEMPERATURE, FITBIT_ANNOTATION_ITEM_SLEEP_LEVEL, FITBIT_ANNOTATION_ITEM_SLEEP_LEVEL_DURATION, FITBIT_ANNOTATION_ITEM_SPO2, FITBIT_ANNOTATION_ITEM_STEPS, FITBIT_BREATHING_RATE_ANNOTATION, FITBIT_CALORIES_ANNOTATION, FITBIT_HEART_RATE_ANNOTATION, FITBIT_HEART_RATE_VARIABILITY_ANNOTATION, FITBIT_SIGNAL_TYPE_ANNOTATIONS, FITBIT_SKIN_TEMPERATURE_ANNOTATION, FITBIT_SLEEP_ANNOTATION, FITBIT_SLEEP_LEVEL_MAP, FITBIT_SPO2_ANNOTATION, FITBIT_STEPS_ANNOTATION, type FitbitSleepLevelTypes, type FrequencyType, type Guard, IMUAnnotation, type InternalDeviceConfig, InternalSensorAnnotationTypes, KeyHandler, MaxValueExtension, MeasurementTypeSystem, type Message, type MessagePath, type MessageRecipient, MinLengthExtension, MinValueExtension, type MultiAnswers, ObservationTypeSystem, Offset, PAMSCardioVascularActivityAnnotation, PAMSGeneralActivityInstantaneousAnnotation, PAMSGeneralActivitySummaryAnnotation, PAMSStepCounterActivitySummaryAnnotation, PSMSHeartRateAnnotation, PSMSPPGGreenAnnotation, PSMSPPGIRAnnotation, PSMSPPGRedAnnotation, PSMSSkinTemperatureAnnotation, type PreviewTimeSeriesItem, type Program, type ProgramAnonymization, type ProgramClientTarget, type ProgramConsentStep, type ProgramContact, type ProgramContent, type ProgramContentPath, type ProgramDevice, type ProgramDeviceType, type ProgramDevicesDataType, type ProgramDevicesLabel, type ProgramDisplayStep, type ProgramDonation, type ProgramEligibilityStep, type ProgramFeatured, type ProgramRoutineStep, type ProgramSensorStep, type ProgramStep, type ProgramStepBase, type ProgramStepType, type ProgramSurveyStep, type ProgramTag, type ProgramTokenStep, type ProgramType, QItemControlDefinition, type QuestionInputType, type QuestionnaireResponse, type QuestionnaireScore, RECORDING_MODEL_CURRENT_VERSION, RECORDING_SIGNAL_MODEL_CURRENT_VERSION, type RecordState, type Recording, type RecordingSignal, type RecordingSignalItem, type RecordingSignalPreview, type RecordingSignalWithId, type RecordingTag, type RecursiveKeyOf, RelativeMaxValueExtension, RelativeMinValueExtension, type ReminderFrequencyType, type ReponseValue, type ResearchSubject, type ResearchSubjectProgress, type ResearchSubjectProgressState, type ResponseMinimal, type RestorationSize, type Routine, RoutineCondition, type RoutineContent, type RoutineContentPath, type RoutineContentStep, RoutineIsPassiveExtension, type RoutineTimes, type SDKDeviceConfig, type SDKInterface, SIGNAL_DURATION_CODING, type ScoreThreshold, type SeenDisplay, type SeenMessage, SensorIdentifierSystem, SensorSettingsSystem, SensorTypeSystem, SignalIDSystem, type SkippedStep, SliderMaxLabelExtension, SliderMinLabelExtension, SliderStepSizeExtension, type StepCondition, type StringTemplater, StudyNameSystem, type Survey, SurveyCondition, type SurveyContent, type SurveyContentPath, type SurveyScoring, type Tag, type TagEffectiveType, type TaskFrequency, type TaskReminder, type Threshold, TokenNamingSystem, type TranslatedString, ULID_REGEX, ULIDtoUUID, UUID_REGEX, UUIDtoULID, WORDLIST_LANGUAGES, WearOS3AnnotationMap, WebConverter, type WordListLanguage, YearCondition, binaryStringToUint8Array, capitalizeFirstLetter, extractWordsFromRecoveryPhrase, generateFHIRConsent, generateFHIRQuestionnaireScore, generateFHIRRecordingBundle, generateFHIRResearchSubject, generateFHIRResponse, generateFHIRSeenDisplay, generateFHIRSeenMessage, generateFHIRTag, generateQuestionGuard, generateStepGuard, generateUrn, get, getLanguageOfPassPhrase, getMovellaAnnotation, getText, isScoreEligible, isYearString, newStepDateCondtion, stringToDate, stringToYear, toDeviceConfig, toQuestionnaireResponseItem, uint8ArrayToBinaryString, utf8ToUint8Array, wordlists };
1417
+ export { ANDROID_SENSORS_CONSTANT_NAMES, type API, type APIConfig, type APIDeviceConfig, API_TARGET_MAP, APPLE_HEALTH_ACTIVE_ENERGY_ANNOTATION, APPLE_HEALTH_ANNOTATION_ITEM_ACTIVE_ENERGY, APPLE_HEALTH_ANNOTATION_ITEM_SLEEP_DURATION, APPLE_HEALTH_ANNOTATION_ITEM_SLEEP_STATE, APPLE_HEALTH_ANNOTATION_ITEM_STEP_COUNT, APPLE_HEALTH_ANNOTATION_ITEM_WALKING_RUNNING_DISTANCE, APPLE_HEALTH_SIGNAL_TYPE_ANNOTATIONS, APPLE_HEALTH_SLEEP_ANALYSIS_ANNOTATION, APPLE_HEALTH_SLEEP_STATE_MAP, APPLE_HEALTH_STEP_COUNT_ANNOTATION, APPLE_HEALTH_WALKING_RUNNING_DISTANCE_ANNOTATION, ASMSECGMeasurementAnnotation, ASMSSpO2MeasurementAnnotation, type Answer, AnswerCodeCondition, type Answers, AppIDNamingSystem, type AppleHealthSleepStates, type BLEDeviceConfig, BLE_ASMS_ANNOTATION_ITEM_ECG, BLE_ASMS_ANNOTATION_ITEM_SPO2, BLE_CPMS_ANNOTATION_ITEM_ACTIVITY_TYPE, BLE_CPMS_ANNOTATION_ITEM_DAILY_CALORIES, BLE_CPMS_ANNOTATION_ITEM_DAILY_DISTANCE, BLE_CPMS_ANNOTATION_ITEM_DAILY_ELEVATION_GAIN, BLE_CPMS_ANNOTATION_ITEM_DAILY_FLOORS, BLE_CPMS_ANNOTATION_ITEM_DAILY_STEPS, BLE_PAMS_ANNOTATION_ITEM_ABSOLUTE_ELEVATION, BLE_PAMS_ANNOTATION_ITEM_AVERAGE_MOTION_CADENCE, BLE_PAMS_ANNOTATION_ITEM_AVERAGE_SPEED, BLE_PAMS_ANNOTATION_ITEM_BYTE, BLE_PAMS_ANNOTATION_ITEM_CALORIES_TOTAL, BLE_PAMS_ANNOTATION_ITEM_DISTANCE_TOTAL, BLE_PAMS_ANNOTATION_ITEM_FLAGS_16, BLE_PAMS_ANNOTATION_ITEM_FLAGS_24, BLE_PAMS_ANNOTATION_ITEM_FLAGS_32, BLE_PAMS_ANNOTATION_ITEM_FLAGS_8, BLE_PAMS_ANNOTATION_ITEM_FLOORS_TOTAL, BLE_PAMS_ANNOTATION_ITEM_FOUR_BYTES, BLE_PAMS_ANNOTATION_ITEM_HEADER, BLE_PAMS_ANNOTATION_ITEM_HEART_RATE, BLE_PAMS_ANNOTATION_ITEM_MAXIMUM_MOTION_CADENCE, BLE_PAMS_ANNOTATION_ITEM_MAXIMUM_SPEED, BLE_PAMS_ANNOTATION_ITEM_MINIMUM_MOTION_CADENCE, BLE_PAMS_ANNOTATION_ITEM_MINIMUM_SPEED, BLE_PAMS_ANNOTATION_ITEM_MOTION_CADENCE, BLE_PAMS_ANNOTATION_ITEM_NEGATIVE_ELEVATION_GAIN, BLE_PAMS_ANNOTATION_ITEM_POSITIVE_ELEVATION_GAIN, BLE_PAMS_ANNOTATION_ITEM_RUNNING_STEPS_TOTAL, BLE_PAMS_ANNOTATION_ITEM_SPEED, BLE_PAMS_ANNOTATION_ITEM_STEPS_TOTAL, BLE_PAMS_ANNOTATION_ITEM_THREE_BYTES, BLE_PAMS_ANNOTATION_ITEM_TWO_BYTES, BLE_PAMS_ANNOTATION_ITEM_VO2_MAX, BLE_PSMS_ANNOTATION_ITEM_HEART_RATE, BLE_PSMS_ANNOTATION_ITEM_IBI, BLE_PSMS_ANNOTATION_ITEM_PPG_GREEN, BLE_PSMS_ANNOTATION_ITEM_PPG_IR, BLE_PSMS_ANNOTATION_ITEM_PPG_RED, BLE_PSMS_ANNOTATION_ITEM_SKIN_TEMPERATURE, type BaseDeviceConfig, type BleDeviceMetaLabel, BoolCondition, CPMSHealthServicesActivityDetectionAnnotation, CPMSHealthServicesPassiveDataAnnotation, CommunicationTypeSystem, type ComparisonOperator, type ConditionOperatorType, type ConditionQuestionType, type ConditionSorting, type ConditionType, Conjunction, type Consent, ConsentCondition, ConsentNameSystem, type ConsentPath, type ConsentTimes, ConsentVersionSystem, type ContentBlock, type Converter, type CryptoModule, CustomExtensionDate, CustomExtensionStudyName, CustomQuestionSystem, type DEVICE_ANNOTATION, type DEVICE_ANNOTATION_DATA_FORMAT, type DEVICE_ANNOTATION_DATA_TYPE, DEVICE_ANNOTATION_HEARTRATE, type DEVICE_ANNOTATION_ITEM, DEVICE_ANNOTATION_ITEM_ACCELERATION, DEVICE_ANNOTATION_ITEM_ANGULAR_SPEED, DEVICE_ANNOTATION_ITEM_BEACON_ID, DEVICE_ANNOTATION_ITEM_DISTANCE, DEVICE_ANNOTATION_ITEM_EGVS, DEVICE_ANNOTATION_ITEM_HEARTRATE, DEVICE_ANNOTATION_ITEM_MAGNETIC_FIELD, DEVICE_ANNOTATION_ITEM_REMOTE_DISTANCE, DEVICE_ANNOTATION_ITEM_RSSI, DEVICE_ANNOTATION_ITEM_UNIX_TIMESTAMP, DEVICE_ANNOTATION_TIMESTAMP_NOTE, DEVICE_ANNOTATION_TIMESTAMP_SIZE, DEVICE_ANNOTATION_TIMESTAMP_UNIT, DEVICE_D4L_COMPANION_ANNOTATION_ITEM_DATA_TYPES_FLAG, DEVICE_D4L_COMPANION_ANNOTATION_ITEM_TIMESTAMP, DEVICE_DISPLAY_LABEL_CODING, type DEVICE_KEY, type DEVICE_KEY_API, type DEVICE_KEY_BLE, type DEVICE_KEY_INTERNAL, type DEVICE_KEY_SDK, DEVICE_KEY_TO_NAME, DEVICE_LABEL_CODING, type DEVICE_MOVELLA_PAYLOAD_MODES, DEVICE_OUTPUT_RATE_CODING, DEVICE_SENSOR_DELAY_CODING, type DEVICE_SIGNAL_TYPE, type DateBlurringFunction, DateCondition, DecimalCondition, type DeviceConfig, type DeviceName, Disjunction, type Display, type DisplayContent, type DisplayContentPath, type DisplayPath, type DisplayType, type DonationRecord, DonationSDK, type DonorIdentity, ERROR_CODES, ExistsCondition, type ExtendedProgramDevicesDataType, FITBIT_ANNOTATION_ITEM_BREATHING_RATE, FITBIT_ANNOTATION_ITEM_CALORIES, FITBIT_ANNOTATION_ITEM_HEART_RATE, FITBIT_ANNOTATION_ITEM_HEART_RATE_VARIABILITY, FITBIT_ANNOTATION_ITEM_SKIN_TEMPERATURE, FITBIT_ANNOTATION_ITEM_SLEEP_LEVEL, FITBIT_ANNOTATION_ITEM_SLEEP_LEVEL_DURATION, FITBIT_ANNOTATION_ITEM_SPO2, FITBIT_ANNOTATION_ITEM_STEPS, FITBIT_BREATHING_RATE_ANNOTATION, FITBIT_CALORIES_ANNOTATION, FITBIT_HEART_RATE_ANNOTATION, FITBIT_HEART_RATE_VARIABILITY_ANNOTATION, FITBIT_SIGNAL_TYPE_ANNOTATIONS, FITBIT_SKIN_TEMPERATURE_ANNOTATION, FITBIT_SLEEP_ANNOTATION, FITBIT_SLEEP_LEVEL_MAP, FITBIT_SPO2_ANNOTATION, FITBIT_STEPS_ANNOTATION, type FitbitSleepLevelTypes, type FrequencySubset, type FrequencyType, type Guard, IMUAnnotation, type InternalDeviceConfig, InternalSensorAnnotationTypes, KeyHandler, MaxValueExtension, MeasurementTypeSystem, type Message, type MessagePath, type MessageRecipient, MinLengthExtension, MinValueExtension, type MultiAnswers, ObservationTypeSystem, Offset, PAMSCardioVascularActivityAnnotation, PAMSGeneralActivityInstantaneousAnnotation, PAMSGeneralActivitySummaryAnnotation, PAMSStepCounterActivitySummaryAnnotation, PSMSHeartRateAnnotation, PSMSPPGGreenAnnotation, PSMSPPGIRAnnotation, PSMSPPGRedAnnotation, PSMSSkinTemperatureAnnotation, type PreviewTimeSeriesItem, type Program, type ProgramAnonymization, type ProgramClientTarget, type ProgramConsentStep, type ProgramContact, type ProgramContent, type ProgramContentPath, type ProgramDevice, type ProgramDeviceType, type ProgramDevicesDataType, type ProgramDevicesLabel, type ProgramDisplayStep, type ProgramDonation, type ProgramEligibilityStep, type ProgramFeatured, type ProgramRoutineStep, type ProgramSensorStep, type ProgramStep, type ProgramStepBase, type ProgramStepType, type ProgramSurveyStep, type ProgramTag, type ProgramTokenStep, type ProgramType, QItemControlDefinition, type QuestionInputType, type QuestionnaireResponse, type QuestionnaireScore, RECORDING_MODEL_CURRENT_VERSION, RECORDING_SIGNAL_MODEL_CURRENT_VERSION, type RecordState, type Recording, type RecordingSignal, type RecordingSignalItem, type RecordingSignalPreview, type RecordingSignalWithId, type RecordingTag, type RecursiveKeyOf, RelativeMaxValueExtension, RelativeMinValueExtension, type ReminderFrequencyType, type ReponseValue, type ResearchSubject, type ResearchSubjectProgress, type ResearchSubjectProgressState, type ResponseMinimal, type RestorationSize, type Routine, RoutineCondition, type RoutineContent, type RoutineContentPath, type RoutineContentStep, RoutineIsPassiveExtension, type RoutineTimes, type SDKDeviceConfig, type SDKInterface, SIGNAL_DURATION_CODING, type ScoreThreshold, type SeenDisplay, type SeenMessage, SensorIdentifierSystem, SensorSettingsSystem, SensorTypeSystem, SignalIDSystem, type SkippedStep, SliderMaxLabelExtension, SliderMinLabelExtension, SliderStepSizeExtension, type StepCondition, type StringTemplater, StudyNameSystem, type Survey, SurveyCondition, type SurveyContent, type SurveyContentPath, type SurveyScoring, type Tag, type TagEffectiveType, type TaskFrequency, type TaskReminder, type Threshold, TimeFuncs, type TimeWindow, TokenNamingSystem, type TranslatedString, ULID_REGEX, ULIDtoUUID, UUID_REGEX, UUIDtoULID, WORDLIST_LANGUAGES, WearOS3AnnotationMap, WebConverter, type WordListLanguage, YearCondition, binaryStringToUint8Array, calculateQuestionnaireScoreRange, calculateScoreRangeForItem, capitalizeFirstLetter, dayFormat, extractWordsFromRecoveryPhrase, generateFHIRConsent, generateFHIRQuestionnaireScore, generateFHIRRecordingBundle, generateFHIRResearchSubject, generateFHIRResponse, generateFHIRSeenDisplay, generateFHIRSeenMessage, generateFHIRTag, generateQuestionGuard, generateStepGuard, generateUrn, get, getLanguageOfPassPhrase, getMovellaAnnotation, getText, getTimeFuncs, indexArrayBy, isBeforeStartDate, isNotAfterEndDate, isNotBeforeStartDate, isScoreEligible, isYearString, newStepDateCondtion, overwriteTime, stringToDate, stringToYear, timezonelessDate, toDeviceConfig, toQuestionnaireResponseItem, uint8ArrayToBinaryString, utf8ToUint8Array, wordlists };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as fhir_r5 from 'fhir/r5';
2
- import { Duration } from 'luxon';
2
+ import { DateTimeUnit, Duration } from 'luxon';
3
3
 
4
4
  type ConsentTimes = {
5
5
  [key: string]: Date | null;
@@ -37,7 +37,6 @@ type TaskFrequency = {
37
37
  type: FrequencyType;
38
38
  start: string;
39
39
  end?: string;
40
- location?: string;
41
40
  factor?: number;
42
41
  editDuration?: string;
43
42
  skipFirst?: boolean;
@@ -165,6 +164,10 @@ interface QuestionnaireScore {
165
164
  * The actual score
166
165
  */
167
166
  value: number;
167
+ /**
168
+ * The minimum score
169
+ */
170
+ min: number;
168
171
  /**
169
172
  * The maximum score
170
173
  */
@@ -284,7 +287,6 @@ type ProgramDonation = {
284
287
  };
285
288
  type ProgramAnonymization = {
286
289
  blur?: {
287
- location: string;
288
290
  authored?: DateBlurringFunction;
289
291
  researchSubject?: DateBlurringFunction;
290
292
  };
@@ -777,10 +779,25 @@ declare function getText<K>(content: any, path: K, lng: string): string;
777
779
  * @returns The value at the path or undefined
778
780
  */
779
781
  declare function get(obj: Record<string, any>, path: string): string | undefined;
782
+ /**
783
+ * Create an index map out of an array
784
+ * @param array Any array that contains objects
785
+ * @param keyField The key which is used to index
786
+ * @returns An object which contains the elements from the array indexed by _keyField_
787
+ */
788
+ declare const indexArrayBy: <T extends Record<string, any>, K extends keyof T>(array: T[] | undefined, keyField: K) => Record<T[K], T>;
780
789
 
781
790
  declare function generateFHIRQuestionnaireScore(id: string, data: QuestionnaireScore & {
782
791
  createdAt: string;
783
792
  }, stringTemplater: StringTemplater): fhir5.Observation;
793
+ type Range = {
794
+ min: number;
795
+ max: number;
796
+ };
797
+ declare function calculateQuestionnaireScoreRange(questionnaire: fhir5.Questionnaire, scoring: SurveyScoring | undefined): Range;
798
+ declare function calculateScoreRangeForItem(item: fhir5.QuestionnaireItem, valueSets: {
799
+ [key: string]: fhir5.ValueSet;
800
+ }, scoring: SurveyScoring): Range;
784
801
 
785
802
  declare function generateFHIRResponse(id: string, { programName, effectiveDate, language, questionnaire, createdAt, status, answers, }: QuestionnaireResponse): fhir5.QuestionnaireResponse;
786
803
  declare const toQuestionnaireResponseItem: (answer: {
@@ -805,6 +822,87 @@ declare function generateFHIRTag(id: string, code: string, date: string, labels:
805
822
  [key: string]: string;
806
823
  }, stringTemplater: StringTemplater): fhir5.Observation;
807
824
 
825
+ type TimeWindow = {
826
+ start: Date;
827
+ end: Date;
828
+ };
829
+ /**
830
+ * Subset of TaskFrequency type required for time functions.
831
+ * Start is an ISO 8601 timestamp indicating the starting point for the frequency subset.
832
+ */
833
+ type FrequencySubset = {
834
+ factor?: number;
835
+ start?: string;
836
+ type: FrequencyType;
837
+ };
838
+
839
+ /**
840
+ * Returns the timeFuncs for the given parameters.
841
+ * Can be used with task.frequency and an optional overwrite for the startDate
842
+ * @param parameters subset of task frequency
843
+ * @param startDate startDate as a means to overwrite date part of the frequency start
844
+ * @returns
845
+ */
846
+ declare const getTimeFuncs: (parameters: FrequencySubset, startDate?: Date) => TimeFuncs;
847
+ /**
848
+ * Abstract class for functions to manipulate time based on a given window size
849
+ */
850
+ declare abstract class TimeFuncs {
851
+ abstract unit: DateTimeUnit;
852
+ factor: number;
853
+ start?: string;
854
+ constructor(parameters?: {
855
+ factor?: number;
856
+ start?: string;
857
+ });
858
+ abstract addFunc(base: Date, x: number): Date;
859
+ add(base: Date, x: number): Date;
860
+ abstract diffFunc(later: Date, earlier: Date): number;
861
+ diff(later: Date, earlier: Date): number;
862
+ abstract formatFunc(date: Date): string;
863
+ group(date: Date): string;
864
+ private startOfUnit;
865
+ private endOfUnit;
866
+ window(date: Date): TimeWindow;
867
+ }
868
+
869
+ declare const dayFormat: (date: Date) => string;
870
+ /**
871
+ * Checks if the given date is not after the effective end date
872
+ * @param effectiveEndDate
873
+ * @param date
874
+ * @returns true if there is no endDate or if the date is not after the endDate
875
+ */
876
+ declare const isNotAfterEndDate: (effectiveEndDate: Date | undefined, date: Date) => boolean;
877
+ /**
878
+ * Checks if the given date is not before the start date
879
+ * @param startDate
880
+ * @param date
881
+ * @returns true if there is no startDate or if the date is not before the startDate
882
+ */
883
+ declare const isNotBeforeStartDate: (startDate: Date | undefined, date: Date) => boolean;
884
+ /**
885
+ * Checks if the given date is before the start date
886
+ * @param start
887
+ * @param date
888
+ * @returns true if there is a start and the date is before the start date
889
+ */
890
+ declare const isBeforeStartDate: (start: string | Date | undefined, date: Date) => boolean | "" | undefined;
891
+ /**
892
+ * Overwrite the time of a date with a given timestamp (ignoring timezone information)
893
+ * @param date the date the time should be applied to
894
+ * @param timeComponent ISO 8601 timestamp string to take the time from
895
+ * @returns
896
+ */
897
+ declare const overwriteTime: (date: Date | null | undefined, timeComponent: string | undefined) => Date | undefined;
898
+ /**
899
+ * Converts a ISO 8601 timestamp string to a Date ignoring the timezone
900
+ * Uses luxon for date parsing (allows setting default timezone in tests)
901
+ * @param input
902
+ * @returns timestamp without timezone information
903
+ */
904
+ declare const timezonelessDate: (input: string) => Date;
905
+
808
906
  interface CryptoModule {
809
907
  deriveEncryptionKey(recoveryKey: Uint8Array, salt: string): Promise<Uint8Array>;
810
908
  generateKey(size: number): Uint8Array;
@@ -1316,4 +1414,4 @@ declare const API_TARGET_MAP: {
1316
1414
  };
1317
1415
  };
1318
1416
 
1319
- export { ANDROID_SENSORS_CONSTANT_NAMES, type API, type APIConfig, type APIDeviceConfig, API_TARGET_MAP, APPLE_HEALTH_ACTIVE_ENERGY_ANNOTATION, APPLE_HEALTH_ANNOTATION_ITEM_ACTIVE_ENERGY, APPLE_HEALTH_ANNOTATION_ITEM_SLEEP_DURATION, APPLE_HEALTH_ANNOTATION_ITEM_SLEEP_STATE, APPLE_HEALTH_ANNOTATION_ITEM_STEP_COUNT, APPLE_HEALTH_ANNOTATION_ITEM_WALKING_RUNNING_DISTANCE, APPLE_HEALTH_SIGNAL_TYPE_ANNOTATIONS, APPLE_HEALTH_SLEEP_ANALYSIS_ANNOTATION, APPLE_HEALTH_SLEEP_STATE_MAP, APPLE_HEALTH_STEP_COUNT_ANNOTATION, APPLE_HEALTH_WALKING_RUNNING_DISTANCE_ANNOTATION, ASMSECGMeasurementAnnotation, ASMSSpO2MeasurementAnnotation, type Answer, AnswerCodeCondition, type Answers, AppIDNamingSystem, type AppleHealthSleepStates, type BLEDeviceConfig, BLE_ASMS_ANNOTATION_ITEM_ECG, BLE_ASMS_ANNOTATION_ITEM_SPO2, BLE_CPMS_ANNOTATION_ITEM_ACTIVITY_TYPE, BLE_CPMS_ANNOTATION_ITEM_DAILY_CALORIES, BLE_CPMS_ANNOTATION_ITEM_DAILY_DISTANCE, BLE_CPMS_ANNOTATION_ITEM_DAILY_ELEVATION_GAIN, BLE_CPMS_ANNOTATION_ITEM_DAILY_FLOORS, BLE_CPMS_ANNOTATION_ITEM_DAILY_STEPS, BLE_PAMS_ANNOTATION_ITEM_ABSOLUTE_ELEVATION, BLE_PAMS_ANNOTATION_ITEM_AVERAGE_MOTION_CADENCE, BLE_PAMS_ANNOTATION_ITEM_AVERAGE_SPEED, BLE_PAMS_ANNOTATION_ITEM_BYTE, BLE_PAMS_ANNOTATION_ITEM_CALORIES_TOTAL, BLE_PAMS_ANNOTATION_ITEM_DISTANCE_TOTAL, BLE_PAMS_ANNOTATION_ITEM_FLAGS_16, BLE_PAMS_ANNOTATION_ITEM_FLAGS_24, BLE_PAMS_ANNOTATION_ITEM_FLAGS_32, BLE_PAMS_ANNOTATION_ITEM_FLAGS_8, BLE_PAMS_ANNOTATION_ITEM_FLOORS_TOTAL, BLE_PAMS_ANNOTATION_ITEM_FOUR_BYTES, BLE_PAMS_ANNOTATION_ITEM_HEADER, BLE_PAMS_ANNOTATION_ITEM_HEART_RATE, BLE_PAMS_ANNOTATION_ITEM_MAXIMUM_MOTION_CADENCE, BLE_PAMS_ANNOTATION_ITEM_MAXIMUM_SPEED, BLE_PAMS_ANNOTATION_ITEM_MINIMUM_MOTION_CADENCE, BLE_PAMS_ANNOTATION_ITEM_MINIMUM_SPEED, BLE_PAMS_ANNOTATION_ITEM_MOTION_CADENCE, BLE_PAMS_ANNOTATION_ITEM_NEGATIVE_ELEVATION_GAIN, BLE_PAMS_ANNOTATION_ITEM_POSITIVE_ELEVATION_GAIN, BLE_PAMS_ANNOTATION_ITEM_RUNNING_STEPS_TOTAL, BLE_PAMS_ANNOTATION_ITEM_SPEED, BLE_PAMS_ANNOTATION_ITEM_STEPS_TOTAL, BLE_PAMS_ANNOTATION_ITEM_THREE_BYTES, BLE_PAMS_ANNOTATION_ITEM_TWO_BYTES, BLE_PAMS_ANNOTATION_ITEM_VO2_MAX, BLE_PSMS_ANNOTATION_ITEM_HEART_RATE, BLE_PSMS_ANNOTATION_ITEM_IBI, BLE_PSMS_ANNOTATION_ITEM_PPG_GREEN, BLE_PSMS_ANNOTATION_ITEM_PPG_IR, BLE_PSMS_ANNOTATION_ITEM_PPG_RED, BLE_PSMS_ANNOTATION_ITEM_SKIN_TEMPERATURE, type BaseDeviceConfig, type BleDeviceMetaLabel, BoolCondition, CPMSHealthServicesActivityDetectionAnnotation, CPMSHealthServicesPassiveDataAnnotation, CommunicationTypeSystem, type ComparisonOperator, type ConditionOperatorType, type ConditionQuestionType, type ConditionSorting, type ConditionType, Conjunction, type Consent, ConsentCondition, ConsentNameSystem, type ConsentPath, type ConsentTimes, ConsentVersionSystem, type ContentBlock, type Converter, type CryptoModule, CustomExtensionDate, CustomExtensionStudyName, CustomQuestionSystem, type DEVICE_ANNOTATION, type DEVICE_ANNOTATION_DATA_FORMAT, type DEVICE_ANNOTATION_DATA_TYPE, DEVICE_ANNOTATION_HEARTRATE, type DEVICE_ANNOTATION_ITEM, DEVICE_ANNOTATION_ITEM_ACCELERATION, DEVICE_ANNOTATION_ITEM_ANGULAR_SPEED, DEVICE_ANNOTATION_ITEM_BEACON_ID, DEVICE_ANNOTATION_ITEM_DISTANCE, DEVICE_ANNOTATION_ITEM_EGVS, DEVICE_ANNOTATION_ITEM_HEARTRATE, DEVICE_ANNOTATION_ITEM_MAGNETIC_FIELD, DEVICE_ANNOTATION_ITEM_REMOTE_DISTANCE, DEVICE_ANNOTATION_ITEM_RSSI, DEVICE_ANNOTATION_ITEM_UNIX_TIMESTAMP, DEVICE_ANNOTATION_TIMESTAMP_NOTE, DEVICE_ANNOTATION_TIMESTAMP_SIZE, DEVICE_ANNOTATION_TIMESTAMP_UNIT, DEVICE_D4L_COMPANION_ANNOTATION_ITEM_DATA_TYPES_FLAG, DEVICE_D4L_COMPANION_ANNOTATION_ITEM_TIMESTAMP, DEVICE_DISPLAY_LABEL_CODING, type DEVICE_KEY, type DEVICE_KEY_API, type DEVICE_KEY_BLE, type DEVICE_KEY_INTERNAL, type DEVICE_KEY_SDK, DEVICE_KEY_TO_NAME, DEVICE_LABEL_CODING, type DEVICE_MOVELLA_PAYLOAD_MODES, DEVICE_OUTPUT_RATE_CODING, DEVICE_SENSOR_DELAY_CODING, type DEVICE_SIGNAL_TYPE, type DateBlurringFunction, DateCondition, DecimalCondition, type DeviceConfig, type DeviceName, Disjunction, type Display, type DisplayContent, type DisplayContentPath, type DisplayPath, type DisplayType, type DonationRecord, DonationSDK, type DonorIdentity, ERROR_CODES, ExistsCondition, type ExtendedProgramDevicesDataType, FITBIT_ANNOTATION_ITEM_BREATHING_RATE, FITBIT_ANNOTATION_ITEM_CALORIES, FITBIT_ANNOTATION_ITEM_HEART_RATE, FITBIT_ANNOTATION_ITEM_HEART_RATE_VARIABILITY, FITBIT_ANNOTATION_ITEM_SKIN_TEMPERATURE, FITBIT_ANNOTATION_ITEM_SLEEP_LEVEL, FITBIT_ANNOTATION_ITEM_SLEEP_LEVEL_DURATION, FITBIT_ANNOTATION_ITEM_SPO2, FITBIT_ANNOTATION_ITEM_STEPS, FITBIT_BREATHING_RATE_ANNOTATION, FITBIT_CALORIES_ANNOTATION, FITBIT_HEART_RATE_ANNOTATION, FITBIT_HEART_RATE_VARIABILITY_ANNOTATION, FITBIT_SIGNAL_TYPE_ANNOTATIONS, FITBIT_SKIN_TEMPERATURE_ANNOTATION, FITBIT_SLEEP_ANNOTATION, FITBIT_SLEEP_LEVEL_MAP, FITBIT_SPO2_ANNOTATION, FITBIT_STEPS_ANNOTATION, type FitbitSleepLevelTypes, type FrequencyType, type Guard, IMUAnnotation, type InternalDeviceConfig, InternalSensorAnnotationTypes, KeyHandler, MaxValueExtension, MeasurementTypeSystem, type Message, type MessagePath, type MessageRecipient, MinLengthExtension, MinValueExtension, type MultiAnswers, ObservationTypeSystem, Offset, PAMSCardioVascularActivityAnnotation, PAMSGeneralActivityInstantaneousAnnotation, PAMSGeneralActivitySummaryAnnotation, PAMSStepCounterActivitySummaryAnnotation, PSMSHeartRateAnnotation, PSMSPPGGreenAnnotation, PSMSPPGIRAnnotation, PSMSPPGRedAnnotation, PSMSSkinTemperatureAnnotation, type PreviewTimeSeriesItem, type Program, type ProgramAnonymization, type ProgramClientTarget, type ProgramConsentStep, type ProgramContact, type ProgramContent, type ProgramContentPath, type ProgramDevice, type ProgramDeviceType, type ProgramDevicesDataType, type ProgramDevicesLabel, type ProgramDisplayStep, type ProgramDonation, type ProgramEligibilityStep, type ProgramFeatured, type ProgramRoutineStep, type ProgramSensorStep, type ProgramStep, type ProgramStepBase, type ProgramStepType, type ProgramSurveyStep, type ProgramTag, type ProgramTokenStep, type ProgramType, QItemControlDefinition, type QuestionInputType, type QuestionnaireResponse, type QuestionnaireScore, RECORDING_MODEL_CURRENT_VERSION, RECORDING_SIGNAL_MODEL_CURRENT_VERSION, type RecordState, type Recording, type RecordingSignal, type RecordingSignalItem, type RecordingSignalPreview, type RecordingSignalWithId, type RecordingTag, type RecursiveKeyOf, RelativeMaxValueExtension, RelativeMinValueExtension, type ReminderFrequencyType, type ReponseValue, type ResearchSubject, type ResearchSubjectProgress, type ResearchSubjectProgressState, type ResponseMinimal, type RestorationSize, type Routine, RoutineCondition, type RoutineContent, type RoutineContentPath, type RoutineContentStep, RoutineIsPassiveExtension, type RoutineTimes, type SDKDeviceConfig, type SDKInterface, SIGNAL_DURATION_CODING, type ScoreThreshold, type SeenDisplay, type SeenMessage, SensorIdentifierSystem, SensorSettingsSystem, SensorTypeSystem, SignalIDSystem, type SkippedStep, SliderMaxLabelExtension, SliderMinLabelExtension, SliderStepSizeExtension, type StepCondition, type StringTemplater, StudyNameSystem, type Survey, SurveyCondition, type SurveyContent, type SurveyContentPath, type SurveyScoring, type Tag, type TagEffectiveType, type TaskFrequency, type TaskReminder, type Threshold, TokenNamingSystem, type TranslatedString, ULID_REGEX, ULIDtoUUID, UUID_REGEX, UUIDtoULID, WORDLIST_LANGUAGES, WearOS3AnnotationMap, WebConverter, type WordListLanguage, YearCondition, binaryStringToUint8Array, capitalizeFirstLetter, extractWordsFromRecoveryPhrase, generateFHIRConsent, generateFHIRQuestionnaireScore, generateFHIRRecordingBundle, generateFHIRResearchSubject, generateFHIRResponse, generateFHIRSeenDisplay, generateFHIRSeenMessage, generateFHIRTag, generateQuestionGuard, generateStepGuard, generateUrn, get, getLanguageOfPassPhrase, getMovellaAnnotation, getText, isScoreEligible, isYearString, newStepDateCondtion, stringToDate, stringToYear, toDeviceConfig, toQuestionnaireResponseItem, uint8ArrayToBinaryString, utf8ToUint8Array, wordlists };
1417
+ export { ANDROID_SENSORS_CONSTANT_NAMES, type API, type APIConfig, type APIDeviceConfig, API_TARGET_MAP, APPLE_HEALTH_ACTIVE_ENERGY_ANNOTATION, APPLE_HEALTH_ANNOTATION_ITEM_ACTIVE_ENERGY, APPLE_HEALTH_ANNOTATION_ITEM_SLEEP_DURATION, APPLE_HEALTH_ANNOTATION_ITEM_SLEEP_STATE, APPLE_HEALTH_ANNOTATION_ITEM_STEP_COUNT, APPLE_HEALTH_ANNOTATION_ITEM_WALKING_RUNNING_DISTANCE, APPLE_HEALTH_SIGNAL_TYPE_ANNOTATIONS, APPLE_HEALTH_SLEEP_ANALYSIS_ANNOTATION, APPLE_HEALTH_SLEEP_STATE_MAP, APPLE_HEALTH_STEP_COUNT_ANNOTATION, APPLE_HEALTH_WALKING_RUNNING_DISTANCE_ANNOTATION, ASMSECGMeasurementAnnotation, ASMSSpO2MeasurementAnnotation, type Answer, AnswerCodeCondition, type Answers, AppIDNamingSystem, type AppleHealthSleepStates, type BLEDeviceConfig, BLE_ASMS_ANNOTATION_ITEM_ECG, BLE_ASMS_ANNOTATION_ITEM_SPO2, BLE_CPMS_ANNOTATION_ITEM_ACTIVITY_TYPE, BLE_CPMS_ANNOTATION_ITEM_DAILY_CALORIES, BLE_CPMS_ANNOTATION_ITEM_DAILY_DISTANCE, BLE_CPMS_ANNOTATION_ITEM_DAILY_ELEVATION_GAIN, BLE_CPMS_ANNOTATION_ITEM_DAILY_FLOORS, BLE_CPMS_ANNOTATION_ITEM_DAILY_STEPS, BLE_PAMS_ANNOTATION_ITEM_ABSOLUTE_ELEVATION, BLE_PAMS_ANNOTATION_ITEM_AVERAGE_MOTION_CADENCE, BLE_PAMS_ANNOTATION_ITEM_AVERAGE_SPEED, BLE_PAMS_ANNOTATION_ITEM_BYTE, BLE_PAMS_ANNOTATION_ITEM_CALORIES_TOTAL, BLE_PAMS_ANNOTATION_ITEM_DISTANCE_TOTAL, BLE_PAMS_ANNOTATION_ITEM_FLAGS_16, BLE_PAMS_ANNOTATION_ITEM_FLAGS_24, BLE_PAMS_ANNOTATION_ITEM_FLAGS_32, BLE_PAMS_ANNOTATION_ITEM_FLAGS_8, BLE_PAMS_ANNOTATION_ITEM_FLOORS_TOTAL, BLE_PAMS_ANNOTATION_ITEM_FOUR_BYTES, BLE_PAMS_ANNOTATION_ITEM_HEADER, BLE_PAMS_ANNOTATION_ITEM_HEART_RATE, BLE_PAMS_ANNOTATION_ITEM_MAXIMUM_MOTION_CADENCE, BLE_PAMS_ANNOTATION_ITEM_MAXIMUM_SPEED, BLE_PAMS_ANNOTATION_ITEM_MINIMUM_MOTION_CADENCE, BLE_PAMS_ANNOTATION_ITEM_MINIMUM_SPEED, BLE_PAMS_ANNOTATION_ITEM_MOTION_CADENCE, BLE_PAMS_ANNOTATION_ITEM_NEGATIVE_ELEVATION_GAIN, BLE_PAMS_ANNOTATION_ITEM_POSITIVE_ELEVATION_GAIN, BLE_PAMS_ANNOTATION_ITEM_RUNNING_STEPS_TOTAL, BLE_PAMS_ANNOTATION_ITEM_SPEED, BLE_PAMS_ANNOTATION_ITEM_STEPS_TOTAL, BLE_PAMS_ANNOTATION_ITEM_THREE_BYTES, BLE_PAMS_ANNOTATION_ITEM_TWO_BYTES, BLE_PAMS_ANNOTATION_ITEM_VO2_MAX, BLE_PSMS_ANNOTATION_ITEM_HEART_RATE, BLE_PSMS_ANNOTATION_ITEM_IBI, BLE_PSMS_ANNOTATION_ITEM_PPG_GREEN, BLE_PSMS_ANNOTATION_ITEM_PPG_IR, BLE_PSMS_ANNOTATION_ITEM_PPG_RED, BLE_PSMS_ANNOTATION_ITEM_SKIN_TEMPERATURE, type BaseDeviceConfig, type BleDeviceMetaLabel, BoolCondition, CPMSHealthServicesActivityDetectionAnnotation, CPMSHealthServicesPassiveDataAnnotation, CommunicationTypeSystem, type ComparisonOperator, type ConditionOperatorType, type ConditionQuestionType, type ConditionSorting, type ConditionType, Conjunction, type Consent, ConsentCondition, ConsentNameSystem, type ConsentPath, type ConsentTimes, ConsentVersionSystem, type ContentBlock, type Converter, type CryptoModule, CustomExtensionDate, CustomExtensionStudyName, CustomQuestionSystem, type DEVICE_ANNOTATION, type DEVICE_ANNOTATION_DATA_FORMAT, type DEVICE_ANNOTATION_DATA_TYPE, DEVICE_ANNOTATION_HEARTRATE, type DEVICE_ANNOTATION_ITEM, DEVICE_ANNOTATION_ITEM_ACCELERATION, DEVICE_ANNOTATION_ITEM_ANGULAR_SPEED, DEVICE_ANNOTATION_ITEM_BEACON_ID, DEVICE_ANNOTATION_ITEM_DISTANCE, DEVICE_ANNOTATION_ITEM_EGVS, DEVICE_ANNOTATION_ITEM_HEARTRATE, DEVICE_ANNOTATION_ITEM_MAGNETIC_FIELD, DEVICE_ANNOTATION_ITEM_REMOTE_DISTANCE, DEVICE_ANNOTATION_ITEM_RSSI, DEVICE_ANNOTATION_ITEM_UNIX_TIMESTAMP, DEVICE_ANNOTATION_TIMESTAMP_NOTE, DEVICE_ANNOTATION_TIMESTAMP_SIZE, DEVICE_ANNOTATION_TIMESTAMP_UNIT, DEVICE_D4L_COMPANION_ANNOTATION_ITEM_DATA_TYPES_FLAG, DEVICE_D4L_COMPANION_ANNOTATION_ITEM_TIMESTAMP, DEVICE_DISPLAY_LABEL_CODING, type DEVICE_KEY, type DEVICE_KEY_API, type DEVICE_KEY_BLE, type DEVICE_KEY_INTERNAL, type DEVICE_KEY_SDK, DEVICE_KEY_TO_NAME, DEVICE_LABEL_CODING, type DEVICE_MOVELLA_PAYLOAD_MODES, DEVICE_OUTPUT_RATE_CODING, DEVICE_SENSOR_DELAY_CODING, type DEVICE_SIGNAL_TYPE, type DateBlurringFunction, DateCondition, DecimalCondition, type DeviceConfig, type DeviceName, Disjunction, type Display, type DisplayContent, type DisplayContentPath, type DisplayPath, type DisplayType, type DonationRecord, DonationSDK, type DonorIdentity, ERROR_CODES, ExistsCondition, type ExtendedProgramDevicesDataType, FITBIT_ANNOTATION_ITEM_BREATHING_RATE, FITBIT_ANNOTATION_ITEM_CALORIES, FITBIT_ANNOTATION_ITEM_HEART_RATE, FITBIT_ANNOTATION_ITEM_HEART_RATE_VARIABILITY, FITBIT_ANNOTATION_ITEM_SKIN_TEMPERATURE, FITBIT_ANNOTATION_ITEM_SLEEP_LEVEL, FITBIT_ANNOTATION_ITEM_SLEEP_LEVEL_DURATION, FITBIT_ANNOTATION_ITEM_SPO2, FITBIT_ANNOTATION_ITEM_STEPS, FITBIT_BREATHING_RATE_ANNOTATION, FITBIT_CALORIES_ANNOTATION, FITBIT_HEART_RATE_ANNOTATION, FITBIT_HEART_RATE_VARIABILITY_ANNOTATION, FITBIT_SIGNAL_TYPE_ANNOTATIONS, FITBIT_SKIN_TEMPERATURE_ANNOTATION, FITBIT_SLEEP_ANNOTATION, FITBIT_SLEEP_LEVEL_MAP, FITBIT_SPO2_ANNOTATION, FITBIT_STEPS_ANNOTATION, type FitbitSleepLevelTypes, type FrequencySubset, type FrequencyType, type Guard, IMUAnnotation, type InternalDeviceConfig, InternalSensorAnnotationTypes, KeyHandler, MaxValueExtension, MeasurementTypeSystem, type Message, type MessagePath, type MessageRecipient, MinLengthExtension, MinValueExtension, type MultiAnswers, ObservationTypeSystem, Offset, PAMSCardioVascularActivityAnnotation, PAMSGeneralActivityInstantaneousAnnotation, PAMSGeneralActivitySummaryAnnotation, PAMSStepCounterActivitySummaryAnnotation, PSMSHeartRateAnnotation, PSMSPPGGreenAnnotation, PSMSPPGIRAnnotation, PSMSPPGRedAnnotation, PSMSSkinTemperatureAnnotation, type PreviewTimeSeriesItem, type Program, type ProgramAnonymization, type ProgramClientTarget, type ProgramConsentStep, type ProgramContact, type ProgramContent, type ProgramContentPath, type ProgramDevice, type ProgramDeviceType, type ProgramDevicesDataType, type ProgramDevicesLabel, type ProgramDisplayStep, type ProgramDonation, type ProgramEligibilityStep, type ProgramFeatured, type ProgramRoutineStep, type ProgramSensorStep, type ProgramStep, type ProgramStepBase, type ProgramStepType, type ProgramSurveyStep, type ProgramTag, type ProgramTokenStep, type ProgramType, QItemControlDefinition, type QuestionInputType, type QuestionnaireResponse, type QuestionnaireScore, RECORDING_MODEL_CURRENT_VERSION, RECORDING_SIGNAL_MODEL_CURRENT_VERSION, type RecordState, type Recording, type RecordingSignal, type RecordingSignalItem, type RecordingSignalPreview, type RecordingSignalWithId, type RecordingTag, type RecursiveKeyOf, RelativeMaxValueExtension, RelativeMinValueExtension, type ReminderFrequencyType, type ReponseValue, type ResearchSubject, type ResearchSubjectProgress, type ResearchSubjectProgressState, type ResponseMinimal, type RestorationSize, type Routine, RoutineCondition, type RoutineContent, type RoutineContentPath, type RoutineContentStep, RoutineIsPassiveExtension, type RoutineTimes, type SDKDeviceConfig, type SDKInterface, SIGNAL_DURATION_CODING, type ScoreThreshold, type SeenDisplay, type SeenMessage, SensorIdentifierSystem, SensorSettingsSystem, SensorTypeSystem, SignalIDSystem, type SkippedStep, SliderMaxLabelExtension, SliderMinLabelExtension, SliderStepSizeExtension, type StepCondition, type StringTemplater, StudyNameSystem, type Survey, SurveyCondition, type SurveyContent, type SurveyContentPath, type SurveyScoring, type Tag, type TagEffectiveType, type TaskFrequency, type TaskReminder, type Threshold, TimeFuncs, type TimeWindow, TokenNamingSystem, type TranslatedString, ULID_REGEX, ULIDtoUUID, UUID_REGEX, UUIDtoULID, WORDLIST_LANGUAGES, WearOS3AnnotationMap, WebConverter, type WordListLanguage, YearCondition, binaryStringToUint8Array, calculateQuestionnaireScoreRange, calculateScoreRangeForItem, capitalizeFirstLetter, dayFormat, extractWordsFromRecoveryPhrase, generateFHIRConsent, generateFHIRQuestionnaireScore, generateFHIRRecordingBundle, generateFHIRResearchSubject, generateFHIRResponse, generateFHIRSeenDisplay, generateFHIRSeenMessage, generateFHIRTag, generateQuestionGuard, generateStepGuard, generateUrn, get, getLanguageOfPassPhrase, getMovellaAnnotation, getText, getTimeFuncs, indexArrayBy, isBeforeStartDate, isNotAfterEndDate, isNotBeforeStartDate, isScoreEligible, isYearString, newStepDateCondtion, overwriteTime, stringToDate, stringToYear, timezonelessDate, toDeviceConfig, toQuestionnaireResponseItem, uint8ArrayToBinaryString, utf8ToUint8Array, wordlists };