addStudyProtocol method

Future<Study> addStudyProtocol(
  1. StudyProtocol protocol
)

Create and add a study based on the protocol which needs to be executed on this client.

This is similar to the addStudy method, but the protocol is deployed immediately.

Returns the newly added study.

Implementation

Future<Study> addStudyProtocol(StudyProtocol protocol) async {
  assert(deploymentService != null,
      'Deployment Service has not been configured. Call configure() first.');

  final status = await deploymentService!.createStudyDeployment(protocol);
  return await addStudy(
    status.studyDeploymentId,
    status.primaryDeviceStatus!.device.roleName,
  );
}