Releases: openmhealth/Granola
0.4.1
This is a recommended update for all users that:
- Fixes an issue where
Oxygen Saturation
andBody Fat Percentage
serialization used the fractional representation of values [0,1] instead of the percent representation [0%, 100%]. - Fixes an issue where generic quantity samples with percent units used the
count
property instead of theunit_value
property. - Fixes an issue where generic quantity samples with percent units used the fractional representation of values [0,1] instead of the percent representation [0%, 100%].
In these cases, we now use the percent values.
0.4.0
This release adds support for the new types added in iOS 9.0, transitions several types to serialize using Open mHealth schemas, and fixes time serialization issues. This release contains breaking changes for some types, please see the Migrating section below.
- Adds support for new types added in iOS 9.0 with generic Granola schemas:
- Reproductive and sexual health
- Dietary water
- UV exposure
- Apple stand hour
- Transitions several types from generic Granola schemas to Open mHealth schemas:
- Oxygen saturation
- Respiratory rate
- Basal energy burned
- Body fat percentage
- Body temperature
- Basal body temperature
- Adds additional tests for the serialization of new types and the serialization of timestamps.
- Uses time zone information contained in the
HKMetadataKeyTimeZone
metadata field, when it is available, to serialize timestamps. - Fixes an issue where deserializing RFC3339 timestamps would create NSDate objects with incorrect nanoseconds.
- Adds additional tests for date serialization and deserialization.
- Adds more detailed documentation for the library.
Migrating
For the six types that transitioned from generic Granola schemas to OmH schemas, the format of the JSON data returned by the serializer will have different structure than previous versions of Granola. The new structure is consistent with the OmH schemas for those types, which you can view here.
If you want to retain serialization to the generic Granola schemas instead of the OmH schemas, you can make changes to the allSupportedQuantityTypeIdentifiersToClass
method of the OMHHealthKitConstantsMapper.m
class. In that method, you can change the mappers associated with the sample types of interest to the generic version.
For example, instead of having:
HKQuantityTypeIdentifierBodyTemperature: @"OMHSerializerBodyTemperature"
You can change it to the following to preserve serialization using the generic schemas:
HKQuantityTypeIdentifierBodyTemperature: @"OMHSerializerGenericQuantitySample"
0.3.0
- Adds a method to retrieve the list of all HealthKit type identifiers that can be mapped.
- Adds a method to retrieve the list of HealthKit type identifiers that can be mapped using Open mHealth curated schemas.
- Fixes an issue where timestamps were being serialized with a fixed UTC offset of +00:00 (denoted 'Z'), even though the times were actually in local time. Timestamps are now serialized using the correct offset for the local time value.
- Fixes other minor issues.
0.2.0
- Adds generic serialization support for most HealthKit samples.
Detailed information
This release adds generic serializers that support all major HealthKit sample types - HKQuantitySample
, HKCategorySample
, HKCorrelation
, and HKWorkout
. When a measure-specific serializer is not available, these generic serializers map samples to measures based on the generic HealthKit-based JSON schemas developed by Open mHealth.
It is recommended to use the specific serializer targeted to your sample type of interest, when available. For example, there is a serializer for body mass index (BMI) that takes a HKQuantitySample
of the HKQuantityTypeIdentifierBodyMassIndex
type and serializes it to JSON that matches the Open mHealth curated schema, body-mass-index:1.x. This increases the portability and reusability of the serialized data.