HealthKit

Apple HealthKit is a powerful framework that allows researchers to access a comprehensive range of health and fitness data collected by participants’ iPhones and paired Apple Watch devices. It acts as a central repository for metrics on physical activity, vital signs, sleep, nutrition, mobility, and more, offering researchers valuable insights into participants’ health behaviors and outcomes.

Supported HealthKit Metrics in Avicenna

Below is a comprehensive list of HealthKit metrics that Avicenna supports. We’ll first cover the common fields that appear across all HealthKit data types, followed by the specific fields for each individual metric.

Common Fields Across All HealthKit Data Sources

All metrics include the common data fields and the following additional fields:

Source & Device

Basic information about the device providing health data. Internally stored as part of each HealthKit record and includes:

  • Source Name: Name of the app or device that recorded the data (e.g., “Apple Watch”). Internally stored as source_name.
  • Source Bundle ID: Bundle identifier of the source app. Internally stored as source_bundle_id.
  • Source Version: Version of the source app or device. Internally stored as source_version.
  • Device Model: Device model that recorded the data (e.g., “iPhone13,4”, “Watch6,2”). Internally stored as device_model.
  • Device Hardware Version: Hardware version of the device. Internally stored as device_hardware_version.
  • Device Software Version: Software version of the device. Internally stored as device_software_version.

Data Quality & Context

Information about the reliability and context of the health data:

  • Was User Entered: Boolean indicating if the data was manually entered by the user. Internally stored as was_user_entered.
  • Creation Date: When the data point was originally created. Internally stored as creation_date.
  • Start Date: Start time of the measurement period. Internally stored as start_date.
  • End Date: End time of the measurement period. Internally stored as end_date.

HealthKit Activity

Captures participant activity, including movement, energy expenditure, and workout data. Internally stored as healthkit_activity and includes:

  • Identifier: Unique measurement identifier. Internally stored as identifier.
  • Step Count: Number of steps taken. Internally stored as step_count.
  • Distance: Distance walked or run in meters. Internally stored as distance_meters.
  • Flights Climbed: Flights of stairs climbed. Internally stored as flights_count.
  • Energy: Active or basal energy burned, measured in kilocalories. Internally stored as energy_kcal.
  • Duration: Exercise time or workout length, measured in minutes. Internally stored as duration_minutes.
  • Workout Activity Type: Type of workout performed (e.g., running, cycling, yoga). Internally stored as workout_activity_type.

HealthKit Vital Signs

Provides insight into cardiovascular and respiratory health. Internally stored as healthkit_vital_signs and includes:

  • Identifier: Unique measurement identifier. Internally stored as identifier.
  • Heart Rate: Heart rate in beats per minute (BPM). Internally stored as heart_rate_bpm.
  • Resting Heart Rate: Baseline resting heart rate in beats per minute (BPM). Internally stored as resting_heart_rate_bpm.
  • Heart Rate Variability (HRV): Root mean square of successive differences (RMSSD), measured in milliseconds. Internally stored as hrv_rmssd_ms.
  • Systolic Pressure: Systolic blood pressure value in millimeters of mercury (mmHg). Internally stored as systolic_pressure_mmhg.
  • Diastolic Pressure: Diastolic blood pressure value in millimeters of mercury (mmHg). Internally stored as diastolic_pressure_mmhg.
  • Respiratory Rate: Breathing rate in breaths per minute. Internally stored as respiratory_rate_bpm.
  • Oxygen Saturation: Blood oxygen level as a percentage. Internally stored as oxygen_saturation_percent.
  • Body Temperature: Body temperature measurement with decimal precision. Internally stored as body_temperature.
  • Heart Rate Recovery (1 Minute): Heart rate recovery after one minute of rest. Internally stored as heart_rate_recovery_one_minute.

HealthKit Sleep

Allows researchers to assess sleep quality, duration, and circadian patterns. Internally stored as healthkit_sleep and includes:

  • Identifier: Unique measurement identifier. Internally stored as identifier.
  • Sleep State: Type of sleep recorded. Internally stored as sleep_state. It can be one of the following:
    • IN_BED
    • ASLEEP_UNSPECIFIED
    • AWAKE
    • ASLEEP_CORE
    • ASLEEP_DEEP
    • ASLEEP_REM
  • Duration: Duration of the sleep state in minutes. Internally stored as duration_minutes.

HealthKit State of Mind

iOS 17+

Allows researchers to study emotional well-being and its relationship with physiological or behavioral factors. Internally stored as healthkit_state_of_mind and includes:

  • Identifier: Unique measurement identifier. Internally stored as identifier.
  • Kind: Type of mood captured. Internally stored as kind. Possible values include:
    • MOMENTARY: Momentary emotion
    • DAILY: Daily mood summary
  • Valence: Emotional valence ranging from negative to positive. Internally stored as valence. It can be one of the following:
    • VERY_UNPLEASANT
    • UNPLEASANT
    • SLIGHTLY_UNPLEASANT
    • NEUTRAL
    • SLIGHTLY_PLEASANT
    • PLEASANT
    • VERY_PLEASANT
  • Labels: Participant-selected descriptors of mood. Internally stored as labels. It can be one of the following:
    • AMAZED
    • AMUSED
    • ANGRY
    • ANXIOUS
    • ASHAMED
    • BRAVE
    • CALM
    • CONTENT
    • DISAPPOINTED
    • DISCOURAGED
    • DISGUSTED
    • EMBARRASSED
    • EXCITED
    • FRUSTRATED
    • GRATEFUL
    • GUILTY
    • HAPPY
    • HOPELESS
    • IRRITATED
    • JEALOUS
    • JOYFUL
    • LONELY
    • PASSIONATE
    • PEACEFUL
    • PROUD
    • RELIEVED
    • SAD
    • SCARED
    • STRESSED
    • SURPRISED
    • WORRIED
    • ANNOYED
    • CONFIDENT
    • DRAINED
    • HOPEFUL
    • INDIFFERENT
    • OVERWHELMED
    • SATISFIED
  • Associations: Context associated with the mood. Internally stored as associations. It can be one of the following:
    • COMMUNITY
    • CURRENT_EVENTS
    • DATING
    • EDUCATION
    • FAMILY
    • FITNESS
    • FRIENDS
    • HEALTH
    • HOBBIES
    • IDENTITY
    • MONEY
    • PARTNER
    • SELF_CARE
    • SPIRITUALITY
    • TASKS
    • TRAVEL
    • WORK
    • WEATHER

HealthKit Body Measurements

Tracks participant body metrics. Internally stored as healthkit_body_measurements and includes:

  • Identifier: Unique measurement identifier. Internally stored as identifier.
  • Height: Body height in meters. Internally stored as height_meters.
  • Mass: Body weight in kilograms. Internally stored as mass_kg.
  • BMI: Body Mass Index calculated from height and weight. Internally stored as bmi_value.
  • Body Fat Percentage: Body fat composition as a percentage. Internally stored as body_fat_percent.

Adding HealthKit As a Data Source

See Adding Data Sources.

Data Collection Behavior

HealthKit data is collected within Avicenna’s standard 5-minute collection cycle. The app queries the HealthKit store for new data since the last fetch. This process avoids duplicates and prioritizes the most accurate source, such as an Apple Watch over an iPhone. New data is available for collection almost immediately after a device syncs with Apple Watch.

Monitoring and Exporting HealthKit Data

You can export and download the collected HealthKit data using the Data Export page.