Repository navigation
Export electrocardiograms whose symptoms cannot be read - #207
Draft
PSchmiedmayer wants to merge 10 commits into
Draft
PSchmiedmayer wants to merge 10 commits into
PSchmiedmayer wants to merge 10 commits into
Conversation
HealthKit returns no symptom samples for a type the app may not read, without saying so. An ECG whose symptoms status is present but whose symptoms could not be read now states one data-absent member with the reason unknown, and the contract admits such a Reference only at the governed path the guide names. The generator emits these data-absent reference policies.
HealthKit hides denied read access, so a present symptoms status with no readable sample is the only sign that the symptoms are unreadable. HKElectrocardiogram.correlatedSymptomSamples(from:) now returns that state as CorrelatedSymptoms.unreadable, and the exporter's electrocardiogram record takes ElectrocardiogramSymptoms, either the samples or unreadable. A present status passed without samples, as by a caller that skipped the fetch, is refused as symptomsRequired.
Pins grove-fhir to the ECG symptoms guide branch at aa185b7, which contains grove-fhir 0.9.0, and regenerates the contracts from it. The generator test's exchange protocol fixture keeps both the reference policy and the governed source identifier, and the documentation keeps the unreadable symptoms paragraph beside the clinical record text.
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 #197, which closed when its branch was merged into the integration branch; the branch and commits are unchanged.
An
HKElectrocardiogramcan report its symptoms status as present while its symptom samples need their own read authorization.HealthKit does not reveal a denied read: the symptom query returns no samples.
HKElectrocardiogram.correlatedSymptomSamples(from:)then returned an empty array, and the exporter refused the ECG assymptomsRequired, so the waveform and its average heart rate were lost.The exporter also could not tell that case apart from a caller that never fetched the symptoms.
SchmiedmayerLab/grove-fhir#89 lets such an ECG keep its present status and carry one member with only the data-absent reason
unknown.⚙️ Release Notes
HKElectrocardiogram.correlatedSymptomSamples(from:)returns the newHKElectrocardiogram.CorrelatedSymptomsinstead of an array:.samples(_:), or.unreadablewhen the status is present and HealthKit returns no sample.CorrelatedSymptoms.samplesgives the array, empty when the symptoms are unreadable..samples(_:)holds the samples of those types.HealthKitFHIRExporter.Record.electrocardiogram(_:voltages:symptoms:)takes the newHealthKitFHIRExporter.Record.ElectrocardiogramSymptomswith the same two cases.ElectrocardiogramSymptomsis expressible by an array literal, so existing call sites with a literal list of samples keep compiling.hasMemberentry with only thedata-absent-reasonextension and codeunknown.symptomsRequired, and.unreadablewith any other status is refused asunexpectedSymptoms.HKElectrocardiogram.symptoms(from:)returns no symptoms when they are unreadable.hasMemberentry of an Observation claiming the HealthKit ECG profile.88ba968c3f1f0a4c4ab65daaad297d686c3fc3ac, the head of State unreadable HealthKit ECG symptoms as unknown grove-fhir#89, whichScripts/validate-fhir-conformance.shand the test workflow pin by commit.Code that passed a variable of
[HKCategorySample]maps the fetched state:📚 Documentation
HKElectrocardiogram.CorrelatedSymptoms.unknownmember and thesymptomsRequiredrefusal.✅ Testing
HealthKitECGContentTestsadds cases for a present ECG with unreadable symptoms, for refusing a data-absent member on another Observation, with another reason or beside other members, and for the exchange graph admitting it only at the policy's path and profile.electrocardiogram-unreadable-symptomsjoins the validated conformance fixtures and contains one member with the reasonunknown.symptoms/unreadableandsymptoms/unreadable-without-present-status.ElectrocardiogramSymptoms.test_generate_grove_fhir_swift_contract.pycovers the generated data-absent references and unreadable symptoms reason, and refuses policies the validator does not check and unreadable symptoms the generator does not emit.Code of Conduct & Contributing Guidelines
By creating and submitting this pull request, you agree to follow our Code of Conduct and Contributing Guidelines: