addStudy method

  1. @override
Future<StudyStatus> addStudy(
  1. Study study
)
override

Add a study which needs to be executed on this client. This involves registering this device for the specified study deployment.

  • studyDeploymentId - The ID of a study which has been deployed already and for which to collect data.
  • deviceRoleName - The role which the client device this runtime is intended for plays as part of the deployment identified by studyDeploymentId.

Returns the StudyStatus of the newly added study.

Implementation

@override
Future<StudyStatus> addStudy(Study study) async {
  StudyStatus status = await super.addStudy(study);
  info('Adding study to $runtimeType - $study');

  // always create a new controller
  final controller =
      SmartphoneDeploymentController(deploymentService!, deviceController);
  repository[study] = controller;

  await controller.initialize(
    study,
    registration!,
  );

  return status;
}