Repository navigation
Collect the SDK 27.2 HealthKit types, headphone sensors and sleep sessions - #204
Draft
PSchmiedmayer wants to merge 17 commits into
Draft
PSchmiedmayer wants to merge 17 commits into
PSchmiedmayer wants to merge 17 commits into
Conversation
Adds heart rate variability RMSSD, bleeding after menopause, menopausal state and hypertension notifications to GroveHealthKit, with their Linux identifiers and localizations. Symbols of the platform 27 SDK compile only with Swift 6.4. GroveHealthKitFHIR converts the three platform 27 types; the menopausal state rule names a platform 27 symbol, so the type is not yet convertible on earlier systems and in builds with an earlier SDK. GroveSensorKit adds the headphone motion, headphone settings and sleep session sensors. The headphone samples write the device motion and headphone settings recording formats; a motion sample states its start date apart from the time SensorKit stored it, and batch identifiers are written as unsigned integers. CSV columns of one nullable group are absent or present together, and a row that breaks that rule is refused as an incomplete nullable group when written and when read. The generated contracts follow grove-fhir 6ea4528, which the conformance check pins by commit until a release contains it.
SensorKitSleepSessionRecord carries the exact SRSleepSession identifier, and SensorKitPreparedStructuredRecord(sleepSession:) prepares a session with it in its retry evidence. Under the new sleepSessionIdentifier option the sleep-session Observation states it as one more governed source identifier, under a system of its own; it never enters a Grove identity. A reserved system, or the system of the disclosed native identifier, is refused when the exporter is created.
A sleep session's Observation carries one governed source identifier: the session's own identifier, where the session states one and the sleepSessionIdentifier option discloses it, else the record id. An empty session identifier is a session without one, and the option's system must differ from the visit-location system too. The Codegen identifier definitions of the platform 27 types compile only with Swift 6.4, and the headphone motion sensor imports SensorKit publicly for its inlinable definition. The SensorKit catalog tests follow the 0.8.3 catalog, and conformance fixtures cover the headphone recordings and a disclosed sleep-session identifier. HealthKit tests skip the platform 27 types on earlier systems and in builds with an earlier SDK, where menopausal state is not yet convertible.
The reverse projection looks up its quantity or category type and refuses an Observation whose type this system's HealthKit does not have, such as RMSSD before platform 27, as not mappable. The corpus grid comparison, the category round trip and the catalog matrix skip the platform 27 types where the system lacks them.
The corpus reproduction and the per-row coverage check skip the vectors of a platform 27 type, including its reverse projection, on a system or build that lacks the type.
Headphone motion is now a catalog sensor, so the test uses a token that no catalog entry names.
The values are the public entitlement values of SensorKit's sensor descriptions in iOS 27.2.
The healthkit guide at 6ea4528 adds the bleeding after menopause and menopausal state examples, which the content corpus now converts.
The FHIR validator refuses an example.org system in the conformance fixtures.
The corpus reproduction skips a guide example whose HealthKit source type is a platform 27 type this system or build lacks, as it does for the other vectors of such a type. The guide examples of bleeding after menopause and menopausal state otherwise drift on iOS and watchOS 26 and on macOS 26.
Pins grove-fhir to the SDK 27.2 guide branch at 9740cbb, which contains grove-fhir 0.9.0, and regenerates the format registry and SensorKit contracts from it.
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
♻️ Current situation & Problem
This replaces #194, which closed when its branch was merged into the integration branch; the branch and commits are unchanged.
Compared with the 26.5 baseline, the iPhoneOS 27.2 SDK has three more HealthKit types, heart rate variability RMSSD, bleeding after menopause and menopausal state, and two SensorKit sensors, headphone motion and headphone settings.
SchmiedmayerLab/grove-fhir#86 moves the HealthKit and SensorKit catalogs to that SDK and registers the
device-motion-samplesandheadphone-settings-samplesrecording formats.Grove had no sample types or sensors for these sources, so an app could neither collect nor export them.
The headphone settings format marks its optional hearing-assistance columns as one nullable group: in each row they are all present or all absent.
Grove's CSV writer and reader had no notion of such a group.
SensorKit states an identifier for each sleep session, and Grove's sleep-session record kept only the session bounds.
GroveHealthKit also had no typed sample type for hypertension notifications, which HealthKit added in platform 26.2 and the HealthKit guide already covers.
⚙️ Release Notes
SampleType.heartRateVariabilityRMSSD,.bleedingAfterMenopause,.menopausalStateand.hypertensionEvent, with their Linux identifiers and localized titles.#if compiler(>=6.4)and the package still builds with Xcode 26.measurementNotMappable.Sensor.headphoneMotionandSensor.headphoneSettingson iOS 27 andSensor.sleepSessionson iOS 26.startDateand thetimestampat which SensorKit stored it, and headphone settings keephearingAssistanceas an optional group.device-motion-samplesand headphone settings batches asheadphone-settings-samplestabular recordings.RecordingCSVWriter.Field.unsignedInteger(UInt64)writes batch identifiers that can exceedInt.max, and the accelerometer and pressure recordings use it for their identifiers too.incompleteNullableGroup(_:)and by the reader asincompleteNullableGroup(row:group:).SensorKitSleepSessionRecordcarriesnativeSessionIdentifier, andSensorKitPreparedStructuredRecord(sleepSession:)prepares a session with that identifier in its retry evidence.SensorKitFHIRExporter.Options.sleepSessionIdentifierdiscloses the identifier on the sleep-session Observation under a system the deployment owns.nativeIdentifierdiscloses.reservedIdentifierSystem(_:), and one shared with the visit-location or native-identifier system as the newsharedIdentifierSystem(_:).6ea4528076c2e2457ba0d07376f1ee030bea0d78, the head of Move the HealthKit and SensorKit baselines to SDK 27.2 grove-fhir#86.Scripts/validate-fhir-conformance.shand the test workflow pin that commit with an empty version until a grove-fhir release contains it.📚 Documentation
motion-headphone,headphone-settingsandsleep-sessions.sleepSessionIdentifierdisclosure.✅ Testing
HealthKitPlatform27Testsis new and covers the RMSSD statistic, unit and interval, the intensity of bleeding after menopause, and each menopausal state as a point in time.Platform27HealthKitTypeTestsis new and checks the typed lookups, the canonical RMSSD unit and the localized titles of the new sample types.GroveHealthKitTestscounts the known object types per platform.RecordingCSVWriterTestsadds cases for nullable groups on write and read, for a column violation reported before its incomplete group, and for an identifier aboveInt.max.SensorKitSleepIdentityTestsis new and covers the exact disclosed identifier, its precedence over a disclosed record id, sessions without an identifier, and the refused identifier systems.SensorKitSleepPreparationTestsis new and covers the prepared bounds, the identifier in the retry evidence, an empty identifier and a negative duration.SensorConformanceFixtureTestsadds fixtures for a headphone motion recording with a batch identifier aboveInt64.max, headphone settings rows with and without hearing assistance, and a sleep session with a disclosed identifier.SensorKitFHIRCatalogTests,SensorKitOutputDefinitionTestsandGroveSensorKitBridgeTestsfollow the catalog's 24 sensors.test_generate_grove_sensor_swift_contract.pycovers the generated nullable groups, andtest_grove_fhir_pin.pyadmits a pin by commit alone.Code of Conduct & Contributing Guidelines
By creating and submitting this pull request, you agree to follow our Code of Conduct and Contributing Guidelines: