SmartphoneDeployment class
Everything a smartphone needs to run its part of a study deployment.
A deployment is the protocol made concrete for one primary device: its
devices, tasks, triggers, and task controls, plus the CAMS fields from
SmartphoneProtocolExtension (study description, data endpoint, privacy
schema). It is created by the deployment service, e.g.
SmartphoneDeploymentService or CAWS, and stored in
SmartphoneStudy.deployment.
Key points:
- deployed and status track the deployment on this phone.
- measures lists all measures of all tasks.
- Serializable, and can read deployments from CAMS 1.x.
See also SmartphoneDeploymentExecutor, which runs it.
- Inheritance
-
- Object
- PrimaryDeviceDeployment
- SmartphoneDeployment
- Mixed-in types
- Annotations
-
- @JsonSerializable.new(includeIfNull: false, explicitToJson: true)
Constructors
-
SmartphoneDeployment({String? studyId, String? studyDeploymentId, required PrimaryDeviceConfiguration<
DeviceRegistration> deviceConfiguration, required DeviceRegistration registration, Set<DeviceConfiguration< connectedDevices = const {}, Map<DeviceRegistration> >String, DeviceRegistration?> connectedDeviceRegistrations = const {}, Set<TaskConfiguration> tasks = const {}, Map<String, TriggerConfiguration> triggers = const {}, Set<TaskControl> taskControls = const {}, Set<ExpectedParticipantData> expectedParticipantData = const {}, StudyDescription? studyDescription, DataEndPoint? dataEndPoint, String? privacySchemaName}) - Creates a new SmartphoneDeployment.
-
SmartphoneDeployment.fromJson(Map<
String, dynamic> json) -
factory
- SmartphoneDeployment.fromPrimaryDeviceDeployment({String? studyId, String? studyDeploymentId, required PrimaryDeviceDeployment deployment})
-
Creates a SmartphoneDeployment from a carp_core
PrimaryDeviceDeployment. - SmartphoneDeployment.fromPrimaryDeviceDeploymentAndSmartphoneStudyProtocol({String? studyId, String? studyDeploymentId, required PrimaryDeviceDeployment deployment, required SmartphoneStudyProtocol protocol})
-
Creates a SmartphoneDeployment that combines a
PrimaryDeviceDeploymentand a SmartphoneStudyProtocol. - SmartphoneDeployment.fromSmartphoneStudyProtocol({String? studyId, String? studyDeploymentId, required String primaryDeviceRoleName, required SmartphoneStudyProtocol protocol})
- Creates a SmartphoneDeployment based on a SmartphoneStudyProtocol.
Properties
-
applicationData
↔ Map<
String, dynamic> ? -
The SmartphoneApplicationData as JSON.
getter/setter pairinherited
- applicationName → String?
-
The name of the application which will execute this protocol.
no setterinherited
-
connectedDeviceRegistrations
↔ Map<
String, DeviceRegistration?> -
Preregistration of connected devices, including information such as
connection properties, stored per role name.
getter/setter pairinherited
-
connectedDevices
↔ Set<
DeviceConfiguration< DeviceRegistration> > -
The devices this device needs to connect to.
getter/setter pairinherited
- dataEndPoint ↔ DataEndPoint?
-
Where and how to store or upload the data collected in this study.
getter/setter pairinherited
- deployed ↔ DateTime
-
The timestamp (in UTC) when this deployment was deployed on this smartphone.
getter/setter pair
- description → String
-
The description from studyDescription, or an empty string if none.
no setterinherited
-
deviceConfiguration
↔ PrimaryDeviceConfiguration<
DeviceRegistration> -
The configuration for the primary device this deployment is intended for.
getter/setter pairinherited
- deviceRoleName → String
-
The role name of this smartphone device.
no setter
-
devices
→ Set<
DeviceConfiguration< DeviceRegistration> > -
All devices this deployment is using.
no setter
-
expectedDataStreams
→ Set<
ExpectedDataStream> -
The set of expected data streams from this device deployment.
no setterinherited
-
expectedParticipantData
↔ Set<
ExpectedParticipantData> -
Expected data about participants in the deployment to be input by users.
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- lastUpdatedOn → DateTime
-
The time when this device deployment was last updated.
This corresponds to the most recent device registration as part of this
device deployment.
no setterinherited
-
measures
→ List<
Measure> -
All measures of all tasks in this deployment.
no setter
- onUpdated ↔ void Function()?
-
Called by
hasBeenUpdated. Set by theStudyholding this deployment.getter/setter pairinherited - privacySchemaName ↔ String?
-
The name of a PrivacySchema to be used for protecting sensitive data.
getter/setter pairinherited
- protocolApiLevel → String?
-
The API level used by this study protocol.
no setterinherited
- protocolVersionTag → String?
-
The version tag of the study protocol snapshot.
no setterinherited
- registration ↔ DeviceRegistration
-
Registration for this primary device.
getter/setter pairinherited
- responsible → StudyResponsible?
-
The PI responsible for this protocol, taken from studyDescription.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status ↔ StudyDeploymentStatusTypes
-
The status of this study deployment. Default is
StudyDeploymentStatusTypes.Invited.getter/setter pair - studyDeploymentId → String
-
The unique id of this study deployment.
no setter
- studyDescription ↔ StudyDescription?
-
The description of this study protocol containing the title, description,
purpose, and the responsible researcher for this study.
getter/setter pairinherited
- studyId ↔ String?
-
The unique id of the study that this deployment is part of.
getter/setter pair
-
taskControls
↔ Set<
TaskControl> -
The specification of tasks triggered and the devices they are sent to.
getter/setter pairinherited
-
tasks
↔ Set<
TaskConfiguration> -
All tasks which should be able to be executed on this or connected devices.
getter/setter pairinherited
-
triggers
↔ Map<
String, TriggerConfiguration> -
All triggers originating from this device and connected devices, stored
per assigned id unique within the study protocol.
getter/setter pairinherited
Methods
-
addApplicationData(
String key, dynamic value) → void -
Adds app-specific
valueunderkey.inherited -
getApplicationData(
String key) → dynamic -
The app-specific value stored under
key, ornullif none.inherited -
getDeviceFromRoleName(
String roleName) → DeviceConfiguration< DeviceRegistration> ? -
The primary or connected device with
roleName, ornullif not found. -
getTaskByName(
String name) → TaskConfiguration? -
Get the task based on its task name in this deployment; null if not found.
inherited
-
hasBeenUpdated(
) → void -
Tell the
Studyholding this deployment that it has been updated.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeApplicationData(
String key) → void -
inherited
-
toJson(
) → Map< String, dynamic> -
override
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited