StudyProtocol class

A description of how a study is to be executed, defining the type(s) of master device(s) (MasterDeviceDescriptor) responsible for aggregating data, the optional devices (DeviceDescriptor) connected to them, and the Triggers which lead to data collection on said devices.

This is part of the carp.protocols domain model.

Annotations

Constructors

StudyProtocol({String ownerId, String name, String description})
Create a new StudyProtocol.
StudyProtocol.fromJson(Map<String, dynamic> json)
factory

Properties

connectedDevices List<DeviceDescriptor>
The devices this device needs to connect to.
read / write
connections List<DeviceConnection>
read / write
creationDate DateTime
The timestamp of the creation of this protocol in Zulu time.
read / write
description String
A longer description of this study.
read / write
expectedParticipantData List<Map<String, dynamic>>
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
masterDevices List<MasterDeviceDescriptor>
The master devices involved in this protocol.
read / write
name String
A unique descriptive name for the protocol assigned by the ProtocolOwner.
read / write
ownerId String
The owner id of this study protocol.
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
tasks Set<TaskDescriptor>
The set of tasks which can be triggered as part of this protocol.
read / write
triggeredTasks List<TriggeredTask>
The tasks (and the devices they are triggered to) for the specified trigger.
read / write
triggers Map<String, Trigger>
The set of Triggers which can trigger TaskDescriptors in this study protocol.
read / write

Methods

addConnectedDevice(DeviceDescriptor device) → void
Add a device which is connected to this masterDevice. Its role name should be unique in the protocol.
addMasterDevice(MasterDeviceDescriptor masterDevice) → void
Add a masterDevice which is responsible for aggregating and synchronizing incoming data. Its role name should be unique in the protocol.
addTask(TaskDescriptor task) → void
Add the task to this protocol.
addTrigger(Trigger trigger) → void
Add the trigger to this protocol.
addTriggeredTask(Trigger trigger, TaskDescriptor task, DeviceDescriptor targetDevice) → void
Add a task to be sent to a targetDevice once a trigger within this protocol is initiated. [...]
addTriggeredTasks(Trigger trigger, List<TaskDescriptor> tasks, DeviceDescriptor targetDevice) → void
Add a set of tasks to be sent to a targetDevice once a trigger within this protocol is initiated. In case the trigger or tasks are not yet included in this study protocol, they will be added. The targetDevice needs to be added prior to this call since it needs to be set up as either a master device or connected device.
getTasksForDevice(DeviceDescriptor device) Set<TaskDescriptor>
Gets all the tasks triggered for the specified device. The device must be part of either masterDevices or connectedDevices.
getTasksForDeviceRoleName(String deviceRoleName) Set<TaskDescriptor>
Gets all the tasks triggered for the specified deviceRoleName. [...]
getTriggeredTasks(Trigger trigger) Set<TriggeredTask>
Gets all the tasks (and the devices they are triggered to) for the specified trigger.
hasMasterDevice(String rolename) bool
Does this protocol have a master device with role name rolename?
indexOfTrigger(Trigger trigger) int
Returns the index of the trigger in the triggers. Returns -1 if not found.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
removeTask(TaskDescriptor task) → void
Remove the task currently present in this configuration including removing it from any Trigger's which initiate it.
toJson() Map<String, dynamic>
toString() String
A string representation of this object. [...]
override

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited

Constants

PROTOCOL_NAMESPACE → const String
'dk.cachet.carp.protocols.domain'