-
-
Notifications
You must be signed in to change notification settings - Fork 1
"Update Health Conditions" button; Vo2Max; LDL tile fixes #179
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
6b100bc
update health conditions button
lukaskollmer 7979461
vo2 max
lukaskollmer d6a366c
fix dependencies
lukaskollmer 10e6298
add comorbidities updating test
lukaskollmer 81bd29b
VO2Max tests
lukaskollmer 8a0c188
hmmm
lukaskollmer ce240ff
x
lukaskollmer b670f73
fix button
lukaskollmer 851473e
OPTIMIZE
lukaskollmer d39faf9
fix LDL cholesterol scoring bands
lukaskollmer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| // | ||
| // This source file is part of the My Heart Counts iOS application based on the Stanford Spezi Template Application project | ||
| // | ||
| // SPDX-FileCopyrightText: 2026 Stanford University | ||
| // | ||
| // SPDX-License-Identifier: MIT | ||
| // | ||
|
|
||
| import SFSafeSymbols | ||
| import SpeziAccount | ||
| import SpeziViews | ||
| import SwiftUI | ||
|
|
||
|
|
||
| struct UpdateComorbiditiesButton: View { | ||
| @Environment(Account.self) | ||
| private var account | ||
|
|
||
| @State private var showSheet = false | ||
| @State private var demographicsData = DemographicsData() | ||
| @State private var viewState: ViewState = .idle | ||
|
|
||
| var body: some View { | ||
| Button { | ||
| showSheet = true | ||
| } label: { | ||
| HStack { | ||
| Text("UPDATE_COMORBIDITIES_BUTTON_TITLE") | ||
| .foregroundStyle(.textLabel) | ||
| Spacer() | ||
| DisclosureIndicator() | ||
| } | ||
| } | ||
| .disabled(account.details == nil) | ||
| .sheet(isPresented: $showSheet) { | ||
| @Bindable var data = demographicsData | ||
| NavigationStack { | ||
| ComorbiditiesPicker(selection: $data[\.comorbidities].withDefault(Comorbidities())) | ||
| .navigationBarTitleDisplayMode(.inline) | ||
| .interactiveDismissDisabled() | ||
| .toolbar { | ||
| ToolbarItem(placement: .confirmationAction) { | ||
| closeSheetButton | ||
| } | ||
| } | ||
| } | ||
| .onAppear { | ||
| demographicsData.populateIfEmpty(from: account) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @ViewBuilder private var closeSheetButton: some View { | ||
| if #available(iOS 26, *) { | ||
| AsyncButton(role: .confirm, state: $viewState) { | ||
| try await closeSheet() | ||
| } label: { | ||
| Label("Done", systemSymbol: .checkmark) | ||
| } | ||
| } else { | ||
| AsyncButton("Done", state: $viewState) { | ||
| try await closeSheet() | ||
| } | ||
| } | ||
| } | ||
|
|
||
| private func closeSheet() async throws { | ||
| showSheet = false | ||
| try await demographicsData.flush() | ||
| } | ||
| } | ||
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
39 changes: 39 additions & 0 deletions
39
MyHeartCounts/Heart Health Dashboard/PastTimedWalkTestResultInfo.swift
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| // | ||
| // This source file is part of the My Heart Counts iOS application based on the Stanford Spezi Template Application project | ||
| // | ||
| // SPDX-FileCopyrightText: 2026 Stanford University | ||
| // | ||
| // SPDX-License-Identifier: MIT | ||
| // | ||
|
|
||
| import Foundation | ||
| import SpeziStudyDefinition | ||
| import SwiftUI | ||
|
|
||
|
|
||
| struct TimedWalkRunTestResultInfo: View { | ||
| let result: TimedWalkingTestResult | ||
|
|
||
| var body: some View { | ||
| LabeledContent("Date", value: result.startDate, format: .dateTime) | ||
| LabeledContent("Steps", value: result.numberOfSteps, format: .number) | ||
| LabeledContent( | ||
| "Distance", | ||
| value: Measurement<UnitLength>(value: result.distanceCovered, unit: .meters), | ||
| format: .measurement(width: .abbreviated) | ||
| ) | ||
| switch result.test.kind { | ||
| case .walking: | ||
| let _ = () // swiftlint:disable:this redundant_discardable_let | ||
| case .running: | ||
| LabeledContent( | ||
| "VO2MAX_ESTIMATE_LABEL", | ||
| value: Measurement<UnitOxygenConsumption>( | ||
| value: (result.distanceCovered - 504.9) / 44.73, | ||
| unit: .mlPerKgPerMin | ||
| ), | ||
| format: .measurement(width: .abbreviated, usage: .asProvided, numberFormatStyle: .number.precision(.fractionLength(...1))) | ||
| ) | ||
| } | ||
| } | ||
| } |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.