Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

carp_core updated to carp_serialization v. 2.0 #420

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions carp_core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.8.0

* upgrade to carp_serialization v. 2.0

## 1.7.1

* support for new [input data types](https://github.com/cph-cachet/carp-webservices-spring/blob/master/docs/input-data-types.md) at CAWS
Expand Down
18 changes: 5 additions & 13 deletions carp_core/LICENSE
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
MIT License.

Copyright 2021 Copenhagen Center for Health Technology (CACHET) at the Technical University of Denmark (DTU).
Copyright 20201 the Technical University of Denmark (DTU).

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the ”Software”), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ”Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ”AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED ”AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

To cite CARP Mobile Sensing in scientific publications, please use the following reference:

@article{bardram2020carp,
title={The CARP Mobile Sensing Framework--A Cross-platform, Reactive, Programming Framework and Runtime Environment for Digital Phenotyping},
title={The CARP Mobile Sensing Framework - A Cross-platform, Reactive, Programming Framework and Runtime Environment for Digital Phenotyping},
author={Bardram, Jakob E},
journal={arXiv preprint arXiv:2006.11904},
year={2020}
Expand Down
5 changes: 5 additions & 0 deletions carp_core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@ This package does nothing on its own.
* For documentation on how to use CAMS, see the [CAMS wiki](https://github.com/cph-cachet/carp.sensing-flutter/wiki).

* For a thorough description of the CARP Core domain model, see the [carp.core-kotlin](https://github.com/cph-cachet/carp.core-kotlin) repository. The [`example.dart`](https://pub.dev/packages/carp_core/example) of this package illustrates how the [Kotlin examples](https://github.com/cph-cachet/carp.core-kotlin#example) are implemented using Dart.

## License

This software is copyright (c) the [Technical University of Denmark (DTU)](https://www.dtu.dk) and is part of the [Copenhagen Research Platform](https://carp.cachet.dk/).
This software is available 'as-is' under a [MIT license](LICENSE).
6 changes: 3 additions & 3 deletions carp_core/example/lib/example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import 'package:carp_serializable/carp_serializable.dart';
void carpCoreProtocolExample() async {
// Create a new study protocol.
var protocol = StudyProtocol(
ownerId: UUID.v1,
ownerId: const Uuid().v1,
name: 'Track patient movement',
);

Expand Down Expand Up @@ -65,13 +65,13 @@ void carpCoreDeploymentExample() async {

// This is called by `StudyService` when deploying a participant group.
var invitation = ParticipantInvitation(
participantId: UUID.v1,
participantId: Uuid().v1,
assignedRoles: AssignedTo.all(),
identity: EmailAccountIdentity("[email protected]"),
invitation: StudyInvitation(
"Movement study", "This study tracks your movements."));

String studyDeploymentId = UUID.v1;
String studyDeploymentId = Uuid().v1;
await deploymentService?.createStudyDeployment(
trackPatientStudy,
[invitation],
Expand Down
2 changes: 1 addition & 1 deletion carp_core/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: example
description: A example of how to use the carp_core library
publish_to: 'none'
version: 1.1.0
version: 1.8.0

environment:
sdk: '>=2.17.0 <4.0.0'
Expand Down
2 changes: 1 addition & 1 deletion carp_core/lib/common/application/account.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Account {
late String id;

Account({String? id, required this.identity}) {
this.id = id ?? UUID.v1;
this.id = id ?? const Uuid().v1;
}

/// Create a new [Account] uniquely identified by the specified [emailAddress].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class DeviceRegistration extends Serializable {
}) : super() {
this.registrationCreatedOn =
registrationCreatedOn ?? DateTime.now().toUtc();
this.deviceId = deviceId ?? UUID.v1;
this.deviceId = deviceId ?? const Uuid().v1;
}

@override
Expand Down
2 changes: 1 addition & 1 deletion carp_core/lib/common/carp_core_common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ abstract class Snapshot {

Snapshot([String? id]) {
version = 0;
this.id = id ?? UUID.v1;
this.id = id ?? const Uuid().v1;
createdOn = DateTime.now().toUtc();
}
}
Expand Down
2 changes: 1 addition & 1 deletion carp_core/lib/deployment/application/users.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ParticipantInvitation {
required this.identity,
required this.invitation,
}) : super() {
this.participantId = participantId ?? UUID.v1;
this.participantId = participantId ?? Uuid().v1;
}

factory ParticipantInvitation.fromJson(Map<String, dynamic> json) =>
Expand Down
2 changes: 1 addition & 1 deletion carp_core/lib/deployment/domain/study_deployment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class StudyDeployment {
/// [studyDeploymentId] specify the study deployment id.
/// If not specified, an UUID v1 id is generated.
StudyDeployment(StudyProtocol protocol, [String? studyDeploymentId]) {
_studyDeploymentId = studyDeploymentId ?? UUID.v1;
_studyDeploymentId = studyDeploymentId ?? const Uuid().v1;
_protocol = protocol;
_creationDate = DateTime.now();
_status = StudyDeploymentStatus(studyDeploymentId: _studyDeploymentId);
Expand Down
4 changes: 2 additions & 2 deletions carp_core/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: carp_core
description: The core domain model for the Copenhagen Research Platform (CARP) in Dart.
version: 1.7.1
version: 1.8.0
homepage: https://github.com/cph-cachet/carp.sensing-flutter

environment:
Expand All @@ -11,7 +11,7 @@ dependencies:
flutter:
sdk: flutter

carp_serializable: ^1.2.0
carp_serializable: ^2.0.0
json_annotation: ^4.8.0
iso_duration_parser: ^1.1.0
meta: ^1.11.0
Expand Down
2 changes: 1 addition & 1 deletion carp_core/test/carp_core_dart_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ void main() {

// This is called by `StudyService` when deploying a participant group.
var invitation = ParticipantInvitation(
participantId: UUID.v1,
participantId: const Uuid().v1,
assignedRoles: AssignedTo.all(),
identity: EmailAccountIdentity("[email protected]"),
invitation: StudyInvitation(
Expand Down
Loading