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

Predicates #771

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions ResearchKit.xcodeproj/project.pbxproj
Expand Up @@ -433,6 +433,7 @@
86CC8EBA1AC09383001CCD89 /* ORKResultTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 86CC8EAF1AC09383001CCD89 /* ORKResultTests.m */; };
86CC8EBB1AC09383001CCD89 /* ORKTextChoiceCellGroupTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 86CC8EB01AC09383001CCD89 /* ORKTextChoiceCellGroupTests.m */; };
86D348021AC161B0006DB02B /* ORKRecorderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 86D348001AC16175006DB02B /* ORKRecorderTests.m */; };
A29676981D4C172400CD4FC5 /* ORKResultPredicate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A29676971D4C172400CD4FC5 /* ORKResultPredicate.swift */; };
B11C54991A9EEF8800265E61 /* ORKConsentSharingStep.h in Headers */ = {isa = PBXBuildFile; fileRef = B11C54961A9EEF8800265E61 /* ORKConsentSharingStep.h */; settings = {ATTRIBUTES = (Public, ); }; };
B11C549B1A9EEF8800265E61 /* ORKConsentSharingStep.m in Sources */ = {isa = PBXBuildFile; fileRef = B11C54971A9EEF8800265E61 /* ORKConsentSharingStep.m */; };
B11C549F1A9EF4A700265E61 /* ORKConsentSharingStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = B11C549C1A9EF4A700265E61 /* ORKConsentSharingStepViewController.h */; settings = {ATTRIBUTES = (Private, ); }; };
Expand Down Expand Up @@ -984,6 +985,7 @@
86CC8EAF1AC09383001CCD89 /* ORKResultTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKResultTests.m; sourceTree = "<group>"; };
86CC8EB01AC09383001CCD89 /* ORKTextChoiceCellGroupTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTextChoiceCellGroupTests.m; sourceTree = "<group>"; };
86D348001AC16175006DB02B /* ORKRecorderTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ORKRecorderTests.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
A29676971D4C172400CD4FC5 /* ORKResultPredicate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ORKResultPredicate.swift; sourceTree = "<group>"; };
B11C54961A9EEF8800265E61 /* ORKConsentSharingStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKConsentSharingStep.h; sourceTree = "<group>"; };
B11C54971A9EEF8800265E61 /* ORKConsentSharingStep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKConsentSharingStep.m; sourceTree = "<group>"; };
B11C549C1A9EF4A700265E61 /* ORKConsentSharingStepViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKConsentSharingStepViewController.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1759,6 +1761,7 @@
86C40BA81A8D7C5C00081FAC /* ORKResult.m */,
86C40BA91A8D7C5C00081FAC /* ORKResult_Private.h */,
BC13CE3F1B0666FD0044153C /* ORKResultPredicate.h */,
A29676971D4C172400CD4FC5 /* ORKResultPredicate.swift */,
BCFF24BC1B0798D10044EC35 /* ORKResultPredicate.m */,
);
name = Result;
Expand Down Expand Up @@ -3085,6 +3088,7 @@
861D2AE91B840991008C4CD0 /* ORKTimedWalkStep.m in Sources */,
86C40D661A8D7C5C00081FAC /* ORKQuestionStepViewController.m in Sources */,
86C40DF41A8D7C5C00081FAC /* ORKConsentReviewController.m in Sources */,
A29676981D4C172400CD4FC5 /* ORKResultPredicate.swift in Sources */,
242C9E121BBE06DE0088B7F4 /* ORKVerificationStepView.m in Sources */,
2489F7B01D65214D008DEF20 /* ORKVideoCaptureCameraPreviewView.m in Sources */,
147503BA1AEE807C004B17F3 /* ORKToneAudiometryStep.m in Sources */,
Expand Down
7 changes: 5 additions & 2 deletions ResearchKit/Common/ORKOrderedTask.m
Expand Up @@ -1914,9 +1914,12 @@ + (ORKNavigableOrderedTask *)tremorTestTaskWithIdentifier:(NSString *)identifier
// Setup rules for skipping all the steps in either the left or right hand if called upon to do so.
ORKResultSelector *resultSelector = [ORKResultSelector selectorWithStepIdentifier:ORKActiveTaskSkipHandStepIdentifier
resultIdentifier:ORKActiveTaskSkipHandStepIdentifier];
NSPredicate *predicateRight = [ORKResultPredicate predicateForChoiceQuestionResultWithResultSelector:resultSelector expectedAnswerValue:ORKActiveTaskRightHandIdentifier];
NSPredicate *predicateLeft = [ORKResultPredicate predicateForChoiceQuestionResultWithResultSelector:resultSelector expectedAnswerValue:ORKActiveTaskLeftHandIdentifier];

NSPredicate *predicateRight = [[NSPredicate alloc] initWithChoiceQuestionResultWithResultSelector:resultSelector
expectedAnswerValue:ORKActiveTaskRightHandIdentifier];
NSPredicate *predicateLeft = [[NSPredicate alloc] initWithChoiceQuestionResultWithResultSelector:resultSelector
expectedAnswerValue:ORKActiveTaskLeftHandIdentifier];

// Setup rule for skipping first hand
NSString *secondHandIdentifier = firstIsLeft ? [[rightSteps firstObject] identifier] : [[leftSteps firstObject] identifier];
NSPredicate *firstPredicate = firstIsLeft ? predicateLeft : predicateRight;
Expand Down