Class BloodPressureSample
java.lang.Object
com.codename1.health.HealthSample
com.codename1.health.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 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
FieldsModifier and TypeFieldDescriptionstatic final intLeft upper arm.static final intLeft wrist.static final intRight upper arm.static final intRight wrist.static final intThe measurement site was not recorded.static final intMeasured while lying down.static final intMeasured while reclining.static final intMeasured while sitting.static final intMeasured while standing.static final intThe body position was not recorded. -
Method Summary
Modifier and TypeMethodDescriptionstatic BloodPressureSamplecreate(double systolicMmHg, double diastolicMmHg, long instantMillis) A reading in millimetres of mercury, the unit both platforms and every cuff use.static BloodPressureSamplecreate(HealthQuantity systolic, HealthQuantity diastolic, long instantMillis) A reading given as explicit pressure quantities.intOne of thePOSITION_constants.The diastolic pressure.intOne of theLOCATION_constants.getPulse()The pulse recorded with this reading, or null.The systolic pressure.voidsetBodyPosition(int bodyPosition) Records the body position, using aPOSITION_constant.voidsetMeasurementLocation(int measurementLocation) Records the measurement site, using aLOCATION_constant.voidsetPulse(HealthQuantity pulse) Attaches the pulse recorded alongside the reading.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
-
Field Details
-
POSITION_UNKNOWN
public static final int POSITION_UNKNOWNThe body position was not recorded.- See Also:
-
POSITION_STANDING
public static final int POSITION_STANDINGMeasured while standing.- See Also:
-
POSITION_SITTING
public static final int POSITION_SITTINGMeasured while sitting.- See Also:
-
POSITION_LYING_DOWN
public static final int POSITION_LYING_DOWNMeasured while lying down.- See Also:
-
POSITION_RECLINING
public static final int POSITION_RECLININGMeasured while reclining.- See Also:
-
LOCATION_UNKNOWN
public static final int LOCATION_UNKNOWNThe measurement site was not recorded.- See Also:
-
LOCATION_LEFT_UPPER_ARM
public static final int LOCATION_LEFT_UPPER_ARMLeft upper arm.- See Also:
-
LOCATION_RIGHT_UPPER_ARM
public static final int LOCATION_RIGHT_UPPER_ARMRight upper arm.- See Also:
-
LOCATION_LEFT_WRIST
public static final int LOCATION_LEFT_WRISTLeft wrist.- See Also:
-
LOCATION_RIGHT_WRIST
public static final int LOCATION_RIGHT_WRISTRight wrist.- See Also:
-
-
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
The systolic pressure. -
getDiastolic
The diastolic pressure. -
getPulse
The pulse recorded with this reading, or null. Most cuffs report one; neither store requires it. -
setPulse
Attaches the pulse recorded alongside the reading. -
getBodyPosition
public int getBodyPosition()One of thePOSITION_constants. -
setBodyPosition
public void setBodyPosition(int bodyPosition) Records the body position, using aPOSITION_constant. -
getMeasurementLocation
public int getMeasurementLocation()One of theLOCATION_constants. -
setMeasurementLocation
public void setMeasurementLocation(int measurementLocation) Records the measurement site, using aLOCATION_constant. -
toString
Description copied from class:ObjectReturns 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:
toStringin classHealthSample
-