Skip to content

Commit

Permalink
Fix Swiftlint
Browse files Browse the repository at this point in the history
  • Loading branch information
PSchmiedmayer committed May 15, 2024
1 parent 91c503a commit 28a2299
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
4 changes: 2 additions & 2 deletions OwnYourData/ClinicalTrials/NCITrialsModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import SpeziLocation
@Observable
class NCITrialsModel {
#warning("Insert NIC Token here to test the app.")
private static let apiKey: String = "tkMGxBkgOC4TDCUfjcPdw7eeZsuuZual632WpUnH"
private static let apiKey: String = ""


private let locationModule: SpeziLocation
Expand Down Expand Up @@ -72,7 +72,7 @@ class NCITrialsModel {
OpenAPIClientAPI.customHeaders = ["X-API-KEY": Self.apiKey]
CodableHelper.dateFormatter = NICTrialsAPIDateFormatter()

let keywords = keywords.filter({ !$0.isEmpty })
let keywords = keywords.filter { !$0.isEmpty }

return try await withCheckedThrowingContinuation { continuation in
TrialsAPI.searchTrialsByGet(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@ struct GetTrialsLLMFunction: LLMFunction {
nciTrialsModel: NCITrialsModel
) {
self.nciTrialsModel = nciTrialsModel

print(nciTrialsModel.trials.compactMap({ $0.llmIdentifier }))


_trailIdentifiers = Parameter(
description: String(localized: "LLM_GET_TRIALS_PARAMETER_DESCRIPTION"),
enum: nciTrialsModel.trials.compactMap({ $0.llmIdentifier })
enum: nciTrialsModel.trials.compactMap { $0.llmIdentifier }
)
}

Expand All @@ -48,7 +46,7 @@ struct GetTrialsLLMFunction: LLMFunction {
Title: \(trial.briefTitle ?? "") (\(trial.officialTitle ?? ""))
Description: \(trial.detailDescription ?? "")
Incluision Criteria: \(trial.eligibility?.unstructured?.compactMap({ $0.description }).joined() ?? "")
Incluision Criteria: \(trial.eligibility?.unstructured?.compactMap { $0.description }.joined() ?? "")
"""
}
}
Expand Down
9 changes: 2 additions & 7 deletions OwnYourData/TrialsMatching/MatchingModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,7 @@ class MatchingModule: Module, EnvironmentAccessible, DefaultInitializable {
}
let matchingTrialIds = try await trialsIdentificaiton()

print(matchingTrialIds)
print(nciTrialsModel.trials.map({ $0.llmIdentifier }))

matchingTrials = nciTrialsModel.trials.filter({ trial in matchingTrialIds.contains(where: { $0 == trial.llmIdentifier }) })

print(matchingTrials)
matchingTrials = nciTrialsModel.trials.filter { trial in matchingTrialIds.contains(where: { $0 == trial.llmIdentifier }) }

withAnimation {
self.state = .idle
Expand Down Expand Up @@ -118,7 +113,7 @@ class MatchingModule: Module, EnvironmentAccessible, DefaultInitializable {
output.append(token)
}

keywords = output.components(separatedBy: ",").flatMap({ $0.components(separatedBy: " ") }).filter({ !$0.isEmpty })
keywords = output.components(separatedBy: ",").flatMap { $0.components(separatedBy: " ") }.filter { !$0.isEmpty }
return keywords
}

Expand Down

0 comments on commit 28a2299

Please sign in to comment.