Health Score
b.well Health SDK for Android
Retrieving Health Score
Overview
The getHealthScore method in the b.well SDK retrieves the authenticated patient's overall health score, including its trend, contributing body systems, and daily score history.
Method Signature
suspend fun getHealthScore(): BWellResult<HealthScoreResult>BWellResult<HealthScoreResult>: Containsresource, the typed health score, ornullif no data exists.
Data Class: HealthScore
id: Unique identifier for the health score.overallScore: The overall health score.overallGrade: A letter-grade representation of the overall score.trendDirection: The direction the score is trending.trendRate: The rate of change of the score.calculationDate,periodStart,periodEnd: Dates describing when the score was calculated and the period it covers.bodySystems: A list ofBodySystemSummaryentries, one per contributing body system.dailyScores: A list of daily score history entries.quality: A data-quality assessment for the score.recommendations: A list of recommendation strings.bioAge,actualAge,bioAgeOffset: Biological age metrics derived from the score.
Example Usage
val result = BWellSdk.health.getHealthScore()
if (result.success() && result is BWellResult.SingleResource) {
val bodySystems = result.data?.resource?.bodySystems.orEmpty()
// Use a bodySystemId from here to call getBodySystemScore
}Best Practices
- Handle a
nullresource— it indicates no health score data exists yet for the patient. - Use
bodySystems[].bodySystemIdfrom the response to drive subsequent Body System Score calls.
Updated 13 days ago
Did this page help you?
