HealthDataPoint
The primary model representing a single health data point.Properties
| Property | Type | Description |
|---|---|---|
uuid | String | Unique identifier (iOS) |
value | double | Numeric value (deprecated, use healthValue) |
type | HealthDataType | Type of health data |
unit | HealthDataUnit | Unit of measurement |
dateFrom | DateTime | Start time/measurement time |
dateTo | DateTime | End time |
sourcePlatform | String | Platform (iOS/Android) |
sourceId | String | Source application ID |
sourceName | String | Source application name |
recordingMethod | RecordingMethod | How data was recorded |
healthValue | HealthValue | Polymorphic value object |
Example Usage
HealthValue Types
ThehealthValue property contains type-specific data.
NumericHealthValue
For numeric measurements (steps, weight, heart rate, etc.)WorkoutHealthValue
For workout/exercise data.AudiogramHealthValue
For hearing test results.ElectrocardiogramHealthValue
For ECG/EKG data.NutritionHealthValue
For meal/nutrition data.InsulinDeliveryHealthValue
For insulin dose data.MenstruationFlowHealthValue
For menstrual cycle data.WorkoutSummary
Aggregated workout information (deprecated in favor ofWorkoutHealthValue).
Type Checking Pattern
Value Type Summary
| Value Type | Used For | Key Properties |
|---|---|---|
NumericHealthValue | Most metrics | numericValue |
WorkoutHealthValue | Workouts | workoutActivityType, totalEnergyBurned, totalDistance |
AudiogramHealthValue | Hearing tests | frequencies, leftEarSensitivities, rightEarSensitivities |
ElectrocardiogramHealthValue | ECG data | voltageValues, averageHeartRate, classification |
NutritionHealthValue | Meals | calories, protein, carbs, fat, mealType |
InsulinDeliveryHealthValue | Insulin | units |
MenstruationFlowHealthValue | Menstruation | flow, isStartOfCycle |
Data Processing Helpers
Extracting Numeric Values
Grouping by Type
Filtering by Source
Filtering by Recording Method
See Also
- Health Class API - Main API reference
- Enums - Enumeration types
- Basic Reading - Reading data points