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

Supplemental Metrics for ECG Reading #47

Merged
merged 13 commits into from
Feb 19, 2024
Prev Previous commit
Next Next commit
Update PAWSStandard for adding VO2 max samples
MatthewTurk247 committed Feb 4, 2024
commit 2e1180a5ea045aeb57f0052a6ca51eca69a38b6d
1 change: 1 addition & 0 deletions PAWS/ECGRecordings/ECGModule.swift
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@ import Spezi
@Observable
class ECGModule: Module, DefaultInitializable, EnvironmentAccessible {
var hkElectrocardiograms: [HKElectrocardiogram] = []
var vo2Samples: [HKQuantitySample] = []


/// Creates an instance of a ``MockWebService``.
1 change: 1 addition & 0 deletions PAWS/ECGRecordings/ECGRecording.swift
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ import SwiftUI

struct ECGRecording: View {
let hkElectrocardiogram: HKElectrocardiogram
// let vo2Samples: [HKQuantitySample]
@State var symptoms: HKElectrocardiogram.Symptoms = [:]


3 changes: 3 additions & 0 deletions PAWS/PAWSStandard.swift
Original file line number Diff line number Diff line change
@@ -70,6 +70,9 @@
func add(sample: HKSample) async {
if let hkElectrocardiogram = sample as? HKElectrocardiogram {
ecgStorage.hkElectrocardiograms.append(hkElectrocardiogram)
} else if let vo2Sample = sample as? HKQuantitySample,
vo2Sample.quantityType.identifier == HKQuantityTypeIdentifier.vo2Max.rawValue {
ecgStorage.vo2Samples.append(vo2Sample)

Check warning on line 75 in PAWS/PAWSStandard.swift

Codecov / codecov/patch

PAWS/PAWSStandard.swift#L73-L75

Added lines #L73 - L75 were not covered by tests
}

if let mockWebService {