Study

class Study(ownerId: UUID, name: String, description: String?, invitation: StudyInvitation, id: UUID, createdOn: Instant) : AggregateRoot<Study, StudySnapshot, Study.Event>

Represents a study which can be pilot tested and eventually 'go live', for which a recruitment goal can be set, and participants can be recruited.

Constructors

Link copied to clipboard
fun Study(ownerId: UUID, name: String, description: String? = null, invitation: StudyInvitation = StudyInvitation( name ), id: UUID = UUID.randomUUID(), createdOn: Instant = Clock.System.now())

Types

Link copied to clipboard
sealed class Event : DomainEvent
Link copied to clipboard
object Factory

Functions

Link copied to clipboard
fun consumeEvents(): List<Study.Event>
Link copied to clipboard
fun getSnapshot(): StudySnapshot
Link copied to clipboard
fun getStatus(): StudyStatus

Get the status (serializable) of this Study.

Link copied to clipboard
fun getStudyDetails(): StudyDetails

Get StudyDetails for this Study.

Link copied to clipboard
fun goLive()

Lock in the current study protocol so that the study may be deployed to participants.

Link copied to clipboard
fun wasLoadedFromSnapshot(snapshot: StudySnapshot)

Properties

Link copied to clipboard
val canDeployToParticipants: Boolean

Determines whether the study in its current state is ready to be deployed to participants.

Link copied to clipboard
val canSetInvitation: Boolean
Link copied to clipboard
val canSetStudyProtocol: Boolean
Link copied to clipboard
val createdOn: Instant
Link copied to clipboard
var description: String?

A description for the study, assigned by, and only visible to, the entity with ownerId.

Link copied to clipboard
var fromSnapshotVersion: Int?
Link copied to clipboard
val id: UUID
Link copied to clipboard
var invitation: StudyInvitation

A description of the study, shared with participants once they are invited to the study.

Link copied to clipboard
var isLive: Boolean = false

Determines whether a study protocol has been locked in and the study may be deployed to real participants.

Link copied to clipboard
var name: String

A descriptive name for the study, assigned by, and only visible to, the entity with ownerId.

Link copied to clipboard
val ownerId: UUID

The ID of the entity (e.g., person or group) that created this Study.

Link copied to clipboard
var protocolSnapshot: StudyProtocolSnapshot? = null

A snapshot of the protocol to use in this study, or null when not yet defined.