ORKConsentDocument Class Reference
ORKConsentDocument class represents the content of an informed consent
document, which is a document that’s used to obtain informed consent from participants
in a medical or other research study. The ResearchKit framework uses an
to provide content for visual consent steps (
ORKVisualConsentStep) and for consent review steps (
sections of an
ORKConsentDocument object are instances of
ORKConsentDocument object is attached to an visual consent step, these
sections provide the content for the visual consent screens, and for the
Learn More pages that are accessible from them. When attached to an consent review step,
the sections can provide the content for the consent document to
If the consent document is simple, each section may be able to map to a visual consent screen. And in some cases, the formatting of the consent document may
be sufficiently simple that it can be presented using only section headers and
simple formatting. If your consent document uses simple formatting, you might be able to generate a document to sign by specifying the sections and the signatures.
In a case like this, you don’t need to provide a value for the
and when the consent review step is completed, the signatures can be
placed into a copy of the document and a PDF can be generated.
In more complex cases, the visual consent sections may bear little
relation to the formal consent document. In a situation like this, place the formal consent
document content in the
htmlReviewContent property. Doing this overrides all content that would otherwise be generated from the consent
The document should be in the user’s language, and all the content of the document should be appropriately localized.
The document’s title in a localized string.
@property (nonatomic, copy, nullable) NSString *title
The title appears only in the generated PDF for review; it is not used in the visual consent process.
Visual consent sections
The sections to be in printed in the PDF file and or presented in the visual consent sequence.
@property (nonatomic, copy, nullable) NSArray<ORKConsentSection*> *sections
All sections appear in the animated process, except for those sections of the
htmlReviewContent property is not set, this content is also used to
populate the document for review in the consent review step.
The PDF file contains all sections.
Signatures for consent review
The title to be rendered on the signature page of the generated PDF in a localized string.
@property (nonatomic, copy, nullable) NSString *signaturePageTitle
The content to be rendered below the title on the signature page of the generated PDF in a localized string.
@property (nonatomic, copy, nullable) NSString *signaturePageContent
The content is ignored for visual consent. The content is also ignored if you supply a value for the
The set of signatures that are required or prepopulated in the document.
@property (nonatomic, copy, nullable) NSArray<ORKConsentSignature*> *signatures
To add a signature to the document after consent review, the
needs to be modified to incorporate the new signature content prior to PDF
generation. For more information, see
Alternative content provision
Override HTML content for review.
@property (nonatomic, copy, nullable) NSString *htmlReviewContent
Initializer with ORKHTMLPDFWriter parameter. Allows for injecting mock dependency for the purposes of isolated unit testing.
- (instancetype)initWithHTMLPDFWriter:(ORKHTMLPDFWriter *)writer consentSectionFormatter:(ORKConsentSectionFormatter *)sectionFormatter consentSignatureFormatter:(ORKConsentSignatureFormatter *)signatureFormatter
The instance of the ORKHTMLPDFWriter upon which the class depends.
An instance of ORKConsentSectionFormatter
An instance of ORKConsentSignatureFormatter
Writes the document’s content into a PDF file.
- (void)makePDFWithCompletionHandler:(void ( ^ ) ( NSData *_Nullable PDFData , NSError *_Nullable error ))handler
The handler block for generated PDF data. When successful, the returned data represents a complete PDF document that represents the consent.
The PDF is generated in a form suitable for printing. This is done asynchronously, so the PDF data is returned through a completion block.