# Class BloodPressureSample

java.lang.Object
com.codename1.health.HealthSample
com.codename1.health.BloodPressureSample

public final class BloodPressureSample extends HealthSample

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 and the iOS port assembles and disassembles the correlation, 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.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `LOCATION_LEFT_UPPER_ARM`
  Left upper arm.
  `static final int`
  `LOCATION_LEFT_WRIST`
  Left wrist.
  `static final int`
  `LOCATION_RIGHT_UPPER_ARM`
  Right upper arm.
  `static final int`
  `LOCATION_RIGHT_WRIST`
  Right wrist.
  `static final int`
  `LOCATION_UNKNOWN`
  The measurement site was not recorded.
  `static final int`
  `POSITION_LYING_DOWN`
  Measured while lying down.
  `static final int`
  `POSITION_RECLINING`
  Measured while reclining.
  `static final int`
  `POSITION_SITTING`
  Measured while sitting.
  `static final int`
  `POSITION_STANDING`
  Measured while standing.
  `static final int`
  `POSITION_UNKNOWN`
  The body position was not recorded.

- ## Method Summary

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

  ### Methods inherited from class HealthSample

  `equals, getDurationMillis, getEndMillis, getId, getMetadata, getRecordingMethod, getSource, getStartMillis, getType, hashCode, isInstantaneous, putMetadata, setId, setRecordingMethod, setSource`

  ### Methods inherited from class Object

  `clone, getClass, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### POSITION_UNKNOWN

    public static final int POSITION_UNKNOWN
    The body position was not recorded.
    See Also:
      - Constant Field Values

  - ### POSITION_STANDING

    public static final int POSITION_STANDING
    Measured while standing.
    See Also:
      - Constant Field Values

  - ### POSITION_SITTING

    public static final int POSITION_SITTING
    Measured while sitting.
    See Also:
      - Constant Field Values

  - ### POSITION_LYING_DOWN

    public static final int POSITION_LYING_DOWN
    Measured while lying down.
    See Also:
      - Constant Field Values

  - ### POSITION_RECLINING

    public static final int POSITION_RECLINING
    Measured while reclining.
    See Also:
      - Constant Field Values

  - ### LOCATION_UNKNOWN

    public static final int LOCATION_UNKNOWN
    The measurement site was not recorded.
    See Also:
      - Constant Field Values

  - ### LOCATION_LEFT_UPPER_ARM

    public static final int LOCATION_LEFT_UPPER_ARM
    Left upper arm.
    See Also:
      - Constant Field Values

  - ### LOCATION_RIGHT_UPPER_ARM

    public static final int LOCATION_RIGHT_UPPER_ARM
    Right upper arm.
    See Also:
      - Constant Field Values

  - ### LOCATION_LEFT_WRIST

    public static final int LOCATION_LEFT_WRIST
    Left wrist.
    See Also:
      - Constant Field Values

  - ### LOCATION_RIGHT_WRIST

    public static final int LOCATION_RIGHT_WRIST
    Right wrist.
    See Also:
      - Constant Field Values

- ## 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()
    Description copied from class: `Object`
    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())
    Overrides:
      `toString` in class `HealthSample`