healbesdk / com.healbe.healbesdk.business_api.healthdata / HealthData

HealthData

interface HealthData

Interface for retrieving measurements.

HealthData accumulate data from wristband and server at local database.

Properties

anxietyDataMaxTimestamp

abstract val anxietyDataMaxTimestamp: Flowable<Long>

Returns Flowable that emits UNIX-timestamp of last anxiety at sleep data.

currentStressLevel

abstract val currentStressLevel: Flowable<Float>

Returns Flowable that emits current stress level.

currentStressState

abstract val currentStressState: Flowable<StressState>

Returns Flowable that emits current stress state.

energyDataMaxTimestamp

abstract val energyDataMaxTimestamp: Flowable<Long>

Returns Flowable that emits UNIX-timestamp of last energy data.

hydrationState

abstract val hydrationState: Flowable<HydrationState>

Returns Flowable that emits current hydration state.

lastStressData

abstract val lastStressData: Flowable<StressData>

Returns Flowable that emits last stress data.

maxWeeklyAnxietyData

abstract val maxWeeklyAnxietyData: Single<Int>

Returns Single that emits maximum anxiety at sleep value for last 7 nights

maxWeeklyEnergyData

abstract val maxWeeklyEnergyData: Single<Float>

Returns Single that emits maximum energy value (intake) for last 7 day (including today).

maxWeeklyHydrationData

abstract val maxWeeklyHydrationData: Single<Int>

Returns Single that emits maximum hydration value for last 7 day (including today).

maxWeeklyStressLevel

abstract val maxWeeklyStressLevel: Single<Float>

Returns Single that emits maximum stress value for last 7 day (including today).

minTimestamp

abstract val minTimestamp: Flowable<Long>

Returns Flowable that emits UNIX timestamp of the first measurements.

minWeeklyAnxietyData

abstract val minWeeklyAnxietyData: Single<Int>

Returns Single that emits minimum anxiety at sleep value for last 7 nights

minWeeklyEnergyData

abstract val minWeeklyEnergyData: Single<Float>

Returns Single that emits minimum energy value (burning) for last 7 day (including today).

minWeeklyHydrationData

abstract val minWeeklyHydrationData: Single<Int>

Returns Single that emits minimum hydration value for last 7 day (including today).

sleepRecommendations

abstract val sleepRecommendations: Flowable<Container<SleepRecommendations>>

Returns Flowable that emits container with sleep recommendations.

stressDataMaxTimestamp

abstract val stressDataMaxTimestamp: Flowable<Long>

Returns Flowable that emits UNIX-timestamp of last stress data.

Functions

addWeight

abstract fun addWeight(weight: HDWeight, round: ((Double) -> Double)? = null): Completable

Add new weight.

abstract fun addWeight(weights: List<HDWeight>, doNothingOnDifferentSources: Boolean = false, round: ((Double) -> Double)? = null): Completable

Add new weights.

addWeightGoal

abstract fun addWeightGoal(goal: HDWeightGoal): Completable

Add new weight goal.

deleteWeight

abstract fun deleteWeight(weight: HDWeight): Completable

Delete existing weight.

getAllDaySummaries

abstract fun getAllDaySummaries(daysBack: Int): Flowable<DaySummary>

Returns Flowable that emits summary for day daysBack ago.

getAnxietyData

abstract fun getAnxietyData(nightsBack: Int): Flowable<List<AnxietyData>>

Returns Flowable that emits list of anxiety at sleep data for night nightsBack ago.

getAnxietyDataCount

abstract fun getAnxietyDataCount(nightsBack: Int): Single<Int>

Returns Single that emits count of anxiety at sleep data for night nightsBack ago.

getAwakePeriods

abstract fun getAwakePeriods(nightsBack: Int): Flowable<List<AwakeInfo>>

Returns Flowable that emits list of awakenings at night for night nightsBack ago.

getBloodPressure

abstract fun getBloodPressure(daysBack: Int): Flowable<List<BloodPressure>>

