Skip to content

Commit

Permalink
Merge branch 'main' into asign1/task2
Browse files Browse the repository at this point in the history
  • Loading branch information
nriedman authored Jan 23, 2024
2 parents 96170cf + 725e22f commit ff1bd94
Show file tree
Hide file tree
Showing 20 changed files with 161 additions and 167 deletions.
14 changes: 8 additions & 6 deletions Intake.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@
2F4FC8D729EE69D300BFFE26 /* MockUpload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F4FC8D629EE69D300BFFE26 /* MockUpload.swift */; };
2F5E32BD297E05EA003432F8 /* IntakeDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F5E32BC297E05EA003432F8 /* IntakeDelegate.swift */; };
2F6025CB29BBE70F0045459E /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 2F6025CA29BBE70F0045459E /* GoogleService-Info.plist */; };
2F65B44E2A3B8B0600A36932 /* NotificationPermissions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F65B44D2A3B8B0600A36932 /* NotificationPermissions.swift */; };
2FA0BFED2ACC977500E0EF83 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 2FA0BFEC2ACC977500E0EF83 /* Localizable.xcstrings */; };
2FB099AF2A875DF100B20952 /* FirebaseAuth in Frameworks */ = {isa = PBXBuildFile; productRef = 2FB099AE2A875DF100B20952 /* FirebaseAuth */; };
2FB099B12A875DF100B20952 /* FirebaseFirestore in Frameworks */ = {isa = PBXBuildFile; productRef = 2FB099B02A875DF100B20952 /* FirebaseFirestore */; };
2FB099B32A875DF100B20952 /* FirebaseFirestoreSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 2FB099B22A875DF100B20952 /* FirebaseFirestoreSwift */; };
2FB099B62A875E2B00B20952 /* HealthKitOnFHIR in Frameworks */ = {isa = PBXBuildFile; productRef = 2FB099B52A875E2B00B20952 /* HealthKitOnFHIR */; };
2FBD738C2A3BD150004228E7 /* SpeziScheduler in Frameworks */ = {isa = PBXBuildFile; productRef = 2FBD738B2A3BD150004228E7 /* SpeziScheduler */; };
2FC3439029EE6346002D773C /* SocialSupportQuestionnaire.json in Resources */ = {isa = PBXBuildFile; fileRef = 2FE5DC5529EDD811004B9AB4 /* SocialSupportQuestionnaire.json */; };
2FC3439129EE6349002D773C /* AppIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = 2FE5DC2A29EDD78D004B9AB4 /* AppIcon.png */; };
2FC3439229EE634B002D773C /* ConsentDocument.md in Resources */ = {isa = PBXBuildFile; fileRef = 2FE5DC2C29EDD78E004B9AB4 /* ConsentDocument.md */; };
2FC975A82978F11A00BA99FE /* Home.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FC975A72978F11A00BA99FE /* Home.swift */; };
2FE5DC2629EDD38A004B9AB4 /* Contacts.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DC2529EDD38A004B9AB4 /* Contacts.swift */; };
Expand Down Expand Up @@ -64,6 +62,7 @@
5661552E2AB854C000209B80 /* PackageHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5661552D2AB854C000209B80 /* PackageHelper.swift */; };
5680DD392AB8983D004E6D4A /* PackageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5680DD382AB8983D004E6D4A /* PackageCell.swift */; };
56F6F2A02AB441930022FE5A /* ContributionsList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56F6F29F2AB441930022FE5A /* ContributionsList.swift */; };
637BE1D52B572B4800EA19C6 /* Questionnaire.json.license in Resources */ = {isa = PBXBuildFile; fileRef = 637BE1D42B572B4800EA19C6 /* Questionnaire.json.license */; };
653A2551283387FE005D4D48 /* Intake.swift in Sources */ = {isa = PBXBuildFile; fileRef = 653A2550283387FE005D4D48 /* Intake.swift */; };
653A255528338800005D4D48 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 653A255428338800005D4D48 /* Assets.xcassets */; };
653A256228338800005D4D48 /* IntakeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 653A256128338800005D4D48 /* IntakeTests.swift */; };
Expand All @@ -74,6 +73,7 @@
A9D83F962B083794000D0C78 /* SpeziFirebaseAccountStorage in Frameworks */ = {isa = PBXBuildFile; productRef = A9D83F952B083794000D0C78 /* SpeziFirebaseAccountStorage */; };
A9DFE8A92ABE551400428242 /* AccountButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9DFE8A82ABE551400428242 /* AccountButton.swift */; };
A9FE7AD02AA39BAB0077B045 /* AccountSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9FE7ACF2AA39BAB0077B045 /* AccountSheet.swift */; };
ACAA47812B571C800032D21F /* Questionnaire.json in Resources */ = {isa = PBXBuildFile; fileRef = ACAA47802B571C7F0032D21F /* Questionnaire.json */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -101,13 +101,11 @@
2F4FC8D629EE69D300BFFE26 /* MockUpload.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockUpload.swift; sourceTree = "<group>"; };
2F5E32BC297E05EA003432F8 /* IntakeDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IntakeDelegate.swift; sourceTree = "<group>"; };
2F6025CA29BBE70F0045459E /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
2F65B44D2A3B8B0600A36932 /* NotificationPermissions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationPermissions.swift; sourceTree = "<group>"; };
2FA0BFEC2ACC977500E0EF83 /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = "<group>"; };
2FAEC07F297F583900C11C42 /* Intake.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Intake.entitlements; sourceTree = "<group>"; };
2FC94CD4298B0A1D009C8209 /* Intake.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = Intake.xctestplan; sourceTree = "<group>"; };
2FC975A72978F11A00BA99FE /* Home.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Home.swift; sourceTree = "<group>"; };
2FE5DC2529EDD38A004B9AB4 /* Contacts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Contacts.swift; sourceTree = "<group>"; };
2FE5DC2A29EDD78D004B9AB4 /* AppIcon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = AppIcon.png; sourceTree = "<group>"; };
2FE5DC2C29EDD78E004B9AB4 /* ConsentDocument.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = ConsentDocument.md; sourceTree = "<group>"; };
2FE5DC2F29EDD7CA004B9AB4 /* Consent.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Consent.swift; sourceTree = "<group>"; };
2FE5DC3029EDD7CA004B9AB4 /* HealthKitPermissions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HealthKitPermissions.swift; sourceTree = "<group>"; };
Expand All @@ -132,6 +130,7 @@
5661552D2AB854C000209B80 /* PackageHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PackageHelper.swift; sourceTree = "<group>"; };
5680DD382AB8983D004E6D4A /* PackageCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PackageCell.swift; sourceTree = "<group>"; };
56F6F29F2AB441930022FE5A /* ContributionsList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContributionsList.swift; sourceTree = "<group>"; };
637BE1D42B572B4800EA19C6 /* Questionnaire.json.license */ = {isa = PBXFileReference; lastKnownFileType = text; path = Questionnaire.json.license; sourceTree = "<group>"; };
653A254D283387FE005D4D48 /* Intake.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Intake.app; sourceTree = BUILT_PRODUCTS_DIR; };
653A2550283387FE005D4D48 /* Intake.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Intake.swift; sourceTree = "<group>"; };
653A255428338800005D4D48 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
Expand All @@ -142,6 +141,7 @@
A9720E422ABB68CC00872D23 /* AccountSetupHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountSetupHeader.swift; sourceTree = "<group>"; };
A9DFE8A82ABE551400428242 /* AccountButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountButton.swift; sourceTree = "<group>"; };
A9FE7ACF2AA39BAB0077B045 /* AccountSheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountSheet.swift; sourceTree = "<group>"; };
ACAA47802B571C7F0032D21F /* Questionnaire.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = Questionnaire.json; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -230,7 +230,6 @@
2FE5DCAC29EE6107004B9AB4 /* AccountOnboarding.swift */,
2FE5DC2F29EDD7CA004B9AB4 /* Consent.swift */,
2FE5DC3029EDD7CA004B9AB4 /* HealthKitPermissions.swift */,
2F65B44D2A3B8B0600A36932 /* NotificationPermissions.swift */,
);
path = Onboarding;
sourceTree = "<group>";
Expand All @@ -242,7 +241,9 @@
2FA0BFEC2ACC977500E0EF83 /* Localizable.xcstrings */,
2FE5DC2C29EDD78E004B9AB4 /* ConsentDocument.md */,
2FE5DC2A29EDD78D004B9AB4 /* AppIcon.png */,
ACAA47802B571C7F0032D21F /* Questionnaire.json */,
2FE5DC5529EDD811004B9AB4 /* SocialSupportQuestionnaire.json */,
637BE1D42B572B4800EA19C6 /* Questionnaire.json.license */,
);
path = Resources;
sourceTree = "<group>";
Expand Down Expand Up @@ -523,10 +524,12 @@
files = (
2FC3439229EE634B002D773C /* ConsentDocument.md in Resources */,
2FC3439129EE6349002D773C /* AppIcon.png in Resources */,
637BE1D52B572B4800EA19C6 /* Questionnaire.json.license in Resources */,
653A255528338800005D4D48 /* Assets.xcassets in Resources */,
2FC3439029EE6346002D773C /* SocialSupportQuestionnaire.json in Resources */,
2FA0BFED2ACC977500E0EF83 /* Localizable.xcstrings in Resources */,
2F6025CB29BBE70F0045459E /* GoogleService-Info.plist in Resources */,
ACAA47812B571C800032D21F /* Questionnaire.json in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -602,7 +605,6 @@
A9FE7AD02AA39BAB0077B045 /* AccountSheet.swift in Sources */,
653A2551283387FE005D4D48 /* Intake.swift in Sources */,
2FE5DC3629EDD7CA004B9AB4 /* HealthKitPermissions.swift in Sources */,
2F65B44E2A3B8B0600A36932 /* NotificationPermissions.swift in Sources */,
5661552E2AB854C000209B80 /* PackageHelper.swift in Sources */,
27FA29902A388E9B009CAC45 /* ModalView.swift in Sources */,
2FE5DC2629EDD38A004B9AB4 /* Contacts.swift in Sources */,
Expand Down
21 changes: 11 additions & 10 deletions Intake/Contacts/Contacts.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,32 @@ struct Contacts: View {
let contacts = [
Contact(
name: PersonNameComponents(
givenName: "Leland",
familyName: "Stanford"
givenName: "Oliver O.",
familyName: "Aalami"
),
image: Image(systemName: "figure.wave.circle"), // swiftlint:disable:this accessibility_label_for_image
title: "University Founder",
description: String(localized: "LELAND_STANFORD_BIO"),
image: Image("ProfilePicture"), // swiftlint:disable:this accessibility_label_for_image
title: "CLINICAL PROFESSOR, SURGERY - VASCULAR SURGERY",
description: String(localized: "OLIVER_AALAMI_BIO"),
organization: "Stanford University",
address: {
let address = CNMutablePostalAddress()
address.country = "USA"
address.state = "CA"
address.postalCode = "94305"
address.city = "Stanford"
address.street = "450 Serra Mall"
address.street = "300 Pasteur Dr"
address.subAdministrativeArea = "Rm H3640 MC 5308"
return address
}(),
contactOptions: [
.call("+1 (650) 723-2300"),
.text("+1 (650) 723-2300"),
.email(addresses: ["contact@stanford.edu"]),
.call("+1 (650) 725-5227"),
.text("+1 (650) 725-5227"),
.email(addresses: ["aalami@stanford.edu"]),
ContactOption(
image: Image(systemName: "safari.fill"), // swiftlint:disable:this accessibility_label_for_image
title: "Website",
action: {
if let url = URL(string: "https://stanford.edu") {
if let url = URL(string: "https://profiles.stanford.edu/oliver-aalami") {
UIApplication.shared.open(url)
}
}
Expand Down
21 changes: 18 additions & 3 deletions Intake/IntakeDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,24 @@ class IntakeDelegate: SpeziAppDelegate {

private var healthKit: HealthKit {
HealthKit {
CollectSample(
HKQuantityType(.stepCount),
deliverySetting: .anchorQuery(.afterAuthorizationAndApplicationWillLaunch)
CollectSamples(
[
HKClinicalType(.allergyRecord),
HKClinicalType(.clinicalNoteRecord),
HKClinicalType(.conditionRecord),
HKClinicalType(.coverageRecord),
HKClinicalType(.immunizationRecord),
HKClinicalType(.labResultRecord),
HKClinicalType(.medicationRecord),
HKClinicalType(.procedureRecord),
HKClinicalType(.vitalSignRecord)
],
predicate: HKQuery.predicateForSamples(
withStart: Date.distantPast,
end: nil,
options: .strictEndDate
),
deliverySetting: .anchorQuery(saveAnchor: false)
)
}
}
Expand Down
77 changes: 0 additions & 77 deletions Intake/Onboarding/NotificationPermissions.swift

This file was deleted.

9 changes: 0 additions & 9 deletions Intake/Onboarding/OnboardingFlow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ struct OnboardingFlow: View {

@AppStorage(StorageKeys.onboardingFlowComplete) private var completedOnboardingFlow = false

@State private var localNotificationAuthorization = false


private var healthKitAuthorization: Bool {
// As HealthKit not available in preview simulator
Expand Down Expand Up @@ -49,14 +47,7 @@ struct OnboardingFlow: View {
if HKHealthStore.isHealthDataAvailable() && !healthKitAuthorization {
HealthKitPermissions()
}

if !localNotificationAuthorization {
NotificationPermissions()
}
}
.task {
localNotificationAuthorization = await scheduler.localNotificationAuthorization
}
.interactiveDismissDisabled(!completedOnboardingFlow)
}
}
Expand Down
Binary file removed Intake/Resources/AppIcon.png
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
{
"colors" : [
{
"color" : {
"color-space" : "display-p3",
"components" : {
"alpha" : "1.000",
"blue" : "0.640",
"green" : "0.238",
"red" : "0.053"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "display-p3",
"components" : {
"alpha" : "1.000",
"blue" : "0.910",
"green" : "1.000",
"red" : "0.685"
}
},
"idiom" : "universal"
}
],
Expand Down
Binary file modified Intake/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"images" : [
{
"filename" : "ProfilePicture.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"localizable" : true
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This source file is part of the Intake based on the Stanford Spezi Template Application project

SPDX-FileCopyrightText: 2023 Stanford University

SPDX-License-Identifier: MIT
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This source file is part of the Intake based on the Stanford Spezi Template Application project

SPDX-FileCopyrightText: 2023 Stanford University

SPDX-License-Identifier: MIT
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions Intake/Resources/Assets.xcassets/ProfilePicture.png.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This source file is part of the Intake based on the Stanford Spezi Template Application project

SPDX-FileCopyrightText: 2023 Stanford University

SPDX-License-Identifier: MIT
Loading

0 comments on commit ff1bd94

Please sign in to comment.