public final class BloodPressureSample

  1. Object
  2. HealthSample
  3. BloodPressureSample

A blood-pressure reading: systolic and diastolic together, plus an optional pulse.

One sample, not a correlation

HealthKit models blood pressure as an HKCorrelation wrapping two separate quantity samples; Health Connect has a single BloodPressureRecord and no correlation concept at all. This API follows Health Connect, because a portable Correlation type would be a fiction that only one platform actually has – Android would have to synthesize it and every caller would have to destructure it.

Local and simulator only in this release

Neither phone carries this shape. The iOS type map has no blood_pressure entry, so the correlation assembly the port will need is not written, and Health Connect’s record is not mapped either: a read or write of HealthDataType.BLOOD_PRESSURE on a device is refused with HealthError.TYPE_NOT_SUPPORTED rather than dropped without a word. It works fully against the local and simulator stores. Until that changes, take the reading off the cuff’s SensorSession and keep it yourself.

Fields

public static final int POSITION_UNKNOWN = 0The body position was not recorded.
public static final int POSITION_STANDING = 1Measured while standing.
public static final int POSITION_SITTING = 2Measured while sitting.
public static final int POSITION_LYING_DOWN = 3Measured while lying down.
public static final int POSITION_RECLINING = 4Measured while reclining.
public static final int LOCATION_UNKNOWN = 0The measurement site was not recorded.
public static final int LOCATION_LEFT_UPPER_ARM = 1Left upper arm.
public static final int LOCATION_RIGHT_UPPER_ARM = 2Right upper arm.
public static final int LOCATION_LEFT_WRIST = 3Left wrist.
public static final int LOCATION_RIGHT_WRIST = 4Right wrist.

Methods

public static BloodPressureSample create(double systolicMmHg, double diastolicMmHg, long instantMillis)A reading in millimetres of mercury, the unit both platforms and every cuff use.
public static BloodPressureSample create(HealthQuantity systolic, HealthQuantity diastolic, long instantMillis)A reading given as explicit pressure quantities.
public HealthQuantity getSystolic()The systolic pressure.
public HealthQuantity getDiastolic()The diastolic pressure.
public HealthQuantity getPulse()The pulse recorded with this reading, or null.
public void setPulse(HealthQuantity pulse)Attaches the pulse recorded alongside the reading.
public int getBodyPosition()One of the POSITION_ constants.
public void setBodyPosition(int bodyPosition)Records the body position, using a POSITION_ constant.
public int getMeasurementLocation()One of the LOCATION_ constants.
public void setMeasurementLocation(int measurementLocation)Records the measurement site, using a LOCATION_ constant.
public String toString()Returns a string representation of the object.

Inherited methods

Field details

POSITION_UNKNOWN

public static final int POSITION_UNKNOWN = 0
The body position was not recorded.

POSITION_STANDING

public static final int POSITION_STANDING = 1
Measured while standing.

POSITION_SITTING

public static final int POSITION_SITTING = 2
Measured while sitting.

POSITION_LYING_DOWN

public static final int POSITION_LYING_DOWN = 3
Measured while lying down.

POSITION_RECLINING

public static final int POSITION_RECLINING = 4
Measured while reclining.

LOCATION_UNKNOWN

public static final int LOCATION_UNKNOWN = 0
The measurement site was not recorded.

LOCATION_LEFT_UPPER_ARM

public static final int LOCATION_LEFT_UPPER_ARM = 1
Left upper arm.

LOCATION_RIGHT_UPPER_ARM

public static final int LOCATION_RIGHT_UPPER_ARM = 2
Right upper arm.

LOCATION_LEFT_WRIST

public static final int LOCATION_LEFT_WRIST = 3
Left wrist.

LOCATION_RIGHT_WRIST

public static final int LOCATION_RIGHT_WRIST = 4
Right wrist.

Method details

create

public static BloodPressureSample create(double systolicMmHg, double diastolicMmHg, long instantMillis)
A reading in millimetres of mercury, the unit both platforms and every cuff use.

create

public static BloodPressureSample create(HealthQuantity systolic, HealthQuantity diastolic, long instantMillis)
A reading given as explicit pressure quantities.

getSystolic

public HealthQuantity getSystolic()
The systolic pressure.

getDiastolic

public HealthQuantity getDiastolic()
The diastolic pressure.

getPulse

public HealthQuantity getPulse()
The pulse recorded with this reading, or null. Most cuffs report one; neither store requires it.

setPulse

public void setPulse(HealthQuantity pulse)
Attaches the pulse recorded alongside the reading.

getBodyPosition

public int getBodyPosition()
One of the POSITION_ constants.

setBodyPosition

public void setBodyPosition(int bodyPosition)
Records the body position, using a POSITION_ constant.

getMeasurementLocation

public int getMeasurementLocation()
One of the LOCATION_ constants.

setMeasurementLocation

public void setMeasurementLocation(int measurementLocation)
Records the measurement site, using a LOCATION_ constant.

toString

public String toString()
Returns a string representation of the object. In general, the toString method returns a string that “textually represents” this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@’, and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + ‘@’ + Integer.toHexString(hashCode())