Recruitment

class Recruitment(studyId: UUID, id: UUID, createdOn: Instant) : AggregateRoot<Recruitment, RecruitmentSnapshot, Recruitment.Event>

Represents a set of participants recruited for a study identified by studyId.

Constructors

Link copied to clipboard
fun Recruitment(studyId: UUID, id: UUID = UUID.randomUUID(), createdOn: Instant = Clock.System.now())

Types

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

Functions

Link copied to clipboard
fun addParticipant(email: EmailAddress, id: UUID = UUID.randomUUID()): Participant

Add a Participant identified by the specified email address. In case the email was already added before, the same Participant is returned.

Link copied to clipboard
fun addParticipantGroup(participantIds: Set<UUID>, id: UUID = UUID.randomUUID()): StagedParticipantGroup

Create and add the participants identified by participantIds as a participant group.

Link copied to clipboard
fun consumeEvents(): List<Recruitment.Event>
Link copied to clipboard
fun createInvitations(group: Set<AssignedParticipantRoles>): Pair<StudyProtocolSnapshot, List<ParticipantInvitation>>

Attempt creating ParticipantInvitations for the specified participant group, or throw exception in case preconditions are violated.

Link copied to clipboard
fun getParticipantGroupStatus(studyDeploymentStatus: StudyDeploymentStatus): ParticipantGroupStatus

Get the ParticipantGroupStatus of the study deployment identified by studyDeploymentStatus.

Link copied to clipboard
fun getSnapshot(): RecruitmentSnapshot
Link copied to clipboard
fun getStatus(): RecruitmentStatus

Get the status (serializable) of this Recruitment.

Link copied to clipboard
fun lockInStudy(protocol: StudyProtocolSnapshot, invitation: StudyInvitation)

Lock in the protocol which participants in this recruitment can participate in, and the invitation which is sent to them once they are deployed.

Link copied to clipboard
fun wasLoadedFromSnapshot(snapshot: RecruitmentSnapshot)

Properties

Link copied to clipboard
val createdOn: Instant
Link copied to clipboard
var fromSnapshotVersion: Int?
Link copied to clipboard
val id: UUID
Link copied to clipboard
val participantGroups: Map<UUID, StagedParticipantGroup>

Per study deployment ID, the group of participants that participates in it.

Link copied to clipboard
val participants: Set<Participant>

The participants which are part of this Recruitment.

Link copied to clipboard
val studyId: UUID