Skip to contents

The CohortReference class, encapsulating the id, name and descritpion fields that refernces a cohort definition.

Value

A CohortReference R6 object that stores the cohort id, display name, and optional description used to reference a target, outcome, or subgroup cohort.

Details

This class is used to reference a cohort definition by ID, while providing a way to substitute a name for this specific reference.

Note, when serializing with a library such as jsonlite, first call toList() on the R6 class before calling jsonlite::toJSON().

Active bindings

id

the cohort id being referenced

name

the name for the cohort to be used in this reference.

description

A description for this Cohort Reference.

Methods


CohortReference$new()

creates a new instance, using the provided data param if provided.

Usage

CohortReference$new(data = list())

Arguments

data

the data (as a json string or list) to initialize with

Returns

A new CohortReference object initialized from a list or JSON string.


CohortReference$toList()

returns the R6 class elements as a list for use in jsonlite::toJSON()

Usage

CohortReference$toList()

Returns

A named list with id, name, and description fields.


CohortReference$asJSON()

returns the JSON string for this R6 class

Usage

CohortReference$asJSON()

Returns

A JSON string representation of the CohortReference object.


CohortReference$clone()

The objects of this class are cloneable with this method.

Usage

CohortReference$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.