Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make averageHeartRate optional #16

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

krml19
Copy link

@krml19 krml19 commented Jun 23, 2022

Status

READY

Migrations

NO

Description

There is no option to collect the voltage measurements for electrograms with inconclusive poor readings because they do not have any value for averageHeartRate. Therefore, we should allow for nil value for averageHeartRate.

@@ -62,6 +59,29 @@ extension HKElectrocardiogram.VoltageMeasurement: Harmonizable {
// MARK: - CustomStringConvertible
@available(iOS 14.0, *)
extension HKElectrocardiogram.Classification: CustomStringConvertible {
public var key: String {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather not introduce another field for the JSON payload, but change the values in description here

@@ -88,6 +108,18 @@ extension HKElectrocardiogram.Classification: CustomStringConvertible {
// MARK: - CustomStringConvertible
@available(iOS 14.0, *)
extension HKElectrocardiogram.SymptomsStatus: CustomStringConvertible {
public var key: String {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same as in the comment

)
}
let averageHeartRate = averageHeartRate?.doubleValue(for: averageHeartRateUnit)

let samplingFrequencyUnit = HKUnit.hertz()
guard
let samplingFrequency = samplingFrequency?.doubleValue(for: samplingFrequencyUnit)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it appears that the samplingFrequency can also be nullable, could please introduce the optionality here the same way you did for the averageHeartRate? For reference

Copy link
Owner

@kvs-coder kvs-coder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @krml19

many thanks for your PR. I reviewed it at left some comments. I would introduce in the frame of this PR the sampleFrequency nullability as well and remove the key properties for Classification and SymptomsStatus you added. You can use description property and change the raw strings

@kvs-coder kvs-coder force-pushed the master branch 7 times, most recently from ddb82fa to 7ee3437 Compare October 29, 2022 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants