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>: Contains resource, the typed health score, or null if 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 of BodySystemSummary entries, 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 null resource — it indicates no health score data exists yet for the patient.
  • Use bodySystems[].bodySystemId from the response to drive subsequent Body System Score calls.

Did this page help you?