{"action":"created","issue":{"url":"https://api.github.com/repos/ResearchKit/ResearchKit/issues/531","repository_url":"https://api.github.com/repos/ResearchKit/ResearchKit","labels_url":"https://api.github.com/repos/ResearchKit/ResearchKit/issues/531/labels{/name}","comments_url":"https://api.github.com/repos/ResearchKit/ResearchKit/issues/531/comments","events_url":"https://api.github.com/repos/ResearchKit/ResearchKit/issues/531/events","html_url":"https://github.com/ResearchKit/ResearchKit/issues/531","id":111533465,"number":531,"title":"ORKNavigationRule accepting a closure as an alternative to ORKResultPredicate","user":{"login":"md0u80c9","id":3925834,"avatar_url":"https://avatars.githubusercontent.com/u/3925834?v=3","gravatar_id":"","url":"https://api.github.com/users/md0u80c9","html_url":"https://github.com/md0u80c9","followers_url":"https://api.github.com/users/md0u80c9/followers","following_url":"https://api.github.com/users/md0u80c9/following{/other_user}","gists_url":"https://api.github.com/users/md0u80c9/gists{/gist_id}","starred_url":"https://api.github.com/users/md0u80c9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/md0u80c9/subscriptions","organizations_url":"https://api.github.com/users/md0u80c9/orgs","repos_url":"https://api.github.com/users/md0u80c9/repos","events_url":"https://api.github.com/users/md0u80c9/events{/privacy}","received_events_url":"https://api.github.com/users/md0u80c9/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-10-15T02:37:49Z","updated_at":"2016-03-16T18:30:50Z","closed_at":null,"body":"The proposal would be to extend ORKPredicateStepNavigationRule to take a closure as an alternative to ORKResultPredicate.\r\n\r\nExample case: your study may contain multiple surveys/forms. Or you may have data from other areas (HealthKit being the obvious example).\r\n\r\nYour application could then have significantly better logic from external variables, without having to resort to subclassing.\r\n\r\nIn my application example, we have some data stored in Core Data (demographics) - if the data is already present (because they have entered data from an earlier survey) we won't want to ask it in any subsequent survey. If it's not present we will ask it and then as part of our result parser put the data into Core Data.\r\n\r\nIf your application picked up an anomaly on HealthKit that might lead to a change in your survey questions (eg. diabetic has an abnormal blood sugar result from HealthKit you may want to ask extra dietary intake questions).\r\n\r\nThe closure would either return a boolean state: true ( go to the specified destination), or false. It could alternatively conceivably return a String state (destinationStepIdentifier), allowing effectively a switch-type predicate."},"comment":{"url":"https://api.github.com/repos/ResearchKit/ResearchKit/issues/comments/197475096","html_url":"https://github.com/ResearchKit/ResearchKit/issues/531#issuecomment-197475096","issue_url":"https://api.github.com/repos/ResearchKit/ResearchKit/issues/531","id":197475096,"user":{"login":"YuanZhu-apple","id":11466704,"avatar_url":"https://avatars.githubusercontent.com/u/11466704?v=3","gravatar_id":"","url":"https://api.github.com/users/YuanZhu-apple","html_url":"https://github.com/YuanZhu-apple","followers_url":"https://api.github.com/users/YuanZhu-apple/followers","following_url":"https://api.github.com/users/YuanZhu-apple/following{/other_user}","gists_url":"https://api.github.com/users/YuanZhu-apple/gists{/gist_id}","starred_url":"https://api.github.com/users/YuanZhu-apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YuanZhu-apple/subscriptions","organizations_url":"https://api.github.com/users/YuanZhu-apple/orgs","repos_url":"https://api.github.com/users/YuanZhu-apple/repos","events_url":"https://api.github.com/users/YuanZhu-apple/events{/privacy}","received_events_url":"https://api.github.com/users/YuanZhu-apple/received_events","type":"User","site_admin":false},"created_at":"2016-03-16T18:30:50Z","updated_at":"2016-03-16T18:30:50Z","body":"So the fact is that ORKNavigationRule can accept a closure now, but cannot be serialized(Nothing we can do about it). \r\n\r\n@md0u80c9 is this issue can be closed? "}}