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

AppTask
A task that notifies the app when it is triggered.
CAMSDataType
Contains CAMS data type definitions similar to CARP Core CarpDataTypes.
CamsDataTypeMetaData
Contains CAMS-specific meta data about a specific data type to be collected.
CARPTransformerSchema
A default DataTransformerSchema for CARP no-operation transformers
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.
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.
DeviceInfo
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.
Heartbeat
Reflects a heart beat data send every period minute. Useful for calculating sampling coverage over time.
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.
NoOpTrigger
A trigger that does nothing.
OMHTransformerSchema
A default DataTransformerSchema for Open mHealth (OMH) transformers
OneTimeTrigger
A trigger that triggers only once during a deployment.
OnlineService<TRegistration extends DeviceRegistration>
An online service which works as a "software device" in a protocol.
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.
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.
SmartphoneApplicationData
Holds application-specific data for a SmartphoneStudyProtocol.
SmartphoneDeployment
Contains the entire description and configuration for a study deployment on a smartphone.
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.
SQLiteDataEndPoint
Specify an endpoint for using the SQLiteDataManager to store JSON data in a SQLite database locally on the phone.
StudyDescription
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

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.