Device Metrics Groups

b.well Health SDK for Android

Retrieving Device Metrics Groups

Overview

The getDeviceMetricsGroups method in the b.well SDK fetches a list of DeviceMetricsGroup resources, each representing connected-device metrics organized into a named group. This is the recommended way to check for processed data after a sync call.

Method Signature

suspend fun getDeviceMetricsGroups(request: DeviceMetricsGroupsRequest?): BWellResult<DeviceMetricsGroup>
  • request: Defines paging criteria for retrieving DeviceMetricsGroup resources.
  • BWellResult<DeviceMetricsGroup>: Represents the list of device metrics groups retrieved.

Data Class: DeviceMetricsGroup

  • id: Unique identifier for the group.
  • name: Human readable name of the device metric.
  • source: Array of Strings representing the source of the data.
  • sourceDisplay: Array of Strings representing the source of the data.
  • category: A structured set of codes including a text representation.
  • coding: Coding representing the kind of device metric in this group.
  • effectiveDateTime: The single point in time when the observation was made.
  • interpretation: The interpretation of the observation results.
  • value: The value of the observation. At most, one value type will be returned per observation.
  • referenceRange: Reference ranges for interpreting the observation value.
  • component: Component observations as part of this observation.
  • references: Array of observation id references in the group.

Example Usage

val request = DeviceMetricsGroupsRequest.Builder()
    .page(0)
    .pageSize(20)
    .build()

val result = BWellSdk.health.getDeviceMetricsGroups(request)
if (result.success() && result is BWellResult.ResourceCollection) {
    val groups = result.data.orEmpty()
}

Best Practices

  • Appropriately set page and pageSize in the request to manage the volume of results.
  • Poll this method after a sync call to confirm data was processed — sync itself does not return the synced records.
  • Need the raw, ungrouped observations behind a group? See Retrieve Device Metrics.

Did this page help you?