HealthDataTypes

public final class HealthDataTypes extends Object

Predefined health-specific data types. While read-only access to these data types is available for any app using this class (with user consent), your app must be approved to write to these data types. Read the developer docs for more information.

This class defines additional constants representing standardized data types beyond those in DataType for health data. See the DataType class for other constants and how to use DataType objects.

Field Summary

public static final DataType AGGREGATE_BLOOD_GLUCOSE_SUMMARY In the com.google.blood_glucose.summary data type, each data point represents the blood glucose of the user of a time interval.
public static final DataType AGGREGATE_BLOOD_PRESSURE_SUMMARY In the com.google.blood_pressure.summary data type, each data point represents the blood pressure of the user of a time interval.
public static final DataType AGGREGATE_BODY_TEMPERATURE_SUMMARY In the com.google.body.temperature.summary data type, each data point represents the body temperature of the user over a time interval.
public static final DataType AGGREGATE_OXYGEN_SATURATION_SUMMARY In the com.google.oxygen_saturation.summary data type, each data point represents the blood oxygen saturation of the user of a time interval.
public static final DataType TYPE_BLOOD_GLUCOSE In the com.google.blood_glucose data type, each data point represents a single instantaneous blood glucose reading.
public static final DataType TYPE_BLOOD_PRESSURE In the com.google.blood_pressure data type, each data point represents a single instantaneous blood pressure reading.
public static final DataType TYPE_BODY_TEMPERATURE In com.google.body.temperature, each data point represents a single instantaneous body temperature measurement.
public static final DataType TYPE_CERVICAL_MUCUS In type com.google.cervical_mucus data type, each data point represents a user report of their cervical mucus.
public static final DataType TYPE_CERVICAL_POSITION In the com.google.cervical_position data type, each data point represents a report of the user's cervical position.
public static final DataType TYPE_MENSTRUATION In the com.google.menstruation data type, each data point represents a report of the user's menstrual flow.
public static final DataType TYPE_OVULATION_TEST In the com.google.ovulation_test data type, each data point represents the results of an ovulation test.
public static final DataType TYPE_OXYGEN_SATURATION In the com.google.oxygen_saturation data type, each data point represents a single instantaneous blood oxygen saturation reading.
public static final DataType TYPE_VAGINAL_SPOTTING In com.google.vaginal_spotting, each data point represents an occurrence of vaginal spotting.

Inherited Method Summary

Fields

public static final DataType AGGREGATE_BLOOD_GLUCOSE_SUMMARY

In the com.google.blood_glucose.summary data type, each data point represents the blood glucose of the user of a time interval.

Each data point contains the average, minimum and maximum blood glucose over the time interval.

It also contains the temporal relation to a meal, temporal relation to sleep and specimen source if each field is set to the same value for all measurements during the time interval, or unset if the field value isn't the same across all measurements.

public static final DataType AGGREGATE_BLOOD_PRESSURE_SUMMARY

In the com.google.blood_pressure.summary data type, each data point represents the blood pressure of the user of a time interval.

Each data point has eight fields:

  • Average, minimum and maximum systolic blood pressure over the time interval.
  • Average, minimum and maximum diastolic blood pressure over the time interval.
  • Body position when measurements were taken. This field will only be set if all measurements during the time interval were performed in the same body position.
  • Blood pressure measurement location. This field will only be set if all measurements during the time interval were done at the same location on the body.

public static final DataType AGGREGATE_BODY_TEMPERATURE_SUMMARY

In the com.google.body.temperature.summary data type, each data point represents the body temperature of the user over a time interval.

Each data point contains the average, minimum and maximum body temperature of the user over the time interval.

It also contains the location the measurement was made on the body, if the measurement location was the same for all data points in the time interval.

public static final DataType AGGREGATE_OXYGEN_SATURATION_SUMMARY

In the com.google.oxygen_saturation.summary data type, each data point represents the blood oxygen saturation of the user of a time interval.

Each data point contains nine fields:

  • The average, minimum and maximum blood oxygen saturation over the time interval.
  • The average, minimum and maximum supplemental oxygen flow rate over the time interval.
  • The oxygen therapy administration mode, if it is the same for all data points in the time interval.
  • The oxygen saturation system, if it is the same for all data points in the time interval.
  • The oxygen saturation measurement method, if it is the same for all data points in the time interval.

public static final DataType TYPE_BLOOD_GLUCOSE

In the com.google.blood_glucose data type, each data point represents a single instantaneous blood glucose reading.

The data point contains fields for the blood glucose concentration, temporal relationships to meals and sleep, and the source of the specimen which was measured. All fields except blood glucose concentration are optional.

The blood glucose concentration is measured in mmol/L. 1 mmol/L is equivalent to 18 mg/dL.

If specified, temporal relation to meal must have one of the values listed in FIELD_TEMPORAL_RELATION_TO_MEAL.

Meal type must have one of the values listed in FIELD_MEAL_TYPE. If the meal type is not known, use MEAL_TYPE_UNKNOWN.

If specified, temporal relation to sleep must have one of the values listed in FIELD_TEMPORAL_RELATION_TO_SLEEP.

If specified, blood glucose specimen source must have one of the values listed in FIELD_BLOOD_GLUCOSE_SPECIMEN_SOURCE.

Sample code for creating a data point with all fields:

     DataSource bloodGlucoseSource = new DataSource.Builder()
         .setDataType(TYPE_BLOOD_GLUCOSE)
         ...
         .build();

    DataPoint bloodPressure =
         DataPoint.builder(bloodGlucoseSource)
             .setTimestamp(now.getMillis(), TimeUnit.MILLISECONDS)
             .setField(FIELD_BLOOD_GLUCOSE_LEVEL, 5.0f)
             .setField(
                 FIELD_TEMPORAL_RELATION_TO_MEAL,
                 FIELD_TEMPORAL_RELATION_TO_MEAL_BEFORE_MEAL)
             .setField(FIELD_MEAL_TYPE, MEAL_TYPE_BREAKFAST)
             .setField(FIELD_TEMPORAL_RELATION_TO_SLEEP, TEMPORAL_RELATION_TO_SLEEP_ON_WAKING)
             .setField(
                 FIELD_BLOOD_GLUCOSE_SPECIMEN_SOURCE,
                 BLOOD_GLUCOSE_SPECIMEN_SOURCE_CAPILLARY_BLOOD)
             .build();
 

public static final DataType TYPE_BLOOD_PRESSURE

In the com.google.blood_pressure data type, each data point represents a single instantaneous blood pressure reading.

The data point contains fields for the systolic and diastolic pressure, body position when the reading was taken and location on the body where the measurement was performed. All fields except systolic and diastolic pressure are optional.

The systolic and diastolic pressures are measured in mmHg.

If specified, body position must have one of the values listed in FIELD_BODY_POSITION.

If specified, measurement location must have one of the values listed in FIELD_BLOOD_PRESSURE_MEASUREMENT_LOCATION.

Sample code for creating a data point with all fields:

     DataSource bloodPressureSource = new DataSource.Builder()
         .setDataType(TYPE_BLOOD_PRESSURE)
         ...
         .build();

    DataPoint bloodPressure =
         DataPoint.builder(bloodPressureSource)
             .setTimestamp(now.getMillis(), TimeUnit.MILLISECONDS)
             .setField(FIELD_BLOOD_PRESSURE_SYSTOLIC, 120.0f)
             .setField(FIELD_BLOOD_PRESSURE_DIASTOLIC, 80.0f)
             .setField(FIELD_BODY_POSITION, BODY_POSITION_SITTING)
             .setField(
                 FIELD_BLOOD_PRESSURE_MEASUREMENT_LOCATION,
                 BLOOD_PRESSURE_MEASUREMENT_LOCATION_LEFT_UPPER_ARM)
             .build();

 

public static final DataType TYPE_BODY_TEMPERATURE

In com.google.body.temperature, each data point represents a single instantaneous body temperature measurement.

The data point contains fields for body temperature and the location of the measurement. Specifying the location of measurement is optional.

The body temperature is measured in degrees Celsius.

If specified, the measurement location must have one of the values listed in FIELD_BODY_TEMPERATURE_MEASUREMENT_LOCATION.

Sample code for creating a data point with all fields:

     DataSource bodyTemperatureDataSource = new DataSource.Builder()
         .setDataType(TYPE_BODY_TEMPERATURE)
         ...
         .build();

    DataPoint bodyTemperature =
         DataPoint.builder(bodyTemperatureDataSource)
             .setTimestamp(now.getMillis(), TimeUnit.MILLISECONDS)
             .setField(FIELD_BODY_TEMPERATURE, 37.0f)
             .setField(
                   FIELD_BODY_TEMPERATURE_MEASUREMENT_LOCATION,
                   BODY_TEMPERATURE_MEASUREMENT_LOCATION_FINGER)
             .build();
 

public static final DataType TYPE_CERVICAL_MUCUS

In type com.google.cervical_mucus data type, each data point represents a user report of their cervical mucus.

The data point contains fields for cervical mucus texture and amount. Both are optional.

If specified, cervical mucus texture must have one of the values specified in FIELD_CERVICAL_MUCUS_TEXTURE.

If specified, cervical mucus amount must have one of the values specified in FIELD_CERVICAL_MUCUS_AMOUNT.

Sample code for creating a data point with all fields:

     DataSource cervicalMucusDataSource = new DataSource.Builder()
         .setDataType(TYPE_CERVICAL_MUCUS)
         ...
         .build();

    DataPoint cervicalMucus =
         DataPoint.builder(cervicalMucusDataSource)
             .setTimestamp(now.getMillis(), TimeUnit.MILLISECONDS)
             .setField(FIELD_CERVICAL_MUCUS_TEXTURE, CERVICAL_MUCUS_TEXTURE_CREAMY)
             .setField(FIELD_CERVICAL_MUCUS_AMOUNT, CERVICAL_MUCUS_AMOUNT_MEDIUM)
             .build();
 

public static final DataType TYPE_CERVICAL_POSITION

In the com.google.cervical_position data type, each data point represents a report of the user's cervical position.

The data point contains fields for cervical position, dilation and firmness. All fields are optional.

If specified, cervical position must have one of the values listed in FIELD_CERVICAL_POSITION.

If specified, cervical dilation must have one of the values listed in FIELD_CERVICAL_DILATION.

If specified, cervical firmness must have one of the values listed in FIELD_CERVICAL_FIRMNESS.

Sample code for creating a data point with all fields:

     DataSource cervicalPositionDataSource = new DataSource.Builder()
         .setDataType(TYPE_CERVICAL_POSITION)
         ...
         .build();

    DataPoint cervicalPosition =
         DataPoint.builder(cervicalPositionDataSource)
             .setTimestamp(now.getMillis(), TimeUnit.MILLISECONDS)
             .setField(FIELD_CERVICAL_POSITION, CERVICAL_POSITION_MEDIUM)
             .setField(FIELD_CERVICAL_DILATION, CERVICAL_DILATION_MEDIUM)
             .setField(FIELD_CERVICAL_FIRMNESS, CERVICAL_FIRMNESS_MEDIUM)
             .build();
 

public static final DataType TYPE_MENSTRUATION

In the com.google.menstruation data type, each data point represents a report of the user's menstrual flow.

The data point contains a single field describing the user's menstrual flow, which may have one of the values listed in FIELD_MENSTRUAL_FLOW.

Sample code for creating a data point with all fields:

     DataSource menstruationDataSource = new DataSource.Builder()
        .setDataType(TYPE_MENSTRUATION)
        ...
        .build();

    DataPoint menstruation =
         DataPoint.builder(menstruationDataSource)
             .setTimestamp(now.getMillis(), TimeUnit.MILLISECONDS)
             .setField(FIELD_MENSTRUAL_FLOW, MENSTRUAL_FLOW_MEDIUM)
             .build();
 

