domain library

This library hold the CAMS-specific extensions and implementation of the carp_core domain classes like SmartphoneStudyProtocol and PeriodicTrigger.

Also hold JSON logic to handle de/serialization of the domain objects.

In terms of Domain-Driven Design (DDD), "the domain layer is responsible for implementing the core business logic and rules of the system. It contains the domain model, which is a representation of the concepts and behaviors that are relevant to the problem domain. The domain model consists of entities, value objects, aggregates, services, events, and other elements that capture the essence and meaning of the domain." From Domain-Driven Design (DDD): A Guide to Building Scalable, High-Performance Systems by Roman Glushach.

Classes

AbstractDataManager
An abstract DataManager implementation useful for extension.
AppLifecycleTrigger
A trigger that triggers when the life cycle of an app changes.
AppTask
A task that notifies the app when it is triggered.
BLEDevice<TRegistration extends BLEDeviceRegistration>
A Bluetooth Low Energy (BLE) device configuration.
BLEDeviceRegistration
A DeviceRegistration for Bluetooth Low Energy (BLE) devices which can connect to the smartphone via BLE, e.g., a heart rate monitor or a BLE beacon.
BLEHeartRateDevice
A Bluetooth Low Energy (BLE) device which implements a GATT Heart Rate service (https://www.bluetooth.com/specifications/gatt/services/).
CamsDataTypeMetaData
Contains CAMS-specific meta data about a specific data type to be collected.
CamsDataTypes
Contains CAMS data type definitions similar to CARP Core CarpDataTypes.
CamsDevice<TRegistration extends DeviceRegistration>
Root class for all CAMS device configurations.
CamsDeviceRegistration
Root class for all CAMS device registrations.
CARPTransformerSchema
A default DataTransformerSchema for CARP no-operation transformers
CompletedAppTask
Data about a completed AppTask.
ConditionalPeriodicTrigger
A trigger that periodically checks if an application-specific triggering condition is met.
ConditionalSamplingEventTrigger
A trigger that triggers when some (other) sampling event occurs and a application-specific condition is meet.
CronScheduledTrigger
A trigger that triggers based on a cron job specification.
DataEndPoint
Specify an endpoint where a DataManager can upload data.
DataEndPointTypes
A enumeration of known (but not necessarily implemented) endpoint API types.
DataManager
The DataManager interface is used to upload Measurement objects to any data manager that implements this interface.
DataManagerEvent
An event for a data manager.
DataManagerEventTypes
An enumeration of data manager event types.
DataManagerFactory
A factory which can create a DataManager based on the type of an DataEndPoint.
DataManagerRegistry
A registry of DataManagerFactorys.
DataTransformerFactory
A factory which can create a DataTransformer.
DataTransformerSchema
An abstract class defining a transformer schema, which hold a set of DataTransformers that can map from the native CARP namespace to another namespace. A DataTransformerSchema must be implemented for each supported namespace.
DataTransformerSchemaRegistry
A registry of DataTransformerSchemas which hold a set of DataTransformers.
DateTimeTrigger
A trigger that triggers on a specific date and time.
DelayedTrigger
A trigger that triggers after delay from the (re)start of the app.
DeviceInfoService
Provides (static) information about the local device.
FHIRTransformerSchema
A default DataTransformerSchema for HL7 FHIR transformers
FileData
A Data object holding a link to a file.
FileDataEndPoint
Specify an endpoint where a file-based data manager can store JSON data as files on the local device.
FunctionTask
A task that can run a custom Dart function.
HardwareDeviceRegistration
A DeviceRegistration for a hardware device.
HistoricSamplingConfiguration
A sampling configuration which allows configuring the time back in the past and into the future to collect data.
ImmediateTrigger
A trigger that starts sampling immediately and never stops.
IntervalSamplingConfiguration
A sampling configuration that allows configuring the time interval in between subsequent measurements.
MonitoringSamplingPackage
A SamplingPackage containing data types, sampling schemas and probes for monitoring data sampling:
NoOpNotificationManager
A no-operation notification manager that does nothing.
NoOpTrigger
A trigger that does nothing.
NotificationManager
Manages user notifications, including creating, scheduling, and canceling notifications.
NoUserTaskTrigger
A trigger that triggers only if a UserTask with taskName is NOT already on the task list.
OMHTransformerSchema
A default DataTransformerSchema for Open mHealth (OMH) transformers
OneTimeTrigger
A trigger that triggers only once during a deployment.
PassiveTrigger
A trigger that trigger when the trigger method is called from Dart code.
PeriodicSamplingConfiguration
A sampling configuration specifying how to collect data on a regular basis for a specific period.
PeriodicTrigger
A trigger that triggers every period.
PersistentSamplingConfiguration
A sampling configuration that saves the last time it was sampled.
PrimaryDevice<TRegistration extends DeviceRegistration>
Root class for all CAMS primary device configurations.
PrivacySchema
A default DataTransformerSchema for privacy transformers
RandomRecurrentTrigger
A daily trigger that triggers a random number of times within a defined period of time of the day.
RecurrentScheduledTrigger
A trigger that triggers based on a recurrent scheduled date and time.
SamplingEventTrigger
A trigger that triggers when some sampling event occurs.
SamplingPackage
Interface for a sampling package.
ServiceConfiguration<TRegistration extends ServiceRegistration>
An 'connected device' which is a service.
ServiceRegistration
A DeviceRegistration for a ServiceConfiguration.
Smartphone
Configuration of a smartphone that can be part of CAMS mobile sensing study protocols.
SmartphoneApplicationData
Holds application-specific configuration for a SmartphoneStudyProtocol.
SmartphoneDeployment
Contains the entire description and configuration for a study deployment on a smartphone.
SmartphoneRegistration
A DeviceRegistration for a Smartphone specifying details of the phone.
SmartphoneSamplingPackage
An abstract class for all sampling packages that run on the phone itself.
SmartphoneStudy
A study configured to run on a smartphone (i.e., on a SmartPhoneClientManager).
SmartphoneStudyProtocol
A description of how a study is to be executed on a smartphone.
SmartphoneStudyStatusEvent
An event related to a running study, including its runtime state.
SQLiteDataEndPoint
Specify an endpoint for using the SQLiteDataManager to store JSON data in a SQLite database locally on the phone.
StudyDescription
StudyProtocolManager
An interface defining a manger of SmartphoneStudyProtocols.
StudyResponsible
A person who is responsible for a StudyProtocol. Typically the Principal Investigator (PI) who is responsible for the study.
UserTaskTrigger
A trigger that triggers based on the state of a UserTask.

Enums

BatteryChargingState
The charging state of the device battery of a HardwareDeviceRegistration.
DataEventType
Describes how a data type is collected (one-time or event-based).
RecurrentType
Type of recurrence for a RecurrentScheduledTrigger.

Mixins

SmartphoneProtocolExtension
A mixin holding smartphone-specific data for a SmartphoneStudyProtocol and SmartphoneDeployment.

Functions

noop(Data data) → Data
A no-operation transformer.

Typedefs

ConditionalEvaluator = bool Function()
Evaluates if a ConditionalPeriodicTrigger should trigger. Returns true if triggering should happen, false otherwise.
ConditionalEventEvaluator = bool Function(Measurement measurement)
Takes a Measurement from a sampling stream and evaluates if an event has occurred. Returns true if the event has occurred, false otherwise.
DataTransformer = Data Function(Data)
Signature of a data transformer.
VoidFunction = void Function()
Signature of Dart function that have no arguments and returns no data.