SmartphoneDeployment.fromPrimaryDeviceDeploymentAndSmartphoneStudyProtocol constructor

SmartphoneDeployment.fromPrimaryDeviceDeploymentAndSmartphoneStudyProtocol({
  1. String? studyId,
  2. String? studyDeploymentId,
  3. String? userId,
  4. required PrimaryDeviceDeployment deployment,
  5. required SmartphoneStudyProtocol protocol,
})

Create a SmartphoneDeployment that combines a PrimaryDeviceDeployment and a SmartphoneStudyProtocol.

It takes the deployment information from the deployment (such as device configuration, device registration, and what devices are connected) and takes the data collection configuration from the protocol (such as task, triggers, task controls, and expected participant data).

Implementation

SmartphoneDeployment.fromPrimaryDeviceDeploymentAndSmartphoneStudyProtocol({
  this.studyId,
  String? studyDeploymentId,
  this.userId,
  required PrimaryDeviceDeployment deployment,
  required SmartphoneStudyProtocol protocol,
}) : super(
        deviceConfiguration: deployment.deviceConfiguration,
        registration: deployment.registration,
        connectedDevices:
            protocol.connectedDevices ?? deployment.connectedDevices,
        connectedDeviceRegistrations: deployment.connectedDeviceRegistrations,
        tasks: protocol.tasks,
        triggers: protocol.triggers,
        taskControls: protocol.taskControls,
        expectedParticipantData: protocol.expectedParticipantData ??
            deployment.expectedParticipantData,
      ) {
  _studyDeploymentId = studyDeploymentId ?? const Uuid().v1();
  _data.studyDescription = protocol.studyDescription;
  _data.dataEndPoint = protocol.dataEndPoint;
  _data.privacySchemaName = protocol.privacySchemaName;
  _data.applicationData = protocol._data.applicationData;
}