public static final DataType TYPE_OVULATION_TEST

In the com.google.ovulation_test data type, each data point represents the results of an ovulation test.

The data point contains a single field, FIELD_OVULATION_TEST_RESULT, which indicates the result of the ovulation test. It may be absent or have one of the values listed in FIELD_OVULATION_TEST_RESULT.

Sample code for creating a data point with all fields:

     DataSource ovulationTestDataSource = new DataSource.Builder()
         .setDataType(TYPE_OVULATION_TEST)
         ...
         .build();

    DataPoint ovulationTest =
         DataPoint.builder(ovulationTestDataSource)
             .setTimestamp(now.getMillis(), TimeUnit.MILLISECONDS)
             .setField(FIELD_OVULATION_TEST_RESULT, OVULATION_TEST_RESULT_POSITIVE)
             .build();
 

public static final DataType TYPE_OXYGEN_SATURATION

In the com.google.oxygen_saturation data type, each data point represents a single instantaneous blood oxygen saturation reading.

The data point contains fields for oxygen saturation and details about any supplemental oxygen supplied at the time. All fields except oxygen saturation level and supplemental oxygen flow rate are optional.

Oxygen saturation is measured as a percentage.

Supplemental oxygen flow rate is measured in liters per minute (L/min). It should be set to zero if no supplemental oxygen is being provided.

If specified, oxygen therapy administration mode must have one of the values listed in FIELD_OXYGEN_THERAPY_ADMINISTRATION_MODE.

If specified, oxygen saturation system must have one of the values listed in FIELD_OXYGEN_SATURATION_SYSTEM.

If specified, oxygen saturation measurement method must have one of the values listed in FIELD_OXYGEN_SATURATION_MEASUREMENT_METHOD.

Sample code for creating a data point with all fields:

     DataSource oxygenSaturationDataSource = new DataSource.Builder()
         .setDataType(TYPE_OXYGEN_SATURATION)
         ...
         .build();

    DataPoint oxygenSaturation =
         DataPoint.builder(oxygenSaturationDataSource)
             .setTimestamp(now.getMillis(), TimeUnit.MILLISECONDS)
             .setField(FIELD_OXYGEN_SATURATION, 97.0f)
             .setField(FIELD_SUPPLEMENTAL_OXYGEN_FLOW_RATE, 3.0f)
             .setField(
                   FIELD_OXYGEN_THERAPY_ADMINISTRATION_MODE,
                   OXYGEN_THERAPY_ADMINISTRATION_MODE_NASAL_CANULA)
             .setField(
                   FIELD_OXYGEN_SATURATION_SYSTEM,
                   OXYGEN_SATURATION_SYSTEM_PERIPHERAL_CAPILLARY)
             .setField(
                   FIELD_OXYGEN_SATURATION_MEASUREMENT_METHOD,
                   OXYGEN_SATURATION_MEASUREMENT_METHOD_PULSE_OXIMETRY)
             .build();
 

public static final DataType TYPE_VAGINAL_SPOTTING

In com.google.vaginal_spotting, each data point represents an occurrence of vaginal spotting.

In data samples, each data point should only have the timestamp set and the number of occurrences should be set to one.

In aggregate, each interval represents one or more occurrences of vaginal spotting, with the number of occurrences given by FIELD_OCCURRENCES.

Sample code for creating a data point:

     DataSource vaginalSpottingDataSource = new DataSource.Builder()
         .setDataType(TYPE_VAGINAL_SPOTTING)
         ...
         .build();

    DataPoint vaginalSpotting =
         DataPoint.builder(vaginalSpottingDataSource)
             .setTimestamp(now.getMillis(), TimeUnit.MILLISECONDS)
             .setField(FIELD_OCCURRENCES, 1)
             .build();