-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConsentTask.swift
More file actions
38 lines (30 loc) · 1.3 KB
/
ConsentTask.swift
File metadata and controls
38 lines (30 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//
// ConsentTask.swift
// PfIReConsent
//
// Created by Karlin, Daniel on 10/12/17.
// Copyright © 2017 PfIRe. All rights reserved.
//
import Foundation
import ResearchKit
public var ConsentTask: ORKOrderedTask {
var steps = [ORKStep]()
// VisualConsentStep
let consentDocument = ConsentDocument
let visualConsentStep = ORKVisualConsentStep(identifier: "VisualConsentStep", document: consentDocument)
steps += [visualConsentStep]
// TODO If needed: Add ConsentSharingStep
//ConsentReviewStep
let signature = consentDocument.signatures!.first as! ORKConsentSignature
let reviewConsentStep = ORKConsentReviewStep(identifier: "ConsentReviewStep", signature: signature, in: consentDocument)
reviewConsentStep.text = "Please type your name."
reviewConsentStep.reasonForConsent = Constants.Studies[Constants.LiveStudy].SigConsentText
steps += [reviewConsentStep]
// Completion Step
let completionStep = ORKCompletionStep(identifier: "CompletionStep")
completionStep.title = NSLocalizedString("Welcome aboard!", comment: "")
completionStep.text = NSLocalizedString("Thank you for joining this study.", comment: "")
steps += [completionStep]
// End of steps
return ORKOrderedTask(identifier: "ConsentTask", steps: steps)
}