createStudyDeployment method
Future<StudyDeploymentStatus>
createStudyDeployment(
- StudyProtocol protocol, [
- String? studyDeploymentId
override
Create a new StudyDeployment
based on a StudyProtocol
.
studyDeploymentId
specifies the study deployment id.
If not specified, an UUID v1 id is generated.
Implementation
@override
Future<StudyDeploymentStatus> createStudyDeployment(
StudyProtocol protocol, [
String? studyDeploymentId,
]) async {
assert(protocol is SmartphoneStudyProtocol,
"$runtimeType only supports the deployment of protocols of type 'SmartphoneStudyProtocol'");
StudyDeployment deployment = StudyDeployment(protocol, studyDeploymentId);
_repository[deployment.studyDeploymentId] = deployment;
// make sure to register this phone as a master device
deployment.registerDevice(thisPhone, DeviceRegistration());
// set the deployment status to "invited" as the initial status.
deployment.status.status = StudyDeploymentStatusTypes.Invited;
return deployment.status;
}