Skip to content

Commit

Permalink
Update PAWSStandard for adding VO2 max samples
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewTurk247 committed Feb 4, 2024
1 parent f3e8f16 commit 2e1180a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions PAWS/ECGRecordings/ECGModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import Spezi
@Observable
class ECGModule: Module, DefaultInitializable, EnvironmentAccessible {
var hkElectrocardiograms: [HKElectrocardiogram] = []
var vo2Samples: [HKQuantitySample] = []


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

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


Expand Down
3 changes: 3 additions & 0 deletions PAWS/PAWSStandard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ actor PAWSStandard: Standard, EnvironmentAccessible, HealthKitConstraint, Onboar
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

View check run for this annotation

Codecov / codecov/patch

PAWS/PAWSStandard.swift#L73-L75

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

if let mockWebService {
Expand Down

0 comments on commit 2e1180a

Please sign in to comment.