diff --git a/Behavior.xcodeproj/project.pbxproj b/Behavior.xcodeproj/project.pbxproj index bbe87cf..8689b47 100644 --- a/Behavior.xcodeproj/project.pbxproj +++ b/Behavior.xcodeproj/project.pbxproj @@ -23,7 +23,8 @@ 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 */; }; + 2FC3439029EE6346002D773C /* EmotionQuestionnaire.json in Resources */ = {isa = PBXBuildFile; fileRef = 2FE5DC5529EDD811004B9AB4 /* EmotionQuestionnaire.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 */; }; @@ -58,6 +59,7 @@ 2FE5DCB129EE6107004B9AB4 /* AccountOnboarding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DCAC29EE6107004B9AB4 /* AccountOnboarding.swift */; }; 2FF53D8B2A8725DE00042B76 /* SpeziMockWebService in Frameworks */ = {isa = PBXBuildFile; productRef = 2FF53D8A2A8725DE00042B76 /* SpeziMockWebService */; }; 2FF53D8D2A8729D600042B76 /* BehaviorStandard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FF53D8C2A8729D600042B76 /* BehaviorStandard.swift */; }; + 35B8E0BD2B5F3915005F64F4 /* EmotionQuestionnaire.json.license in Resources */ = {isa = PBXBuildFile; fileRef = 35B8E0BC2B5F3915005F64F4 /* EmotionQuestionnaire.json.license */; }; 5661551D2AB8384200209B80 /* SwiftPackageList in Frameworks */ = {isa = PBXBuildFile; productRef = 5661551C2AB8384200209B80 /* SwiftPackageList */; }; 566155292AB8447C00209B80 /* Package+LicenseType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 566155282AB8447C00209B80 /* Package+LicenseType.swift */; }; 5661552E2AB854C000209B80 /* PackageHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5661552D2AB854C000209B80 /* PackageHelper.swift */; }; @@ -123,9 +125,10 @@ 2FE5DC4B29EDD7FA004B9AB4 /* BehaviorTaskContext.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BehaviorTaskContext.swift; sourceTree = ""; }; 2FE5DC4C29EDD7FA004B9AB4 /* BehaviorScheduler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BehaviorScheduler.swift; sourceTree = ""; }; 2FE5DC4D29EDD7FA004B9AB4 /* Bundle+Questionnaire.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Bundle+Questionnaire.swift"; sourceTree = ""; }; - 2FE5DC5529EDD811004B9AB4 /* SocialSupportQuestionnaire.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = SocialSupportQuestionnaire.json; sourceTree = ""; }; + 2FE5DC5529EDD811004B9AB4 /* EmotionQuestionnaire.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = EmotionQuestionnaire.json; sourceTree = ""; }; 2FE5DCAC29EE6107004B9AB4 /* AccountOnboarding.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AccountOnboarding.swift; sourceTree = ""; }; 2FF53D8C2A8729D600042B76 /* BehaviorStandard.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BehaviorStandard.swift; sourceTree = ""; }; + 35B8E0BC2B5F3915005F64F4 /* EmotionQuestionnaire.json.license */ = {isa = PBXFileReference; lastKnownFileType = text; path = EmotionQuestionnaire.json.license; sourceTree = ""; }; 566155282AB8447C00209B80 /* Package+LicenseType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Package+LicenseType.swift"; sourceTree = ""; }; 5661552D2AB854C000209B80 /* PackageHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PackageHelper.swift; sourceTree = ""; }; 5680DD382AB8983D004E6D4A /* PackageCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PackageCell.swift; sourceTree = ""; }; @@ -239,7 +242,9 @@ 653A255428338800005D4D48 /* Assets.xcassets */, 2FA0BFEC2ACC977500E0EF83 /* Localizable.xcstrings */, 2FE5DC2C29EDD78E004B9AB4 /* ConsentDocument.md */, - 2FE5DC5529EDD811004B9AB4 /* SocialSupportQuestionnaire.json */, + 2FE5DC2A29EDD78D004B9AB4 /* AppIcon.png */, + 2FE5DC5529EDD811004B9AB4 /* EmotionQuestionnaire.json */, + 35B8E0BC2B5F3915005F64F4 /* EmotionQuestionnaire.json.license */, ); path = Resources; sourceTree = ""; @@ -519,8 +524,10 @@ buildActionMask = 2147483647; files = ( 2FC3439229EE634B002D773C /* ConsentDocument.md in Resources */, + 35B8E0BD2B5F3915005F64F4 /* EmotionQuestionnaire.json.license in Resources */, + 2FC3439129EE6349002D773C /* AppIcon.png in Resources */, 653A255528338800005D4D48 /* Assets.xcassets in Resources */, - 2FC3439029EE6346002D773C /* SocialSupportQuestionnaire.json in Resources */, + 2FC3439029EE6346002D773C /* EmotionQuestionnaire.json in Resources */, 2FA0BFED2ACC977500E0EF83 /* Localizable.xcstrings in Resources */, 2F6025CB29BBE70F0045459E /* GoogleService-Info.plist in Resources */, ); diff --git a/Behavior.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Behavior.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved deleted file mode 100644 index c6a59ae..0000000 --- a/Behavior.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ /dev/null @@ -1,320 +0,0 @@ -{ - "pins" : [ - { - "identity" : "abseil-cpp-binary", - "kind" : "remoteSourceControl", - "location" : "https://github.com/google/abseil-cpp-binary.git", - "state" : { - "revision" : "bfc0b6f81adc06ce5121eb23f628473638d67c5c", - "version" : "1.2022062300.0" - } - }, - { - "identity" : "app-check", - "kind" : "remoteSourceControl", - "location" : "https://github.com/google/app-check.git", - "state" : { - "revision" : "5746b2d35c91c50581590ed97abe4c06b5037274", - "version" : "10.18.0" - } - }, - { - "identity" : "fhirmodels", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/FHIRModels", - "state" : { - "revision" : "861afd5816a98d38f86220eab2f812d76cad84a0", - "version" : "0.5.0" - } - }, - { - "identity" : "firebase-ios-sdk", - "kind" : "remoteSourceControl", - "location" : "https://github.com/firebase/firebase-ios-sdk.git", - "state" : { - "revision" : "c60c958e707c50a9cf8bcb7cfd7d51c566d726c5", - "version" : "10.19.1" - } - }, - { - "identity" : "googleappmeasurement", - "kind" : "remoteSourceControl", - "location" : "https://github.com/google/GoogleAppMeasurement.git", - "state" : { - "revision" : "6b332152355c372ace9966d8ee76ed191f97025e", - "version" : "10.17.0" - } - }, - { - "identity" : "googledatatransport", - "kind" : "remoteSourceControl", - "location" : "https://github.com/google/GoogleDataTransport.git", - "state" : { - "revision" : "a732a4b47f59e4f725a2ea10f0c77e93a7131117", - "version" : "9.3.0" - } - }, - { - "identity" : "googleutilities", - "kind" : "remoteSourceControl", - "location" : "https://github.com/google/GoogleUtilities.git", - "state" : { - "revision" : "bc27fad73504f3d4af235de451f02ee22586ebd3", - "version" : "7.12.1" - } - }, - { - "identity" : "grpc-binary", - "kind" : "remoteSourceControl", - "location" : "https://github.com/google/grpc-binary.git", - "state" : { - "revision" : "a673bc2937fbe886dd1f99c401b01b6d977a9c98", - "version" : "1.49.1" - } - }, - { - "identity" : "gtm-session-fetcher", - "kind" : "remoteSourceControl", - "location" : "https://github.com/google/gtm-session-fetcher.git", - "state" : { - "revision" : "115f75e43851774934d695449a4836123c3246e1", - "version" : "3.2.0" - } - }, - { - "identity" : "healthkitonfhir", - "kind" : "remoteSourceControl", - "location" : "https://github.com/StanfordBDHG/HealthKitOnFHIR.git", - "state" : { - "revision" : "825e96007d83ed83f81ee49eb3ebab29d7b7ba2f", - "version" : "0.2.5" - } - }, - { - "identity" : "interop-ios-for-google-sdks", - "kind" : "remoteSourceControl", - "location" : "https://github.com/google/interop-ios-for-google-sdks.git", - "state" : { - "revision" : "2d12673670417654f08f5f90fdd62926dc3a2648", - "version" : "100.0.0" - } - }, - { - "identity" : "leveldb", - "kind" : "remoteSourceControl", - "location" : "https://github.com/firebase/leveldb.git", - "state" : { - "revision" : "9d108e9112aa1d65ce508facf804674546116d9c", - "version" : "1.22.3" - } - }, - { - "identity" : "nanopb", - "kind" : "remoteSourceControl", - "location" : "https://github.com/firebase/nanopb.git", - "state" : { - "revision" : "819d0a2173aff699fb8c364b6fb906f7cdb1a692", - "version" : "2.30909.0" - } - }, - { - "identity" : "promises", - "kind" : "remoteSourceControl", - "location" : "https://github.com/google/promises.git", - "state" : { - "revision" : "e70e889c0196c76d22759eb50d6a0270ca9f1d9e", - "version" : "2.3.1" - } - }, - { - "identity" : "researchkit", - "kind" : "remoteSourceControl", - "location" : "https://github.com/StanfordBDHG/ResearchKit", - "state" : { - "revision" : "cf79a15c7d8c436f98937fe93e72e880dd2f73e4", - "version" : "2.2.20" - } - }, - { - "identity" : "researchkitonfhir", - "kind" : "remoteSourceControl", - "location" : "https://github.com/StanfordBDHG/ResearchKitOnFHIR", - "state" : { - "revision" : "7dc09f7acd7fb19673594e0fdd4d72d0869ee006", - "version" : "1.0.0" - } - }, - { - "identity" : "spezi", - "kind" : "remoteSourceControl", - "location" : "https://github.com/StanfordSpezi/Spezi", - "state" : { - "revision" : "c4bf0e99de40acfdd2baf0fa02769f06a4c3f0eb", - "version" : "1.1.0" - } - }, - { - "identity" : "speziaccount", - "kind" : "remoteSourceControl", - "location" : "https://github.com/StanfordSpezi/SpeziAccount.git", - "state" : { - "revision" : "714f01ae1e67bf9c1c0e7c07624380f9bea772b7", - "version" : "1.1.0" - } - }, - { - "identity" : "spezicontact", - "kind" : "remoteSourceControl", - "location" : "https://github.com/StanfordSpezi/SpeziContact.git", - "state" : { - "revision" : "494b776f8c98d771e4a609a1fb706097dba4c030", - "version" : "1.0.0" - } - }, - { - "identity" : "spezifirebase", - "kind" : "remoteSourceControl", - "location" : "https://github.com/StanfordSpezi/SpeziFirebase.git", - "state" : { - "revision" : "ca1edf678ec59e76c9869ee3448e6e165d9c2789", - "version" : "1.0.0" - } - }, - { - "identity" : "spezifoundation", - "kind" : "remoteSourceControl", - "location" : "https://github.com/StanfordSpezi/SpeziFoundation.git", - "state" : { - "revision" : "683c66f922a4cfe0882c4a86a43854f613b48541", - "version" : "1.0.0" - } - }, - { - "identity" : "spezihealthkit", - "kind" : "remoteSourceControl", - "location" : "https://github.com/StanfordSpezi/SpeziHealthKit.git", - "state" : { - "revision" : "d882734a4ed31fce1bffd7b9977e2669080f21de", - "version" : "0.5.0" - } - }, - { - "identity" : "spezimockwebservice", - "kind" : "remoteSourceControl", - "location" : "https://github.com/StanfordSpezi/SpeziMockWebService.git", - "state" : { - "revision" : "b18067d3499e630bbd995ef05a296ef8fdd42528", - "version" : "1.0.0" - } - }, - { - "identity" : "spezionboarding", - "kind" : "remoteSourceControl", - "location" : "https://github.com/StanfordSpezi/SpeziOnboarding", - "state" : { - "revision" : "ae7b18a18453557cd95c7adeb8f75846f48c343c", - "version" : "1.0.0" - } - }, - { - "identity" : "speziquestionnaire", - "kind" : "remoteSourceControl", - "location" : "https://github.com/StanfordSpezi/SpeziQuestionnaire.git", - "state" : { - "revision" : "930a4099db1aca9db0b6ed4e77687141c4780052", - "version" : "1.0.0" - } - }, - { - "identity" : "spezischeduler", - "kind" : "remoteSourceControl", - "location" : "https://github.com/StanfordSpezi/SpeziScheduler.git", - "state" : { - "revision" : "adf793cb47dc199f8ae88f5c719f4d3ba06a4c4e", - "version" : "0.8.0" - } - }, - { - "identity" : "spezistorage", - "kind" : "remoteSourceControl", - "location" : "https://github.com/StanfordSpezi/SpeziStorage.git", - "state" : { - "revision" : "eaed2220375c35400aa69d1f96a8d32b7e66b1c7", - "version" : "1.0.0" - } - }, - { - "identity" : "speziviews", - "kind" : "remoteSourceControl", - "location" : "https://github.com/StanfordSpezi/SpeziViews.git", - "state" : { - "revision" : "0137e69d156bf4001a8d6bf5661c9a37b2bbd0aa", - "version" : "1.0.0" - } - }, - { - "identity" : "swift-argument-parser", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-argument-parser", - "state" : { - "revision" : "c8ed701b513cf5177118a175d85fbbbcd707ab41", - "version" : "1.3.0" - } - }, - { - "identity" : "swift-collections", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-collections.git", - "state" : { - "revision" : "d029d9d39c87bed85b1c50adee7c41795261a192", - "version" : "1.0.6" - } - }, - { - "identity" : "swift-package-list", - "kind" : "remoteSourceControl", - "location" : "https://github.com/FelixHerrmann/swift-package-list", - "state" : { - "revision" : "412180a72b9a1f8262213c16459e3533b0385ea5", - "version" : "3.1.0" - } - }, - { - "identity" : "swift-protobuf", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-protobuf.git", - "state" : { - "revision" : "65e8f29b2d63c4e38e736b25c27b83e012159be8", - "version" : "1.25.2" - } - }, - { - "identity" : "xctestextensions", - "kind" : "remoteSourceControl", - "location" : "https://github.com/StanfordBDHG/XCTestExtensions.git", - "state" : { - "revision" : "388a6d6a5be48eff5d98a2c45e0b50f30ed21dc3", - "version" : "0.4.7" - } - }, - { - "identity" : "xcthealthkit", - "kind" : "remoteSourceControl", - "location" : "https://github.com/StanfordBDHG/XCTHealthKit.git", - "state" : { - "revision" : "6e9344a2d632b801d94fe3bbd1d891817e032103", - "version" : "0.3.5" - } - }, - { - "identity" : "xctruntimeassertions", - "kind" : "remoteSourceControl", - "location" : "https://github.com/StanfordBDHG/XCTRuntimeAssertions", - "state" : { - "revision" : "bb2a287c2544aa846e53670d1ece35e5949567be", - "version" : "1.0.0" - } - } - ], - "version" : 2 -} diff --git a/Behavior/Resources/EmotionQuestionnaire.json b/Behavior/Resources/EmotionQuestionnaire.json new file mode 100644 index 0000000..efa41a5 --- /dev/null +++ b/Behavior/Resources/EmotionQuestionnaire.json @@ -0,0 +1,273 @@ +{ + "resourceType": "Questionnaire", + "language": "en-US", + "id": "EmotionQuestionnaire", + "name": "EmotionQuestionnaire", + "title": "Emotion Questionnaire", + "description": "This survey measures tangible social support plus a couple of demographic questions.", + "version": "1", + "status": "draft", + "publisher": "RAND Corp", + "meta": { + "profile": [ + "http://spezi.stanford.edu/fhir/StructureDefinition/sdf-Questionnaire" + ], + "tag": [ + { + "system": "urn:ietf:bcp:47", + "code": "en-US", + "display": "English" + } + ] + }, + "useContext": [ + { + "code": { + "system": "http://hl7.org/fhir/ValueSet/usage-context-type", + "code": "focus", + "display": "Clinical Focus" + }, + "valueCodeableConcept": { + "coding": [ + { + "system": "urn:oid:2.16.578.1.12.4.1.1.8655", + "display": "Social Support" + } + ] + } + } + ], + "contact": [ + { + "name": "https://www.rand.org/health-care/surveys_tools/mos/social-support/survey-instrument.html" + } + ], + "subjectType": [ + "Patient" + ], + "purpose": "The RAND Medical Outcomes Social Support survey is a 4-item questionnaire that measures social support.", + "copyright": "RAND Corp surveys are open-source and free to use.", + "date": "2023-01-23T00:00:00-08:00", + "url": "http://spezi.stanford.edu/fhir/questionnaire/32f43c8e-93e9-4c70-97a0-e716f8030073", + "item": [ + { + "linkId": "dcea2683-9815-4505-b240-e75b502b29ef", + "type": "choice", + "text": "How are you feeling today?", + "answerOption": [ + { + "valueCoding": { + "id": "d2f6172d-9402-4cb3-870a-584a7be3a5d7", + "code": "awesome", + "system": "urn:uuid:e9ecdd47-2e8b-49b3-8780-9d0769a246aa", + "display": "Awesome" + } + }, + { + "valueCoding": { + "id": "ec48001e-f03e-4a14-8a7a-9fcf34fa81d2", + "code": "good", + "system": "urn:uuid:e9ecdd47-2e8b-49b3-8780-9d0769a246aa", + "display": "Good" + } + }, + { + "valueCoding": { + "id": "1952f02f-96e0-4208-81cd-086ea143ad4e", + "code": "neutral", + "system": "urn:uuid:e9ecdd47-2e8b-49b3-8780-9d0769a246aa", + "display": "Neutral" + } + }, + { + "valueCoding": { + "id": "b785522d-ca93-4d22-9a28-a9c1c031fd3b", + "code": "bad", + "system": "urn:uuid:e9ecdd47-2e8b-49b3-8780-9d0769a246aa", + "display": "Bad" + } + }, + { + "valueCoding": { + "id": "75428b55-f513-43b7-fd09-1008a364970b", + "code": "horrible", + "system": "urn:uuid:e9ecdd47-2e8b-49b3-8780-9d0769a246aa", + "display": "Horrible" + } + } + ], + "item": [ + { + "linkId": "7b707d33-558a-4579-833f-4e6eb2453699", + "type": "string", + "text": "Why do you feel this way?", + "required": false + }, + { + "linkId": "0f7e96cd-508f-452a-dc0d-112490bb449e", + "type": "string", + "text": "What would make your day better?", + "required": false, + "enableWhen": [ + { + "question": "dcea2683-9815-4505-b240-e75b502b29ef", + "operator": "=", + "answerCoding": { + "system": "urn:uuid:e9ecdd47-2e8b-49b3-8780-9d0769a246aa", + "code": "bad" + } + }, + { + "question": "dcea2683-9815-4505-b240-e75b502b29ef", + "operator": "=", + "answerCoding": { + "system": "urn:uuid:e9ecdd47-2e8b-49b3-8780-9d0769a246aa", + "code": "horrible" + } + } + ] + } + ] + }, + { + "linkId": "8a861e17-b996-4d89-e125-41015c8e72eb", + "type": "choice", + "text": "I accomplished ____", + "required": false, + "answerOption": [ + { + "valueCoding": { + "id": "03a679bb-8804-45c6-86d6-93826f9e7518", + "code": "all-my-goals-today", + "system": "urn:uuid:444152cb-76b9-418a-8cf0-793d118fb667", + "display": "All my goals today" + } + }, + { + "valueCoding": { + "id": "7b86d057-643f-48ef-855b-0e81ffda6aaf", + "code": "most-of-my-goals-today", + "system": "urn:uuid:444152cb-76b9-418a-8cf0-793d118fb667", + "display": "Most of my goals today" + } + }, + { + "valueCoding": { + "id": "50867e24-98a7-425b-f88b-bd0068921228", + "code": "half-of-my-goals-today", + "system": "urn:uuid:444152cb-76b9-418a-8cf0-793d118fb667", + "display": "Half of my goals today" + } + }, + { + "valueCoding": { + "id": "4d2a473d-afaa-4524-864e-25551d19b472", + "code": "few-of-my-goals-today", + "system": "urn:uuid:444152cb-76b9-418a-8cf0-793d118fb667", + "display": "Few of my goals today" + } + }, + { + "valueCoding": { + "id": "d1f10e9d-435a-4d06-df7e-81bdb84fc387", + "code": "none-of-my-goals-today", + "system": "urn:uuid:444152cb-76b9-418a-8cf0-793d118fb667", + "display": "None of my goals today" + } + } + ], + "item": [ + { + "linkId": "105749f3-3a3c-4762-e961-f90b4ce212d1", + "type": "boolean", + "text": "I am proud of my results today. ", + "required": false + } + ] + }, + { + "linkId": "7ce72c73-2cc3-4897-e722-a43d3e969096", + "type": "string", + "text": "How did you challenge yourself today?", + "required": false, + "item": [ + { + "linkId": "a05786ac-970c-4017-8acb-bd97a97f6267", + "type": "boolean", + "text": "I would approach this challenge different next time. ", + "required": false + }, + { + "linkId": "0707ab1e-90ab-422a-8f78-23cc28065a1a", + "type": "string", + "text": "What would you do differently next time?", + "required": false, + "enableWhen": [ + { + "question": "a05786ac-970c-4017-8acb-bd97a97f6267", + "operator": "=", + "answerBoolean": true + } + ] + } + ] + }, + { + "linkId": "c8b0111d-dbca-43fd-9ead-6a93e062f6c2", + "type": "string", + "text": "How will you challenge yourself tomorrow?", + "required": false, + "item": [ + { + "linkId": "d1acf1a8-b46a-4d08-9ba0-5586fd7ae1bb", + "type": "choice", + "text": "How do you feel about tomorrow?", + "required": false, + "answerOption": [ + { + "valueCoding": { + "id": "5bb3ca44-5395-43e9-8a54-78aa9659020f", + "code": "awesome", + "system": "urn:uuid:6ca7f6d3-0448-43d1-d4f6-207f063b71a7", + "display": "Awesome" + } + }, + { + "valueCoding": { + "id": "2dd1ff89-5910-4131-8d5a-ed04757a5fb1", + "code": "good", + "system": "urn:uuid:6ca7f6d3-0448-43d1-d4f6-207f063b71a7", + "display": "Good" + } + }, + { + "valueCoding": { + "id": "4977118e-8951-429a-8c1d-e52d31f2e669", + "code": "neutral", + "system": "urn:uuid:6ca7f6d3-0448-43d1-d4f6-207f063b71a7", + "display": "Neutral" + } + }, + { + "valueCoding": { + "id": "9e11ccc7-8353-4dff-8921-6dc0ead279ef", + "code": "bad", + "system": "urn:uuid:6ca7f6d3-0448-43d1-d4f6-207f063b71a7", + "display": "Bad" + } + }, + { + "valueCoding": { + "id": "89a89f5a-58e0-444c-83ec-1b7b7de559e7", + "code": "horrible", + "system": "urn:uuid:6ca7f6d3-0448-43d1-d4f6-207f063b71a7", + "display": "Horrible" + } + } + ] + } + ] + } + ] +} + diff --git a/Behavior/Resources/EmotionQuestionnaire.json.license b/Behavior/Resources/EmotionQuestionnaire.json.license new file mode 100644 index 0000000..dc72ac5 --- /dev/null +++ b/Behavior/Resources/EmotionQuestionnaire.json.license @@ -0,0 +1,7 @@ +// +// This source file is part of the Behavior based on the Stanford Spezi Template Application project +// +// SPDX-FileCopyrightText: 2023 Stanford University +// +// SPDX-License-Identifier: MIT +// diff --git a/Behavior/Resources/Localizable.xcstrings b/Behavior/Resources/Localizable.xcstrings index 36343c1..7904315 100644 --- a/Behavior/Resources/Localizable.xcstrings +++ b/Behavior/Resources/Localizable.xcstrings @@ -134,6 +134,26 @@ } } }, + "EMOTION_QUESTIONNAIRE_DESCRIPTION" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Reflect on how you felt throughout the day! " + } + } + } + }, + "EMOTION_QUESTIONNAIRE_TITLE" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Emotion Questionnaire" + } + } + } + }, "EMMA_BRUNSKILL_BIO" : { "localizations" : { "en" : { @@ -450,6 +470,7 @@ } }, "TASK_SOCIAL_SUPPORT_QUESTIONNAIRE_DESCRIPTION" : { + "extractionState" : "stale", "localizations" : { "en" : { "stringUnit" : { @@ -460,6 +481,7 @@ } }, "TASK_SOCIAL_SUPPORT_QUESTIONNAIRE_TITLE" : { + "extractionState" : "stale", "localizations" : { "en" : { "stringUnit" : { diff --git a/Behavior/Resources/SocialSupportQuestionnaire.json b/Behavior/Resources/SocialSupportQuestionnaire.json deleted file mode 100644 index d3c584d..0000000 --- a/Behavior/Resources/SocialSupportQuestionnaire.json +++ /dev/null @@ -1,387 +0,0 @@ -{ - "resourceType": "Questionnaire", - "language": "en-US", - "id": "socialsupport", - "name": "SocialSupport", - "title": "Social Support", - "description": "This survey measures tangible social support plus a couple of demographic questions.", - "version": "1", - "status": "draft", - "publisher": "RAND Corp", - "meta": { - "profile": [ - "http://spezi.stanford.edu/fhir/StructureDefinition/sdf-Questionnaire" - ], - "tag": [ - { - "system": "urn:ietf:bcp:47", - "code": "en-US", - "display": "English" - } - ] - }, - "useContext": [ - { - "code": { - "system": "http://hl7.org/fhir/ValueSet/usage-context-type", - "code": "focus", - "display": "Clinical Focus" - }, - "valueCodeableConcept": { - "coding": [ - { - "system": "urn:oid:2.16.578.1.12.4.1.1.8655", - "display": "Social Support" - } - ] - } - } - ], - "contact": [ - { - "name": "https://www.rand.org/health-care/surveys_tools/mos/social-support/survey-instrument.html" - } - ], - "subjectType": [ - "Patient" - ], - "purpose": "The RAND Medical Outcomes Social Support survey is a 4-item questionnaire that measures social support.", - "copyright": "RAND Corp surveys are open-source and free to use.", - "date": "2023-01-23T00:00:00-08:00", - "url": "http://spezi.stanford.edu/fhir/questionnaire/32f43c8e-93e9-4c70-97a0-e716f8030073", - "item": [ - { - "linkId": "dcea2683-9815-4505-b240-e75b502b29ef", - "type": "choice", - "text": "How often do you need someone to help you if you were confined to bed?", - "required": false, - "answerOption": [ - { - "valueCoding": { - "id": "3d6fe1b8-c64b-497c-8583-db7ddda9e94e", - "code": "1", - "system": "urn:uuid:e9ecdd47-2e8b-49b3-8780-9d0769a246aa", - "display": "None of the time" - } - }, - { - "valueCoding": { - "id": "b4081e9d-d0f1-4aea-9a15-eac4a15d1d10", - "code": "2", - "system": "urn:uuid:e9ecdd47-2e8b-49b3-8780-9d0769a246aa", - "display": "A little of the time" - } - }, - { - "valueCoding": { - "id": "e32f7952-e280-48d7-9746-c13dbb26638f", - "code": "3", - "system": "urn:uuid:e9ecdd47-2e8b-49b3-8780-9d0769a246aa", - "display": "Some of the time" - } - }, - { - "valueCoding": { - "id": "d2f6172d-9402-4cb3-870a-584a7be3a5d7", - "code": "4", - "system": "urn:uuid:e9ecdd47-2e8b-49b3-8780-9d0769a246aa", - "display": "Most of the time" - } - }, - { - "valueCoding": { - "id": "ec48001e-f03e-4a14-8a7a-9fcf34fa81d2", - "code": "5", - "system": "urn:uuid:e9ecdd47-2e8b-49b3-8780-9d0769a246aa", - "display": "All of the time" - } - } - ] - }, - { - "linkId": "ce09d701-7b93-4150-defb-51825e05ade9", - "type": "choice", - "text": "How often do you need someone to take you to the doctor if you needed it?", - "required": false, - "answerOption": [ - { - "valueCoding": { - "id": "3d6fe1b8-c64b-497c-8583-db7ddda9e94e", - "code": "1", - "system": "urn:uuid:e9ecdd47-2e8b-49b3-8780-9d0769a246aa", - "display": "None of the time" - } - }, - { - "valueCoding": { - "id": "b4081e9d-d0f1-4aea-9a15-eac4a15d1d10", - "code": "2", - "system": "urn:uuid:e9ecdd47-2e8b-49b3-8780-9d0769a246aa", - "display": "A little of the time" - } - }, - { - "valueCoding": { - "id": "e32f7952-e280-48d7-9746-c13dbb26638f", - "code": "3", - "system": "urn:uuid:e9ecdd47-2e8b-49b3-8780-9d0769a246aa", - "display": "Some of the time" - } - }, - { - "valueCoding": { - "id": "d2f6172d-9402-4cb3-870a-584a7be3a5d7", - "code": "4", - "system": "urn:uuid:e9ecdd47-2e8b-49b3-8780-9d0769a246aa", - "display": "Most of the time" - } - }, - { - "valueCoding": { - "id": "ec48001e-f03e-4a14-8a7a-9fcf34fa81d2", - "code": "5", - "system": "urn:uuid:e9ecdd47-2e8b-49b3-8780-9d0769a246aa", - "display": "All of the time" - } - } - ] - }, - { - "linkId": "58e97564-5f4d-4d4b-86d5-6429cbbc7a8e", - "type": "choice", - "text": "How often do you need someone to prepare your meals if you were unable to do it yourself?", - "required": false, - "answerOption": [ - { - "valueCoding": { - "id": "3d6fe1b8-c64b-497c-8583-db7ddda9e94e", - "code": "1", - "system": "urn:uuid:e9ecdd47-2e8b-49b3-8780-9d0769a246aa", - "display": "None of the time" - } - }, - { - "valueCoding": { - "id": "b4081e9d-d0f1-4aea-9a15-eac4a15d1d10", - "code": "2", - "system": "urn:uuid:e9ecdd47-2e8b-49b3-8780-9d0769a246aa", - "display": "A little of the time" - } - }, - { - "valueCoding": { - "id": "e32f7952-e280-48d7-9746-c13dbb26638f", - "code": "3", - "system": "urn:uuid:e9ecdd47-2e8b-49b3-8780-9d0769a246aa", - "display": "Some of the time" - } - }, - { - "valueCoding": { - "id": "d2f6172d-9402-4cb3-870a-584a7be3a5d7", - "code": "4", - "system": "urn:uuid:e9ecdd47-2e8b-49b3-8780-9d0769a246aa", - "display": "Most of the time" - } - }, - { - "valueCoding": { - "id": "ec48001e-f03e-4a14-8a7a-9fcf34fa81d2", - "code": "5", - "system": "urn:uuid:e9ecdd47-2e8b-49b3-8780-9d0769a246aa", - "display": "All of the time" - } - } - ] - }, - { - "linkId": "ad161c49-e8a6-4d31-90e8-02b2887a765f", - "type": "choice", - "text": "How often do you need someone to help with daily chores if you were sick", - "required": false, - "answerOption": [ - { - "valueCoding": { - "id": "3d6fe1b8-c64b-497c-8583-db7ddda9e94e", - "code": "1", - "system": "urn:uuid:e9ecdd47-2e8b-49b3-8780-9d0769a246aa", - "display": "None of the time" - } - }, - { - "valueCoding": { - "id": "b4081e9d-d0f1-4aea-9a15-eac4a15d1d10", - "code": "2", - "system": "urn:uuid:e9ecdd47-2e8b-49b3-8780-9d0769a246aa", - "display": "A little of the time" - } - }, - { - "valueCoding": { - "id": "e32f7952-e280-48d7-9746-c13dbb26638f", - "code": "3", - "system": "urn:uuid:e9ecdd47-2e8b-49b3-8780-9d0769a246aa", - "display": "Some of the time" - } - }, - { - "valueCoding": { - "id": "d2f6172d-9402-4cb3-870a-584a7be3a5d7", - "code": "4", - "system": "urn:uuid:e9ecdd47-2e8b-49b3-8780-9d0769a246aa", - "display": "Most of the time" - } - }, - { - "valueCoding": { - "id": "ec48001e-f03e-4a14-8a7a-9fcf34fa81d2", - "code": "5", - "system": "urn:uuid:e9ecdd47-2e8b-49b3-8780-9d0769a246aa", - "display": "All of the time" - } - } - ] - }, - { - "linkId": "ba518851-2843-4bbd-c0f7-5b5692d542e0", - "type": "integer", - "text": "What is your age?", - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/minValue", - "valueInteger": 18 - }, - { - "url": "http://hl7.org/fhir/StructureDefinition/maxValue", - "valueInteger": 120 - }, - { - "url": "http://biodesign.stanford.edu/fhir/StructureDefinition/validationtext", - "valueString": "Please enter a valid age." - } - ], - "required": false - }, - { - "linkId": "695525f3-3e89-4455-8e25-878171c596da", - "type": "choice", - "text": "What is your preferred contact method?", - "required": false, - "answerOption": [ - { - "valueCoding": { - "id": "b7a3d7a5-52b9-49b1-8b59-7a3885483f1c", - "code": "phone-call", - "system": "urn:uuid:736ac230-812a-4f4a-edec-5156910fb6ec", - "display": "Phone call" - } - }, - { - "valueCoding": { - "id": "3d42dde0-8e60-4832-bd46-bd06de28cbf2", - "code": "text-message", - "system": "urn:uuid:736ac230-812a-4f4a-edec-5156910fb6ec", - "display": "Text message" - } - }, - { - "valueCoding": { - "id": "e672cfc6-118f-4a2d-aafd-02722ff876b9", - "code": "e-mail", - "system": "urn:uuid:736ac230-812a-4f4a-edec-5156910fb6ec", - "display": "E-mail" - } - } - ] - }, - { - "linkId": "c3bea33d-4c50-4f4a-8ae4-1a52be326b19", - "type": "string", - "text": "What is your phone number? Ex. (555) 555-5555", - "required": false, - "enableWhen": [ - { - "question": "695525f3-3e89-4455-8e25-878171c596da", - "operator": "=", - "answerCoding": { - "system": "urn:uuid:736ac230-812a-4f4a-edec-5156910fb6ec", - "code": "phone-call" - } - } - ], - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/regex", - "valueString": "^(\\([0-9]{3}\\) |[0-9]{3}-)[0-9]{3}-[0-9]{4}$" - }, - { - "url": "http://biodesign.stanford.edu/fhir/StructureDefinition/validationtext", - "valueString": "Please enter a valid phone number." - } - ] - }, - { - "linkId": "8e906a39-5fd0-42a8-f42c-bd96d719dd13", - "type": "string", - "text": "What is your text number? Ex. (555) 555-5555", - "required": false, - "enableWhen": [ - { - "question": "695525f3-3e89-4455-8e25-878171c596da", - "operator": "=", - "answerCoding": { - "system": "urn:uuid:736ac230-812a-4f4a-edec-5156910fb6ec", - "code": "text-message" - } - } - ], - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/regex", - "valueString": "^(\\([0-9]{3}\\) |[0-9]{3}-)[0-9]{3}-[0-9]{4}$" - }, - { - "url": "http://biodesign.stanford.edu/fhir/StructureDefinition/validationtext", - "valueString": "Please enter a valid phone number." - } - ] - }, - { - "linkId": "86290b0a-017e-4193-8707-dc0c2146f0eb", - "type": "string", - "text": "What is your e-mail?", - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/regex", - "valueString": ".*@.+" - }, - { - "url": "http://biodesign.stanford.edu/fhir/StructureDefinition/validationtext", - "valueString": "Please enter a valid email" - }, - { - "url": "http://hl7.org/fhir/StructureDefinition/minLength", - "valueInteger": 1 - } - ], - "required": false, - "maxLength": 50, - "enableWhen": [ - { - "question": "695525f3-3e89-4455-8e25-878171c596da", - "operator": "=", - "answerCoding": { - "system": "urn:uuid:736ac230-812a-4f4a-edec-5156910fb6ec", - "code": "e-mail" - } - } - ] - }, - { - "linkId": "305f5381-2d8b-4b98-bc04-5a39bee2f7ec", - "type": "display", - "text": "Thank you for taking the survey!", - "required": false - } - ] -} diff --git a/Behavior/Schedule/BehaviorScheduler.swift b/Behavior/Schedule/BehaviorScheduler.swift index 63c3fc3..63a28ea 100644 --- a/Behavior/Schedule/BehaviorScheduler.swift +++ b/Behavior/Schedule/BehaviorScheduler.swift @@ -28,17 +28,20 @@ extension BehaviorScheduler { // For the normal app usage, we schedule the task for every day at 8:00 AM dateComponents = DateComponents(hour: 8, minute: 0) } - + + // Replaced the localized titles/descriptions for prev questionnaire to the new questionnaire. + // Scheduling is kept the same for now. + // Path for JSON of modified questionnaire is now inputted. return Task( - title: String(localized: "TASK_SOCIAL_SUPPORT_QUESTIONNAIRE_TITLE"), - description: String(localized: "TASK_SOCIAL_SUPPORT_QUESTIONNAIRE_DESCRIPTION"), + title: String(localized: "EMOTION_QUESTIONNAIRE_TITLE"), + description: String(localized: "EMOTION_QUESTIONNAIRE_DESCRIPTION"), schedule: Schedule( start: Calendar.current.startOfDay(for: Date()), repetition: .matching(dateComponents), end: .numberOfEvents(365) ), notifications: true, - context: BehaviorTaskContext.questionnaire(Bundle.main.questionnaire(withName: "SocialSupportQuestionnaire")) + context: BehaviorTaskContext.questionnaire(Bundle.main.questionnaire(withName: "EmotionQuestionnaire")) ) }