public final class BloodPressureSample
- Object
- HealthSample
- 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 = 0 | The body position was not recorded. |
public static final int POSITION_STANDING = 1 | Measured while standing. |
public static final int POSITION_SITTING = 2 | Measured while sitting. |
public static final int POSITION_LYING_DOWN = 3 | Measured while lying down. |
public static final int POSITION_RECLINING = 4 | Measured while reclining. |
public static final int LOCATION_UNKNOWN = 0 | The measurement site was not recorded. |
public static final int LOCATION_LEFT_UPPER_ARM = 1 | Left upper arm. |
public static final int LOCATION_RIGHT_UPPER_ARM = 2 | Right upper arm. |
public static final int LOCATION_LEFT_WRIST = 3 | Left wrist. |
public static final int LOCATION_RIGHT_WRIST = 4 | Right wrist. |
Methods
Inherited methods
Field details
POSITION_UNKNOWN
public static final int POSITION_UNKNOWN = 0POSITION_STANDING
public static final int POSITION_STANDING = 1POSITION_SITTING
public static final int POSITION_SITTING = 2POSITION_LYING_DOWN
public static final int POSITION_LYING_DOWN = 3POSITION_RECLINING
public static final int POSITION_RECLINING = 4LOCATION_UNKNOWN
public static final int LOCATION_UNKNOWN = 0LOCATION_LEFT_UPPER_ARM
public static final int LOCATION_LEFT_UPPER_ARM = 1LOCATION_RIGHT_UPPER_ARM
public static final int LOCATION_RIGHT_UPPER_ARM = 2LOCATION_LEFT_WRIST
public static final int LOCATION_LEFT_WRIST = 3LOCATION_RIGHT_WRIST
public static final int LOCATION_RIGHT_WRIST = 4Method details
create
public static BloodPressureSample create(double systolicMmHg, double diastolicMmHg, long instantMillis)create
public static BloodPressureSample create(HealthQuantity systolic, HealthQuantity diastolic, long instantMillis)getSystolic
public HealthQuantity getSystolic()getDiastolic
public HealthQuantity getDiastolic()getPulse
public HealthQuantity getPulse()setPulse
public void setPulse(HealthQuantity pulse)getBodyPosition
public int getBodyPosition()POSITION_ constants.setBodyPosition
public void setBodyPosition(int bodyPosition)POSITION_ constant.getMeasurementLocation
public int getMeasurementLocation()LOCATION_ constants.setMeasurementLocation
public void setMeasurementLocation(int measurementLocation)LOCATION_ constant.toString
public String toString()