Skip to content

Commit

Permalink
Small cleanup throughout the app (#40)
Browse files Browse the repository at this point in the history
# Small cleanup throughout the app

## ♻️ Current situation & Problem
Currently, the application uses unnecessary and redundant
functionalities that accumulated over time.


## ⚙️ Release Notes 
- Small cleanup of the application to ensure clean and maintainable code


## 📚 Documentation
--


## ✅ Testing
--


### Code of Conduct & Contributing Guidelines 

By submitting creating this pull request, you agree to follow our [Code
of
Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md):
- [X] I agree to follow the [Code of
Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md).
  • Loading branch information
philippzagar committed Dec 1, 2023
1 parent a24b5bc commit e74f9ef
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 58 deletions.
3 changes: 3 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ LLM on FHIR Contributors
=================================

* [Paul Schmiedmayer](https://github.com/PSchmiedmayer)
* [Vishnu Ravi](https://github.com/vishnuravi)
* [Philipp Zagar](https://github.com/philippzagar)
* [Adrit Rao](https://github.com/AdritRao)
6 changes: 2 additions & 4 deletions LLMonFHIR.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
2FE5DC3629EDD7CA004B9AB4 /* HealthKitPermissions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DC3029EDD7CA004B9AB4 /* HealthKitPermissions.swift */; };
2FE5DC3729EDD7CA004B9AB4 /* OnboardingFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DC3129EDD7CA004B9AB4 /* OnboardingFlow.swift */; };
2FE5DC3829EDD7CA004B9AB4 /* Disclaimer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DC3229EDD7CA004B9AB4 /* Disclaimer.swift */; };
2FE5DC3929EDD7CA004B9AB4 /* String+ModuleLocalized.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DC3329EDD7CA004B9AB4 /* String+ModuleLocalized.swift */; };
2FE5DC3A29EDD7CA004B9AB4 /* Welcome.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DC3429EDD7CA004B9AB4 /* Welcome.swift */; };
2FE5DC4029EDD7EE004B9AB4 /* FeatureFlags.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DC3E29EDD7ED004B9AB4 /* FeatureFlags.swift */; };
2FE5DC4129EDD7EE004B9AB4 /* StorageKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DC3F29EDD7EE004B9AB4 /* StorageKeys.swift */; };
Expand Down Expand Up @@ -124,7 +123,6 @@
2FE5DC3029EDD7CA004B9AB4 /* HealthKitPermissions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HealthKitPermissions.swift; sourceTree = "<group>"; };
2FE5DC3129EDD7CA004B9AB4 /* OnboardingFlow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OnboardingFlow.swift; sourceTree = "<group>"; };
2FE5DC3229EDD7CA004B9AB4 /* Disclaimer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Disclaimer.swift; sourceTree = "<group>"; };
2FE5DC3329EDD7CA004B9AB4 /* String+ModuleLocalized.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+ModuleLocalized.swift"; sourceTree = "<group>"; };
2FE5DC3429EDD7CA004B9AB4 /* Welcome.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Welcome.swift; sourceTree = "<group>"; };
2FE5DC3E29EDD7ED004B9AB4 /* FeatureFlags.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeatureFlags.swift; sourceTree = "<group>"; };
2FE5DC3F29EDD7EE004B9AB4 /* StorageKeys.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StorageKeys.swift; sourceTree = "<group>"; };
Expand All @@ -140,6 +138,7 @@
653A256128338800005D4D48 /* LLMonFHIRTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LLMonFHIRTests.swift; sourceTree = "<group>"; };
653A256728338800005D4D48 /* LLMonFHIRUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LLMonFHIRUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
653A258928339462005D4D48 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
97B76BCD2B195D650019D706 /* CONTRIBUTORS.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = CONTRIBUTORS.md; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -258,7 +257,6 @@
2FE5DC3229EDD7CA004B9AB4 /* Disclaimer.swift */,
2F42429A2A8B14AC006E2B01 /* OpenAIAPIKey.swift */,
2FE5DC3129EDD7CA004B9AB4 /* OnboardingFlow.swift */,
2FE5DC3329EDD7CA004B9AB4 /* String+ModuleLocalized.swift */,
2FE5DC3429EDD7CA004B9AB4 /* Welcome.swift */,
);
path = Onboarding;
Expand Down Expand Up @@ -297,6 +295,7 @@
653A2544283387FE005D4D48 = {
isa = PBXGroup;
children = (
97B76BCD2B195D650019D706 /* CONTRIBUTORS.md */,
2FC94CD4298B0A1D009C8209 /* LLMonFHIR.xctestplan */,
653A254F283387FE005D4D48 /* LLMonFHIR */,
653A256028338800005D4D48 /* LLMonFHIRTests */,
Expand Down Expand Up @@ -559,7 +558,6 @@
files = (
2FE5DC4129EDD7EE004B9AB4 /* StorageKeys.swift in Sources */,
2F42429B2A8B14AC006E2B01 /* OpenAIAPIKey.swift in Sources */,
2FE5DC3929EDD7CA004B9AB4 /* String+ModuleLocalized.swift in Sources */,
2F036EC12B0EEE07009B2745 /* ResourceSelection.swift in Sources */,
2F036EA32B0EC9BC009B2745 /* FHIRStore+Extensions.swift in Sources */,
2FE5DC3A29EDD7CA004B9AB4 /* Welcome.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
<CommandLineArgument
argument = "--disableFirebase"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "--showOnboarding"
isEnabled = "NO">
Expand All @@ -90,7 +86,7 @@
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "--useFirebaseEmulator"
argument = "--testMode"
isEnabled = "NO">
</CommandLineArgument>
</CommandLineArguments>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ extension FHIRResource {
return dateFormatter
}()


var functionCallIdentifier: String {
resourceType.filter { !$0.isWhitespace }
+ displayName.filter { !$0.isWhitespace }
Expand Down
2 changes: 1 addition & 1 deletion LLMonFHIR/FHIR Interpretation/LLMFunction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ enum LLMFunction {

static func getResources(allResourcesFunctionCallIdentifier: [String]) -> ChatFunctionDeclaration {
ChatFunctionDeclaration(
name: LLMFunction.getResourcesName,
name: Self.getResourcesName,
description: String(localized: "FUNCTION_DESCRIPTION"),
parameters: JSONSchema(
type: .object,
Expand Down
26 changes: 13 additions & 13 deletions LLMonFHIR/Onboarding/Disclaimer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,31 @@ struct Disclaimer: View {

var body: some View {
SequentialOnboardingView(
title: "DISCLAIMER_TITLE".moduleLocalized,
subtitle: "DISCLAIMER_SUBTITLE".moduleLocalized,
title: "DISCLAIMER_TITLE",
subtitle: "DISCLAIMER_SUBTITLE",
content: [
.init(
title: "DISCLAIMER_AREA1_TITLE".moduleLocalized,
description: "DISCLAIMER_AREA1_DESCRIPTION".moduleLocalized
title: "DISCLAIMER_AREA1_TITLE",
description: "DISCLAIMER_AREA1_DESCRIPTION"
),
.init(
title: "DISCLAIMER_AREA2_TITLE".moduleLocalized,
description: "DISCLAIMER_AREA2_DESCRIPTION".moduleLocalized
title: "DISCLAIMER_AREA2_TITLE",
description: "DISCLAIMER_AREA2_DESCRIPTION"
),
.init(
title: "DISCLAIMER_AREA3_TITLE".moduleLocalized,
description: "DISCLAIMER_AREA3_DESCRIPTION".moduleLocalized
title: "DISCLAIMER_AREA3_TITLE",
description: "DISCLAIMER_AREA3_DESCRIPTION"
),
.init(
title: "DISCLAIMER_AREA4_TITLE".moduleLocalized,
description: "DISCLAIMER_AREA4_DESCRIPTION".moduleLocalized
title: "DISCLAIMER_AREA4_TITLE",
description: "DISCLAIMER_AREA4_DESCRIPTION"
),
.init(
title: "DISCLAIMER_AREA5_TITLE".moduleLocalized,
description: "DISCLAIMER_AREA5_DESCRIPTION".moduleLocalized
title: "DISCLAIMER_AREA5_TITLE",
description: "DISCLAIMER_AREA5_DESCRIPTION"
)
],
actionText: "DISCLAIMER_BUTTON".moduleLocalized,
actionText: "DISCLAIMER_BUTTON",
action: {
onboardingNavigationPath.nextStep()
}
Expand Down
8 changes: 4 additions & 4 deletions LLMonFHIR/Onboarding/HealthKitPermissions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ struct HealthKitPermissions: View {
contentView: {
VStack {
OnboardingTitleView(
title: "HEALTHKIT_PERMISSIONS_TITLE".moduleLocalized,
subtitle: "HEALTHKIT_PERMISSIONS_SUBTITLE".moduleLocalized
title: "HEALTHKIT_PERMISSIONS_TITLE",
subtitle: "HEALTHKIT_PERMISSIONS_SUBTITLE"
)
Spacer()
Image(systemName: "heart.text.square.fill")
Expand All @@ -37,10 +37,10 @@ struct HealthKitPermissions: View {
}
}, actionView: {
OnboardingActionsView(
verbatim: "HEALTHKIT_PERMISSIONS_BUTTON".moduleLocalized,
"HEALTHKIT_PERMISSIONS_BUTTON",
action: {
healthKitProcessing = true
do {
healthKitProcessing = true
// HealthKit is not available in the preview simulator.
if ProcessInfo.processInfo.environment["XCODE_RUNNING_FOR_PREVIEWS"] == "1" {
try await _Concurrency.Task.sleep(for: .seconds(5))
Expand Down
13 changes: 0 additions & 13 deletions LLMonFHIR/Onboarding/String+ModuleLocalized.swift

This file was deleted.

39 changes: 24 additions & 15 deletions LLMonFHIR/Onboarding/Welcome.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,35 @@ struct Welcome: View {

var body: some View {
OnboardingView(
title: "WELCOME_TITLE".moduleLocalized,
subtitle: "WELCOME_SUBTITLE".moduleLocalized,
title: "WELCOME_TITLE",
subtitle: "WELCOME_SUBTITLE",
areas: [
.init(
icon: Image(systemName: "apps.iphone"), // swiftlint:disable:this accessibility_label_for_image
title: "WELCOME_AREA1_TITLE".moduleLocalized,
description: "WELCOME_AREA1_DESCRIPTION".moduleLocalized
OnboardingInformationView.Content(
icon: {
Image(systemName: "apps.iphone")
.accessibilityHidden(true)
},
title: "WELCOME_AREA1_TITLE",
description: "WELCOME_AREA1_DESCRIPTION"
),
.init(
icon: Image(systemName: "shippingbox.fill"), // swiftlint:disable:this accessibility_label_for_image
title: "WELCOME_AREA2_TITLE".moduleLocalized,
description: "WELCOME_AREA2_DESCRIPTION".moduleLocalized
OnboardingInformationView.Content(
icon: {
Image(systemName: "shippingbox.fill")
.accessibilityHidden(true)
},
title: "WELCOME_AREA2_TITLE",
description: "WELCOME_AREA2_DESCRIPTION"
),
.init(
icon: Image(systemName: "list.bullet.clipboard.fill"), // swiftlint:disable:this accessibility_label_for_image
title: "WELCOME_AREA3_TITLE".moduleLocalized,
description: "WELCOME_AREA3_DESCRIPTION".moduleLocalized
OnboardingInformationView.Content(
icon: {
Image(systemName: "list.bullet.clipboard.fill")
.accessibilityHidden(true)
},
title: "WELCOME_AREA3_TITLE",
description: "WELCOME_AREA3_DESCRIPTION"
)
],
actionText: "WELCOME_BUTTON".moduleLocalized,
actionText: "WELCOME_BUTTON",
action: {
onboardingNavigationPath.nextStep()
}
Expand Down
4 changes: 1 addition & 3 deletions LLMonFHIR/SharedContext/StorageKeys.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// SPDX-License-Identifier: MIT
//

/// Constants shared across the Spezi Teamplate Application to access storage information including the `AppStorage` and `SceneStorage`
/// Constants shared across the Spezi Template Application to access storage information including the `AppStorage` and `SceneStorage`
enum StorageKeys {
enum Defaults {
static let enableTextToSpeech = false
Expand All @@ -17,8 +17,6 @@ enum StorageKeys {
// MARK: - Onboarding
/// A `Bool` flag indicating of the onboarding was completed.
static let onboardingFlowComplete = "onboardingFlow.complete"
/// A `Step` flag indicating the current step in the onboarding process.
static let onboardingFlowStep = "onboardingFlow.step"


// MARK: - Home
Expand Down

0 comments on commit e74f9ef

Please sign in to comment.