carekit-apple / CareKit

CareKit is an open source software framework for creating apps that help people better understand and manage their health.
https://www.researchandcare.org
Other
2.41k stars 444 forks source link

Is there a way to display and collect Blood Pressure Values in a single Screen rather than having 2 different screens one for Systolic & one for Diastolic? #486

Open amrutha786 opened 4 years ago

amrutha786 commented 4 years ago

Is there a way to display and collect Blood Pressure Values in a single Screen rather than having 2 different screens one for Systolic & one for Diastolic?

I have successfully implemented collecting and transferring Systolic & Diastolic Values from our App to Apple Health and also those values are read by a 3rd party App successfully.

I am facing the following issue:

At 11:00am in MyApp I enter Systolic : 66 & Diastolic : 100 ; That data is right away passed to Apple Health App and from the Apple Health its read by the ThirdPartyApp (as 66/100) with out any issue.

At 11:05am in MyApp I reenter Systolic : 77 & Click on Done; Even with out entering Diastolic value, the data is passed to AppleHealth App and is displayed in AppleHealth range as 66-77/100 ; and to the third party app a new value is passes as 77/100 (where as the data should not be passed as I haven’t entered diastolic yet).

Is there any possibility that we can nullify the value or have a delay with the data that is passing from MyApp to AppleHealth until Diastolic value is also added?

erik-apple commented 4 years ago

Can you tell us which version of CareKit you are using? Is this a CareKit 1.2 or 2.0 app?

Atamanam commented 4 years ago

We are still on Carekit 1.2 Xcode 11.1 Swift 5.0

erik-apple commented 4 years ago

We aren't actively support CareKit 1.2 any longer.

You'll probably need to unify your 2 screens into 1 so that you can collect both samples at the same time, and then use them to create an OCKCarePlanEventResult from an HKCorrelation.

There are some examples in the unit tests of how to create care plan event results for blood pressure.

https://github.com/carekit-apple/CareKit/blob/20bd47bda72155ffd45ada291edc668682a17652/CareKitTests/CareKitCarePlanTests.m#L1241-L1257

amrutha786 commented 3 years ago

We are currently upgrading the App with Carekit 2.1

How do i achive the same behaviour of unifying 2 values (Systolic & Diastolic Blood Pressure Values)?