Returns Flowable that emits list of blood pressure measurements for day daysBack ago.

getDeletedWeights

abstract fun getDeletedWeights(from: Long = 0L, asc: Boolean = true): Single<List<HDWeight>>

Returns Single that emits deleted weights sorted by HDWeight.measurementTime.

getEnergyData

abstract fun getEnergyData(daysBack: Int): Flowable<List<EnergyData>>

Returns Flowable that emits list of energy data for day daysBack ago.

abstract fun getEnergyData(sinceTimestamp: Long): Flowable<List<EnergyData>>

Returns Flowable that emits list of energy data since specified time.

getEnergyDataCount

abstract fun getEnergyDataCount(daysBack: Int): Flowable<Int>

Returns Flowable that emits count of energy data for day daysBack ago.

abstract fun getEnergyDataCount(sinceTimestamp: Long): Single<Int>

Returns Single that emits count of energy data since specified time.

getEnergySummary

abstract fun getEnergySummary(daysBack: Int): Flowable<Container<EnergySummary>>

Returns Flowable that emits container with energy summary for day daysBack ago.

abstract fun getEnergySummary(from: Long, to: Long): Flowable<List<Container<EnergySummary>>>

Returns Flowable that emits list of containers with energy summaries for period from from to to.

getEnergySummaryCount

abstract fun getEnergySummaryCount(from: Long, to: Long): Flowable<Int>

Returns Flowable that emits count of energy summaries for period from from to to.

getEnergySummaryDates

abstract fun getEnergySummaryDates(from: Long, to: Long): Flowable<List<Date>>

Returns Flowable that emits list of dates of energy summaries for period from from to to.

getFinalizedMealData

abstract fun getFinalizedMealData(since: Long): Flowable<List<MealData>>

Returns Flowable that emits list of finalized meals (which won't be changed) since specified time.

getFinalizedMealDataCount

abstract fun getFinalizedMealDataCount(since: Long): Single<Int>

Returns Single that emits count of finalized meals (which won't be changed) since specified time.

getHeartData

abstract fun getHeartData(daysBack: Int): Flowable<List<HeartData>>

Returns Flowable that emits list of heart data for day daysBack ago.

abstract fun getHeartData(from: Long, to: Long): Flowable<List<HeartData>>

Returns Flowable that emits list of heart data for period from from to to.

abstract fun getHeartData(sinceTimestamp: Long): Flowable<List<HeartData>>

Returns Flowable that emits list of heart data since specified time.

getHeartDataCount

abstract fun getHeartDataCount(sinceTimestamp: Long): Single<Int>

Returns Single that emits count of heart data since specified time.

abstract fun getHeartDataCount(daysBack: Int): Single<Int>

Returns Single that emits count of heart data for day daysBack ago.

getHeartSummary

abstract fun getHeartSummary(daysBack: Int): Flowable<Container<HeartSummary>>

Returns Flowable that emits container with heart summary for day daysBack ago.

getHydrationDataCount

abstract fun getHydrationDataCount(daysBack: Int): Single<Int>

Returns Flowable that emits count of hydration data for day daysBack ago.

getHydrationSummary

abstract fun getHydrationSummary(daysBack: Int): Flowable<Container<HydrationSummary>>

Returns Flowable that emits container with hydration summary for day daysBack ago.

getMaxStressData

abstract fun getMaxStressData(daysBack: Int): Single<Float>

Returns Single that emits maximum stress value for day daysBack ago.

getMealsGroupsInBounds

abstract fun getMealsGroupsInBounds(periods: Map<Int, LongRange>): Flowable<Map<Int, List<MealData>>>

Returns Flowable that emits lists of meals for periods.

getMinStressData

abstract fun getMinStressData(daysBack: Int): Single<Float>

Returns Single that emits minimum stress value for day daysBack ago.

getMinTimestamp

abstract fun getMinTimestamp(sinceTimestamp: Long): Flowable<Long>

Returns Flowable that emits UNIX timestamp of the first measurements since specified time.

getNonDeletedWeights

abstract fun getNonDeletedWeights(from: Timestamp = 0L, to: Long = Timestamp.MAX_VALUE, exceptSource: Source, asc: Boolean = true): Single<List<HDWeight>>

Returns Single that emits non deleted weight sorted by HDWeight.measurementTime.

getNotDeletedMealData

abstract fun getNotDeletedMealData(daysBack: Int): Flowable<List<MealData>>

Returns Flowable that emits list of meals for day daysBack ago.

getNotDeletedMealsBetween

abstract fun getNotDeletedMealsBetween(from: Long, to: Long): Flowable<List<MealData>>

Returns Flowable that emits list of meals for period from from to to.

getRemEpisodes

abstract fun getRemEpisodes(nightsBack: Int): Flowable<List<RemEpisode>>

Returns Flowable that emits list of episodes of rem sleep for night nightsBack ago.

abstract fun getRemEpisodes(since: Long): Flowable<List<RemEpisode>>

Returns Flowable that emits list of episodes of rem sleep since specified time.

getRemEpisodesCount

abstract fun getRemEpisodesCount(since: Long): Single<Int>

Returns Single that emits count of episodes of rem sleep since specified time.

getSleepEpisodes

abstract fun getSleepEpisodes(nightsBack: Int): Flowable<List<SleepEpisode>>

Returns Flowable that emits list of episodes of sleep for night nightsBack ago.

abstract fun getSleepEpisodes(from: Long, to: Long): Flowable<List<SleepEpisode>>

Returns Flowable that emits list of episodes of sleep for period from from to to.

abstract fun getSleepEpisodes(sinceTimestamp: Long): Flowable<List<SleepEpisode>>

Returns Flowable that emits list of episodes of sleep since specified time.

getSleepEpisodesCount

abstract fun getSleepEpisodesCount(since: Long): Single<Int>

Returns Single that emits list of episodes of sleep since specified time.

getSleepEvents

abstract fun getSleepEvents(nightsBack: Int): Flowable<List<SleepEvent>>

Returns Flowable that emits list of sleep events for night nightsBack ago.

getSleepSummary

abstract fun getSleepSummary(nightsBack: Int): Flowable<Container<SleepSummary>>

Returns Flowable that emits container with sleep summary for night nightsBack ago.

getStepsData

abstract fun getStepsData(sinceTimestamp: Long): Flowable<List<StepsData>>

Returns Flowable that emits list of steps data since specified time.

getStepsDataCount

abstract fun getStepsDataCount(sinceTimestamp: Long): Single<Int>

Returns Single that emits count of steps data since specified time.

getStressCount

abstract fun getStressCount(daysBack: Int): Single<Int>

Returns Single that emits count of stress data for day daysBack ago.

abstract fun getStressCount(from: Long, to: Long): Single<Int>

Returns Single that emits count of stress data for period from from to to.

getStressData

abstract fun getStressData(daysBack: Int): Flowable<List<StressData>>

Returns Flowable that emits list of stress data for day daysBack ago.

abstract fun getStressData(from: Long, to: Long): Flowable<List<StressData>>

Returns Flowable that emits list of stress data for period from from to to.

getStressSummary

abstract fun getStressSummary(daysBack: Int): Flowable<Container<StressSummary>>

Returns Flowable that emits container with stress summary for day daysBack ago.

getStressTimeMinutes

abstract fun getStressTimeMinutes(level: StressLevel, from: Long, to: Long): Flowable<Int>

Returns Flowable that emits duration in minutes of specified stress level for period from from to to.

abstract fun getStressTimeMinutes(level: StressLevel, daysBack: Int): Flowable<Int>

Returns Flowable that emits duration in minutes of specified stress level for day daysBack ago.

getUpdatedWeights

abstract fun getUpdatedWeights(from: Long = 0L, exceptSource: Source, asc: Boolean = true): Single<List<HDWeight>>

Returns Single that emits non deleted weights sorted by HDWeight.measurementTime.

getWeightLastUpdatedTimestamp

abstract fun getWeightLastUpdatedTimestamp(source: Source? = null): Single<Long>

Return Single that emits last HDWeight.lastUpdate or 0 in milliseconds.

observeAccumulatedStressDuration

abstract fun observeAccumulatedStressDuration(daysBack: Int): Flowable<Int>
abstract fun observeAccumulatedStressDuration(from: Timestamp, to: Timestamp): Flowable<Int>

Returns Flowable that emits duration of accumulated stress (stress above normal) in minutes for specified period.

observeCurrentStressDuration

abstract fun observeCurrentStressDuration(): Flowable<CurrentStressDuration>

Returns Flowable that emits duration of current stress state.

observeHeartDataMaxTimestamp

abstract fun observeHeartDataMaxTimestamp(): Flowable<Long>

Returns Flowable that emits UNIX-timestamp of last heart data.

observeHydrationData

abstract fun observeHydrationData(daysBack: Int): Flowable<List<HydrationData>>

Returns Flowable that emits list of hydration data for day daysBack ago.

observeHydrationDataMaxTimestamp

abstract fun observeHydrationDataMaxTimestamp(): Flowable<Long>

Returns Flowable that emits UNIX-timestamp of last hydration data.

observeLastHydrationData

abstract fun observeLastHydrationData(): Flowable<HydrationData>

Returns Flowable that emits last hydration data.

observeLastWeight

abstract fun observeLastWeight(from: Timestamp = 0L, to: Timestamp = Timestamp.MAX_VALUE): Flowable<HDWeight>

Returns Flowable that emits last non deleted weight.

observeLastWeightGoal

abstract fun observeLastWeightGoal(): Flowable<HDWeightGoal>

Returns Flowable that emits last weight goal.

observeMaxDailyBpmValue

abstract fun observeMaxDailyBpmValue(daysBack: Int): Flowable<Int>

Returns Flowable that emits maximum pulse for day daysBack ago.

observeMaxWeeklyBpmValue

abstract fun observeMaxWeeklyBpmValue(): Flowable<Int>

Returns Flowable that emits maximum pulse for last 7 day (including today).

observeMaxWeeklyEnergyData

abstract fun observeMaxWeeklyEnergyData(): Flowable<Float>

Returns Flowable that emits maximum energy value (intake) for last 7 day (including today).

observeMinDailyBpmValue

abstract fun observeMinDailyBpmValue(daysBack: Int): Flowable<Int>

Returns Flowable that emits minimum pulse for day daysBack ago.

observeMinWeeklyBpmValue

abstract fun observeMinWeeklyBpmValue(): Flowable<Int>

Returns Flowable that emits minimum pulse for last 7 day (including today).

observeMinWeeklyEnergyData

abstract fun observeMinWeeklyEnergyData(): Flowable<Float>

Returns Flowable that emits minimum energy value (burning) for last 7 day (including today).

observeWeightGoalsDesc

abstract fun observeWeightGoalsDesc(): Flowable<List<HDWeightGoal>>

Returns Flowable that emits weight goals sorted descending.

observeWeightsNonDeleted

abstract fun observeWeightsNonDeleted(asc: Boolean = true): Flowable<List<HDWeight>>

Returns Flowable that emits non deleted weights sorted by HDWeight.measurementTime.

secondsOfWearing

abstract fun secondsOfWearing(daysBack: Int): Flowable<Int>

Returns Flowable that emits wearing duration in seconds for day daysBack ago.

abstract fun secondsOfWearing(from: Long, to: Long): Flowable<Int>

Returns Flowable that emits wearing duration in seconds for period from from to to.

updateWeight

abstract fun updateWeight(newWeight: HDWeight, oldWeight: HDWeight, round: ((Double) -> Double)? = null): Completable

Update existing weight.

updateWeightGoalStatus

abstract fun updateWeightGoalStatus(goal: HDWeightGoal, newStatus: GoalStatus? = null, changeStatusDate: Timestamp = currentTimestamp): Completable

Update weight goal status.