StudyDeployment
A single instantiation of a StudyProtocol, taking care of common concerns related to devices when 'running' a study.
I.e., a StudyDeployment is responsible for registering the physical devices described in the StudyProtocol, building the PrimaryDeviceDeployment for each primary device, and tracking device registration and deployment status. Connection monitoring and data-quality assessment (part of the Kotlin CARP Core) are not implemented here. It lives on the deployment side, i.e. in a DeploymentService implementation; a client only sees its status and the PrimaryDeviceDeployment it creates.
Key points:
- Lifecycle: registerDevice -> getDeviceDeploymentFor -> deviceDeployed -> stop, reflected in StudyDeploymentStatus.status (see StudyDeploymentStatusTypes).
- getDeviceDeploymentFor asserts (in debug mode) that the device is part of the protocol and registered, and marks all registered devices as deployed.
- This Dart version is simpler than the Kotlin one; e.g., it does not check that all devices are ready before running.
Constructors
StudyDeployment
- StudyProtocol protocol, [
- String? studyDeploymentId
Create a new StudyDeployment based on a StudyProtocol. studyDeploymentId specifies the study deployment id. If not specified, a UUID v4 id is generated.
Properties
creationDate
deployedDevices
The set of devices (role names) which have been deployed correctly.
deviceRegistrationHistory
Per device, a list of all device registrations (included old registrations) in the order they were registered.
invalidatedDeployedDevices
isStopped
Whether stop has been called. This is only a flag: later calls can still modify the deployment.
protocol
registeredDevices
The set of devices which are currently registered for this study deployment.
requiredDataStreams
All the data streams which are required to run this study deployment.
startTime
The time when the study deployment was ready for the first time (all devices deployed); null otherwise.
status
Get the status of this StudyDeployment, with the current status of all primary and connected devices.
studyDeploymentId
Methods
deviceDeployed
- PrimaryDeviceConfiguration<
DeviceRegistration> device, - DateTime deviceDeploymentLastUpdateDate
Indicate that the specified primary device was deployed successfully using the deployment with the specified deviceDeploymentLastUpdateDate.
Sets the status to StudyDeploymentStatusTypes.Running and startTime to deviceDeploymentLastUpdateDate.
getDeviceDeploymentFor
Get the deployment configuration for the specified primary device in this study deployment.
The device must be part of the protocol and registered. Marks all registered devices as deployed and sets the status to StudyDeploymentStatusTypes.Running. The returned deployment holds the tasks of device and all connected devices, and all triggers and task controls of the protocol.
getDeviceStatus
Get the status of a device in this StudyDeployment.
registerDevice
- DeviceConfiguration<
DeviceRegistration> device, - DeviceRegistration registration
Register the specified device for this deployment using the registration options.
Moves the status from StudyDeploymentStatusTypes.Invited to StudyDeploymentStatusTypes.DeployingDevices. A new registration replaces the current one and is added to deviceRegistrationHistory.
stop
Mark this study deployment as stopped; no more data should be collected. This does not block further changes to the deployment.
unregisterDevice
Remove the current device registration for the device in this deployment.