Releases: cph-cachet/carp.core-kotlin
Version 1.0.0-alpha.37
Changes to JSON serialization format:
- Use of optional fields in snapshots where relevant (#12): collections which may be empty,
null
for optional parameters, and empty strings forapplicationData
. - Optional text is nullable, rather than default empty string. This includes removing
StudyInvitation.empty()
, for whichnull
is now preferred. - Encoding of default values can now be disabled (and is disabled by default serializer) (cfdccc6).
Duration
is now serialized using ISO standard, rather than microseconds (#287).
Dependency updates:
- Kotlin 1.5.31
- coroutines 1.5.2
Common
BatteryAwareSampling.low
is no longer nullable (f57e39d).- Bugfix: Make default sampling schemes in
BatteryAwareSamplingScheme
public (b603b9e). - Renamed:
- MAC address builder can now use either
:
or-
separators and accepts both lowercase and uppercase (8b28201). - Removed
DeviceRegistration.fromJson
andtoJson
methods (6cf30f2). Use the defaultjson.serialization
encode/decode functions instead. - Added
DeviceDescriptor.getDefaultSamplingConfiguration()
to facilitate client implementations (#311).
Deployments
ParticipationService.setParticipantData
changed to support setting multiple participant data at once (518d05f).- Add protocol warning for
BackgroundTask
with no measures (e642397). - TypeScript declarations fixed for
StudyDeploymentStatus
andDeviceDeploymentStatus
(#307).
Studies
- TypeScript declarations fixed for
StudyStatus
(#307).
Clients
- Add
ClientRepository.removeStudyRuntime()
(#313)
Multiplatform release accessible through Maven:
https://mvnrepository.com/artifact/dk.cachet.carp
Version 1.0.0-alpha.36
Primarily, this version Introduces the data subsystem, with minor additions to the common module in order to accommodate the new endpoint definitions.
Data
Added a definition for data streams identified by (DataStreamId
), and objects to initialize data points for data streams (Measurement
, DataStreamPoint
, DataStreamSequence
, and DataStreamBatch
).
These classes are currently used by the new data ingestion endpoints. They provide a clear contract between the client subsystem and the data subsystem on how to upload data, and which data is expected/valid; this was infrastructure-specific before, i.e., not part of core.
Common
- The base class
EnumObjectList
has been turned into a map (EnumObjectMap
) since lookups by key were shared by all implementing classes. (cd02b1f) Correspondingly,DataTypeMetaDataList
has been turned intoDataTypeMetaDataMap
andDataTypeSamplingSchemeList
intoDataTypeSamplingSchemeMap
. - Added
intersect
extension forRange
, which may be of use to simplify implementing data stream sequence/timestamping logic. (62b81da) - Added
getInteractionDataTypes
toTaskDescriptor
, which should return the data types that are uploaded as the result of user interactions, e.g., filling out a survey. (a03abfe)
Multiplatform release accessible through Maven:
https://mvnrepository.com/artifact/dk.cachet.carp
Version 1.0.0-alpha.35
Dependency updates:
- Kotlin 1.5.21
- kotlinx.serialization 1.2.2
- coroutines 1.5.1
Timestamp variables are now consistently named using the past tense followed by on
, rather than a date
or time
suffix. E.g., createdOn
rather than creationDate
. This could cause confusion as to whether only a date or time of day was stored.
Common
- Replaced previously custom
DateTime
with kotlinx-datetimeInstant
- Replaced previously custom
TimeSpan
with kotlin'sDuration
CustomInput
is no longer generic
Multiplatform release accessible through Maven:
https://mvnrepository.com/artifact/dk.cachet.carp
Version 1.0.0-alpha.34
Common
Measure
can be now eitherDataStream
orTriggerData
:DataStream
: what was previously known asMeasure
. Describes passive data collection of a particular type on a device.TriggerData
: determines that when a trigger starts or stops a task, the conditions under which this happens should be measured.
- Added
SignalStrength
toAltBeacon.Sensors
. (#277) - Bugfix:
DataTypeMetaDataList
did not iterate containing types.
Multiplatform release accessible through Maven:
https://mvnrepository.com/artifact/dk.cachet.carp
Version 1.0.0-alpha.33
Studies
- Participant group data is no longer exposed through
RecruitmentService
. From now on, callParticipationService
in the deployments subsystem directly to get/set this data.- Removed
RecruitmentService.setParticipantGroupData()
. ParticipantGroupStatus
no longer contains participant data.
- Removed
- Bugfix: race condition when calling
RecruitmentService.deployParticipantGroup
(#269).
Multiplatform release accessible through Maven:
https://mvnrepository.com/artifact/dk.cachet.carp
Version 1.0.0-alpha.32
Common
description
added toTaskDescriptor
to specify reason for data collection.- Added a
WebTask
: describes a redirect to a web page which contains the task which needs to be performed. DataType
meta data can now be retrieved throughCarpDataTypes
:displayName
: a name which can be used to display to the user which data is collected.timeType
: determines how matchingData
should be stored temporally, i.e., whetherendTime
should be specified.
applicationData
fields can now use plain (non-escaped) JSON objects when JSON serialization is used.
Protocols / deployments
applicationData
added toStudyProtocolSnapshot
, which is passed along to anyMasterDeviceDeployment
when the protocol is deployed.
Multiplatform release accessible through Maven:
https://mvnrepository.com/artifact/dk.cachet.carp
Version 1.0.0-alpha.31
Stabilized namespaces
The primary change in this release involves moving classes to different namespaces in preparation of a stable 1.0.0 release:
- All subsystem namespaces are now plural:
deployment
is nowdeployments
client
is nowclients
- Classes have been moved to root namespaces which determine their role in the system, as dictated by DDD (
application
,domain
, andinfrastructure
namespaces). - The
InputElement
interface has been moved side-by-side with its concrete implementations indata.input.elements
(now plural), similar to the other extendable classes. - Core classes previously located in
protocols.domain
(such asDeviceDescriptor
,Trigger
, etc.) have been moved tocommon.application
. These classes were not strictly linked to the protocols subsystem, but made up a 'shared kernel' reused in all subsystems.
With all core classes moved to the common module, there is no longer a need for subsystem-specific SerializersModule
s and Json
serializers. These have been removed and all subsystems can rely on the central Json
serializer defined in the common.infrastructure.serialization
.
Core study protocol model
Many of the core classes defining study protocols are now located in common.application
, as they are frequently passed between application services. This release made some fundamental changes to the core model, which are summarized here:
DeviceDescriptor
SamplingScheme
s are no longer strongly-linked toDataType
. Instead,DeviceDescriptor
s decide on theDataTypeSamplingScheme
for each of theDataType
s they support.- Implementations of
DeviceDescriptor
need to listSensors
(DataTypeSamplingSchemeList
) andTasks
(TaskDescriptorList
). This is statically available information on device capabilities which is not serialized since it is not configurable by the researcher defining the study protocol. isValidConfiguration
renamed toisValidRegistration
. Documentation on whatDeviceRegistration
is should now be clearer.
TaskDescriptor
/ Measure
- Specializations of
Measure
are removed and it is now a concrete class. Measure
s are initialized throughDataTypeSamplingScheme
and no longer through separate functions accessible from theDeviceDescriptor
. In addition, the API is extended to support checking whether or not a constructedMeasure
is valid for the relatedDataTypeSamplingScheme
. E.g., to check whether or not a set interval exceeds a minimum/maximum value.- Likewise,
TaskDescriptor
s can be constructed through theDeviceDescriptor
'sTaskDescriptorList
. ConcurrentTask
is renamed toBackgroundTask
.
DataTypeSamplingScheme
- Added a
BatteryAwareSamplingScheme
specialization ofDataTypeSamplingScheme
which serves as a base class for sampling schemes which adapt to how much battery is left on a device. This is now used bySmartphone
to implement aAdaptiveGranularitySamplingScheme
forGEOLOCATION
.
Trigger
- Triggers can now also stop tasks.
TriggeredTask
is renamed toTaskControl
.- Extension functions are added to
Trigger
to create relatedTaskControl
objects. E.g.:start
inphone.atStartOfStudy().start( measures, phone )
.
Studies and deployments subsystem
- Renamed
ParticipantService
in studies subsystem toRecruitmentService
to disambiguate it fromParticipationService
in the deployments subystem. (496d33f) - Creating a study deployment (
DeploymentService.createStudyDeployment
) and inviting participants to that deployment is now a single call. Correspondingly,ParticipationService.addParticipation
has been removed. Instead,createStudyDeployment
takes aList<ParticipantInvitation>
which needs to specify a complete list of all people to be invited to the deployment. This now also supports passing preregistrations for connected devices (e.g., the researcher already configured the connection details for a device they hand out to participants). participationId
has been removed. It is now namedparticipantId
and is provided by the calling subsystem inParticipantInvitation
. The original intent was for this to be an anonymous ID for participants, but this did not fully work sincestudyDeploymentId
was not anonymized. Instead, we have decided anonymization (of bothstudyDeploymentId
andparticipantId
) needs to happen (by default) on data export.- Bugfix: event bus race condition in
ParticipantService
. (#248)
Multiplatform release accessible through Maven:
https://mvnrepository.com/artifact/dk.cachet.carp
Version 1.0.0-alpha.30
Dependency upgrades:
- Kotlin 1.4.31
- kotlinx.serialization 1.1.0
- Gradle 6.8.3
Common
- Change to the
EventBus
abstraction: handlers now need to be 'activated' after 'registering' them. A baseChannelConventionEventBus
class can be used when a one-to-one mapping between messaging channel and application service is desired. (#238) - Removing studies propagates to removal of data in deployment subsystem. (#231)
- Bugfix: locale-dependent serialization of MAC address and UUID. (2357620)
- Serialization improvements:
UnknownPolymorphicSerializer
no longer has a hardcoded class discriminator. (7f699e2)- Remove periods in JSON keys so that BSON serialization may work. (27447dd)
- Fallback to normal polymorphic serialization for non-Json formats. (fef947d)
UnknownPolymorphicSerializer
is now the default fallback serializer for types which support it and no longer needs to be specified in every place where the type is used. (#232)
Protocols
- Bugfix:
ProtocolVersion.date
should always be serialized. (5cd6016)
Deployment
- Dependencies between
DeploymentService
andParticipationService
are now managed through events on the event bus, and the code is refactored accordingly;StudyDeployment
does device management (deployment and in the future status management), whereasParticipantGroup
manages everything related to participants, such as assigning devices to participants, consent, and storing participant data. (#227)Participation
is now stored inParticipantGroup
rather than inStudyDeployment
.- Assigned master devices and registration state is stored in
ParticipantGroup
. DeploymentRepository
dependency is removed fromParticipationService
.
- Assigned master devices are stored and returned as part of active invitations. (#228)
- Added
DeploymentRepository.remove()
. - Added
ParticipationRepository.remove()
. - Added
DeploymentService.removeStudyDeployments()
.
TypeScript declarations
- Added TypeScript declarations for deployment service requests. (#229)
- Added
toArray
forArrayList
andHashSet
. (0470149)
Multiplatform release accessible through Maven:
https://mvnrepository.com/artifact/dk.cachet.carp
Version 1.0.0-alpha.29.1 (hotfix)
Applies four hotfixes to version 1.0.0-alpha.29:
- Bugfix:
ProtocolVersion.date
should always be serialized. - Bugfix: load
classDiscriminator
for unkown polymorphism at runtime. - Fallback to normal polymorphic serialization for non-Json formats in
UnknownPolymorphicSerializer
s. - Make sure
ParticipantGroupSnapshot
can be serialized as BSON.
Multiplatform release accessible through Maven:
https://mvnrepository.com/artifact/dk.cachet.carp
Version 1.0.0-alpha.28.3 (hotfix)
Applies four hotfixes to version 1.0.0-alpha.28:
- Bugfix:
ProtocolVersion.date
should always be serialized. - Bugfix: load
classDiscriminator
for unkown polymorphism at runtime. - Fallback to normal polymorphic serialization for non-Json formats in
UnknownPolymorphicSerializer
s. - Make sure
ParticipantGroupSnapshot
can be serialized as BSON.
Multiplatform release accessible through Maven:
https://mvnrepository.com/artifact/dk.cachet.carp