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

Improved home screen, changed onboarding text, NCI Trial API recursion #24

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@
"repositoryURL": "https://github.com/firebase/firebase-ios-sdk.git",
"state": {
"branch": null,
"revision": "9d17b500cd98d9a7009751ad62f802e152e97021",
"version": "10.26.0"
"revision": "8bcaf973b1d84e119b7c7c119abad72ed460979f",
"version": "10.27.0"
}
},
{
"package": "GoogleAppMeasurement",
"repositoryURL": "https://github.com/google/GoogleAppMeasurement.git",
"state": {
"branch": null,
"revision": "16244d177c4e989f87b25e9db1012b382cfedc55",
"version": "10.25.0"
"revision": "70df02431e216bed98dd461e0c4665889245ba70",
"version": "10.27.0"
}
},
{
Expand Down Expand Up @@ -150,8 +150,8 @@
"repositoryURL": "https://github.com/StanfordBDHG/OpenAI",
"state": {
"branch": null,
"revision": "29316babb446c34bb07bf528d96de7eb41e7b03c",
"version": "0.2.8"
"revision": "1ad95dd531d7c854a3f98f588b0eb68fa83e8a8c",
"version": "0.2.9"
}
},
{
Expand All @@ -168,26 +168,26 @@
"repositoryURL": "https://github.com/StanfordBDHG/ResearchKit",
"state": {
"branch": null,
"revision": "3f70adf898b5985ba15e25d5074d86a9c657d305",
"version": "2.2.30"
"revision": "08ab0290140e5a5e0e81d46cade1f09c7282facf",
"version": "3.0.3"
}
},
{
"package": "ResearchKitOnFHIR",
"repositoryURL": "https://github.com/StanfordBDHG/ResearchKitOnFHIR",
"state": {
"branch": null,
"revision": "cdb24dd5607d5a63aaf3a3597c98122189cb548e",
"version": "1.3.0"
"revision": "dcd5f95522ed02a873b03c9638dbf397b99c74e0",
"version": "1.4.0"
}
},
{
"package": "Spezi",
"repositoryURL": "https://github.com/StanfordSpezi/Spezi",
"state": {
"branch": null,
"revision": "c43e4fa3d3938a847de2b677091a34ddaea5bc76",
"version": "1.2.3"
"revision": "734f90c19422a4196762b0e1dd055471066e89ee",
"version": "1.3.0"
}
},
{
Expand Down Expand Up @@ -222,8 +222,8 @@
"repositoryURL": "https://github.com/StanfordSpezi/SpeziFirebase.git",
"state": {
"branch": null,
"revision": "16c1c751c14b08ae593eacf9bc2752c2e070fe2f",
"version": "1.1.0"
"revision": "00ff0db12bf72ba39354e263d8f916ae8392368b",
"version": "1.1.2"
}
},
{
Expand All @@ -249,8 +249,8 @@
"repositoryURL": "https://github.com/StanfordSpezi/SpeziLLM.git",
"state": {
"branch": null,
"revision": "94f14f6a1d0fb4c7bb54efa6b6241f18dfc5004d",
"version": "0.8.2"
"revision": "3663884f23e55c67c875a97c5da08ed172ea02ac",
"version": "0.8.3"
}
},
{
Expand All @@ -276,8 +276,8 @@
"repositoryURL": "https://github.com/StanfordSpezi/SpeziQuestionnaire.git",
"state": {
"branch": null,
"revision": "f9d9b6d99bb1e00bda2974b440dca8367733d591",
"version": "1.1.0"
"revision": "76732ebcb0b521fa94d41c38a5fe35e6e1a87173",
"version": "1.2.1"
}
},
{
Expand Down Expand Up @@ -312,17 +312,17 @@
"repositoryURL": "https://github.com/apple/swift-argument-parser",
"state": {
"branch": null,
"revision": "46989693916f56d1186bd59ac15124caef896560",
"version": "1.3.1"
"revision": "0fbc8848e389af3bb55c182bc19ca9d5dc2f255b",
"version": "1.4.0"
}
},
{
"package": "swift-collections",
"repositoryURL": "https://github.com/apple/swift-collections.git",
"state": {
"branch": null,
"revision": "94cf62b3ba8d4bed62680a282d4c25f9c63c2efb",
"version": "1.1.0"
"revision": "ee97538f5b81ae89698fd95938896dec5217b148",
"version": "1.1.1"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
<CommandLineArguments>
<CommandLineArgument
argument = "--disableFirebase"
isEnabled = "NO">
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
argument = "--showOnboarding"
Expand Down
13 changes: 11 additions & 2 deletions OwnYourData/ClinicalTrials/NCITrialsModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,16 @@
}
}

private func loadTrials(keywords: [String], coordinate: CLLocationCoordinate2D?) async throws -> TrialResponse {
private func loadTrials(keywords: [String], coordinate: CLLocationCoordinate2D?, from: Int = 0) async throws -> TrialResponse {

Check warning on line 69 in OwnYourData/ClinicalTrials/NCITrialsModule.swift

View check run for this annotation

Codecov / codecov/patch

OwnYourData/ClinicalTrials/NCITrialsModule.swift#L69

Added line #L69 was not covered by tests
OpenAPIClientAPI.customHeaders = ["X-API-KEY": apiKey]
CodableHelper.dateFormatter = NICTrialsAPIDateFormatter()

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

return try await withCheckedThrowingContinuation { continuation in
var data: TrialResponse = try await withCheckedThrowingContinuation { continuation in

Check warning on line 75 in OwnYourData/ClinicalTrials/NCITrialsModule.swift

View check run for this annotation

Codecov / codecov/patch

OwnYourData/ClinicalTrials/NCITrialsModule.swift#L75

Added line #L75 was not covered by tests
TrialsAPI.searchTrialsByGet(
size: 50,
from: from,

Check warning on line 78 in OwnYourData/ClinicalTrials/NCITrialsModule.swift

View check run for this annotation

Codecov / codecov/patch

OwnYourData/ClinicalTrials/NCITrialsModule.swift#L78

Added line #L78 was not covered by tests
keyword: keywords.isEmpty ? nil : keywords,
trialStatus: "OPEN",
phase: "III",
Expand All @@ -95,5 +96,13 @@
continuation.resume(returning: data)
}
}

if from + 50 < data.total ?? 0 {
data.data?.append(
contentsOf: try await loadTrials(keywords: keywords, coordinate: coordinate, from: from + 50).data ?? []
)
}

return data

Check warning on line 106 in OwnYourData/ClinicalTrials/NCITrialsModule.swift

View check run for this annotation

Codecov / codecov/patch

OwnYourData/ClinicalTrials/NCITrialsModule.swift#L99-L106

Added lines #L99 - L106 were not covered by tests
}
}
4 changes: 0 additions & 4 deletions OwnYourData/Home.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ struct HomeView: View {
title: "Ask Questions",
destination: MultipleResourcesChatView(navigationTitle: "Ask Questions", textToSpeech: .constant(false))
)
OwnYourDataButton(
title: "View Your Records",
destination: ViewRecordsView()
)
OwnYourDataButton(
title: "Update Information",
destination: DocumentGallery()
Expand Down
4 changes: 2 additions & 2 deletions OwnYourData/Onboarding/Welcome.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ struct Welcome: View {
.accessibilityHidden(true)
},
title: "Access to Your Health Records",
description: "We help you securely access your health records"
description: "Securely access your health records."
),
OnboardingInformationView.Content(
icon: {
Image(systemName: "shippingbox.fill")
.accessibilityHidden(true)
},
title: "Trial Matching",
description: "We automatically match you to active trials."
description: "Automatically match to active trials."
),
OnboardingInformationView.Content(
icon: {
Expand Down
2 changes: 1 addition & 1 deletion OwnYourData/Resources/ConsentDocument.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ You can withdraw your consent at any time by adjusting your settings in the appl

6. **Contact Us**

If you have any questions or concerns about our privacy practices or your data, please contact our support team at alexa.aalmai@gmail.com
If you have any questions or concerns about our privacy practices or your data, please contact our support team at alexa.aalami@gmail.com
12 changes: 6 additions & 6 deletions OwnYourData/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
},
"Ask Questions" : {

},
"Automatically match to active trials." : {

},
"Close" : {

Expand Down Expand Up @@ -236,6 +239,9 @@
},
"Resource Settings" : {

},
"Securely access your health records." : {

},
"Share FHIR Resources" : {

Expand Down Expand Up @@ -288,12 +294,6 @@
},
"Use the OwnYourData algorithm to match you to possible NCI trials." : {

},
"We automatically match you to active trials." : {

},
"We help you securely access your health records" : {

},
"Welcome,\n%@" : {

Expand Down
Loading