HealthSamplingPackage class

The health sampling package supports the following overall measure type:

  • dk.cachet.carp.health

In order to specify which health data to collect, a factory method called getHealthMeasure can be used.

An example of a configuration of a study protocol using a health service to collect a set of health data once pr. hours is:

 final healthService = HealthService(types: healthDataTypes);
 protocol.addConnectedDevice(healthService, phone);

 protocol.addTaskControl(
     PeriodicTrigger(period: Duration(minutes: 60)),
     BackgroundTask(measures: [
       HealthSamplingPackage.getHealthMeasure([
         HealthDataType.STEPS,
         HealthDataType.BASAL_ENERGY_BURNED,
         HealthDataType.WEIGHT,
         HealthDataType.SLEEP_SESSION,
       ])
     ]),
     healthService);

To use this package, register it in the carp_mobile_sensing package using

  SamplingPackageRegistry.register(HealthSamplingPackage());
Inheritance
  • Object
  • SmartphoneSamplingPackage
  • HealthSamplingPackage

Constructors

HealthSamplingPackage()

Properties

dataTypes List<DataTypeMetaData>
The list of data type this package supports.
no setterinherited
deviceManager → DeviceManager<DeviceConfiguration<DeviceRegistration>>
Get the DeviceManager for the device used by this package.
no setteroverride
deviceType String
What device type is this package using?
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
permissions List<Permission>
The list of permissions that this package need in order to run.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
samplingSchemes → DataTypeSamplingSchemeMap
The default sampling schemes for all dataTypes in this package.
no setteroverride

Methods

create(String type) → Probe?
Creates a new Probe of the specified type. Note that type should be one of the dataTypes that this package supports. Returns null if a probe cannot be created for the type.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onRegister() → void
Callback method when this package is being registered.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

getHealthMeasure(List<HealthDataType> types, [int days = 30]) → Measure
Returns a health measure for the specified list of health data types. Data will be collected days days back in time. If not specified, data will be collected for the last 30 days, which is the maximum that Google Health Connect allow.

Constants

HEALTH → const String
Generic measure type for collection of health data from Apple Health or Google Health Connect.
HEALTH_NAMESPACE → const String