Skip to content

Commit

Permalink
Merge pull request #146 from RADAR-base/release-0.4.1
Browse files Browse the repository at this point in the history
Release 0.4.1
  • Loading branch information
blootsvoets authored Oct 30, 2018
2 parents 2d98fc7 + d5281f3 commit 9a0f7e8
Show file tree
Hide file tree
Showing 15 changed files with 136 additions and 26 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ WORKDIR /code/java-sdk

COPY commons /code/commons
COPY specifications /code/specifications
COPY restapi /code/restapi
COPY java-sdk/gradle /code/java-sdk/gradle
COPY java-sdk/build.gradle java-sdk/settings.gradle java-sdk/gradlew /code/java-sdk/

ENV GRADLE_OPTS -Dorg.gradle.daemon=false

RUN ./gradlew tasks
COPY java-sdk/radar-schemas-commons/build.gradle /code/java-sdk/radar-schemas-commons/
COPY java-sdk/radar-schemas-commons/src /code/java-sdk/radar-schemas-commons/src
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
- In the `monitor` subdirectory, add schemas for monitoring applications that gather data.
- In the `passive` subdirectory, add schemas for passive data collection, like wearables.
- In the `stream` subdirectory, add schemas used in Kafka Streams.
- The `restapi` directory contains schemas used to get data from the RADAR-CNS REST API.
- The `specifications` directory contains specifications of what data types are collected through which devices.
- Java SDKs for each of the components are provided in the `java-sdk` folder, see installation instructions there. They are automatically generated from the Avro schemas using the Avro 1.8.2 specification.

Expand Down
7 changes: 4 additions & 3 deletions commons/active/questionnaire/questionnaire.avsc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
"name": "Questionnaire",
"doc": "General schema for questionnaire. Check the specification folder to see how the questionnaire has been defined. For each QuestionnaireType there is a JSON file reporting the questions set and possible answers if available.",
"fields": [
{ "name": "time", "type": "double", "doc": "Timestamp in UTC (s) when the questionnaire is submitted to the subject." },
{ "name": "timeCompleted", "type": "double", "doc": "Timestamp in UTC (s) when subject marks the questionnaire as." },
{ "name": "time", "type": "double", "doc": "Timestamp in UTC (s) when the questionnaire is started by the subject." },
{ "name": "timeCompleted", "type": "double", "doc": "Timestamp in UTC (s) when the questionnaire is completed by the subject." },
{ "name": "timeNotification", "type": ["null", "double"], "doc": "Timestamp in UTC (s) when the notification to complete the questionnaire is sent.", "default": null },
{ "name": "name", "type": "string", "doc": "Questionnaire names." },
{ "name": "version", "type": "string", "doc": "It reports the questionnaire version stated in the JSON specification." },
{ "name": "answers", "type": {
Expand All @@ -15,7 +16,7 @@
"type": "record",
"doc": "Questionnaire answer.",
"fields": [
{ "name": "questionId", "type": ["null", "string"], "doc": "Unique identifier for the specific question.", "default": null },
{ "name": "questionId", "type": ["null", "string"], "doc": "Unique identifier for the specific question.", "default": null },
{ "name": "value", "type": ["int", "string", "double"], "doc": "Subject answer." },
{ "name": "startTime", "type": "double", "doc": "Timestamp in UTC (s) when the question is shown." },
{ "name": "endTime", "type": "double", "doc": "Timestamp in UTC (s) when the question is answered." }
Expand Down
14 changes: 14 additions & 0 deletions commons/passive/ppg/phone_camera_ppg.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"namespace": "org.radarcns.passive.ppg",
"name": "PhoneCameraPpg",
"type": "record",
"doc": "PPG collected using a phone camera. This ranges over a sample of the image in a camera preview. The number of pixels in the preview image may have been determined by Android and/or the hardware vendor by downsampling from the number of pixels provided by the hardware sensor.",
"fields": [
{ "name": "time", "type": "double", "doc": "Phone time since the Unix Epoch (seconds)." },
{ "name": "timeReceived", "type": "double", "doc": "Processed time since the Unix Epoch (seconds)." },
{ "name": "sampleSize", "type": "int", "doc": "Number of pixels that were evaluated to get the current value." },
{ "name": "red", "type": "float", "doc": "Red component detected in a sample of the camera preview. The range is 0 (no saturation) to 1 (full saturation)." },
{ "name": "green", "type": "float", "doc": "Green component detected in a sample of the camera preview. The range is 0 (no saturation) to 1 (full saturation)." },
{ "name": "blue", "type": "float", "doc": "Blue component detected in a sample of the camera preview. The range is 0 (no saturation) to 1 (full saturation)." }
]
}
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
# Zookeeper Cluster #
#---------------------------------------------------------------------------#
zookeeper-1:
image: confluentinc/cp-zookeeper:3.3.0
image: confluentinc/cp-zookeeper:5.0.0
environment:
ZOOKEEPER_SERVER_ID: 1
ZOOKEEPER_CLIENT_PORT: 2181
Expand All @@ -19,7 +19,7 @@ services:
# Kafka Cluster #
#---------------------------------------------------------------------------#
kafka-1:
image: confluentinc/cp-kafka:3.3.0
image: confluentinc/cp-kafka:5.0.0
depends_on:
- zookeeper-1
environment:
Expand All @@ -40,7 +40,7 @@ services:
# Schema Registry #
#---------------------------------------------------------------------------#
schema-registry-1:
image: confluentinc/cp-schema-registry:3.3.0
image: confluentinc/cp-schema-registry:5.0.0
depends_on:
- zookeeper-1
- kafka-1
Expand Down
4 changes: 2 additions & 2 deletions java-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ repositories {
dependencies {
// Commons schemas (backend, passive remote monitoring app)
compile 'org.radarcns:radar-schemas-commons:0.4.0'
compile 'org.radarcns:radar-schemas-commons:0.4.1'
// Questionnaire schemas (active remote monitoring app)
compile 'org.radarcns:radar-schemas-tools:0.4.0'
compile 'org.radarcns:radar-schemas-tools:0.4.1'
}
```
Usually, you only need to include the schemas you actually need in your dependencies.
Expand Down
4 changes: 2 additions & 2 deletions java-sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ subprojects {
apply plugin: 'idea'

// Configuration
version = '0.4.0'
version = '0.4.1'
group = 'org.radarcns'
ext.githubRepoName = 'RADAR-base/RADAR-Schemas'

Expand Down Expand Up @@ -133,5 +133,5 @@ subprojects {
}

wrapper {
gradleVersion '4.9'
gradleVersion '4.10.2'
}
Binary file modified java-sdk/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion java-sdk/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,18 @@ public boolean createTopics(Stream<String> topics, int partitions, short replica
try {
Set<String> existingTopics = kafkaClient.listTopics().names().get();

logger.info("Creating topics. Topics marked with [*] already exist.");

List<NewTopic> newTopics = topics
.filter(t -> !existingTopics.contains(t))
.filter(t -> {
if (existingTopics.contains(t)) {
logger.info("[*] {}", t);
return false;
} else {
logger.info("[ ] {}", t);
return true;
}
})
.map(t -> new NewTopic(t, partitions, replication))
.collect(Collectors.toList());

Expand Down Expand Up @@ -222,7 +232,7 @@ public void addParser(ArgumentParser parser) {
parser.addArgument("-r", "--replication")
.help("number of replicas per data packet")
.type(Short.class)
.setDefault(3);
.setDefault((short) 3);
parser.addArgument("-b", "--brokers")
.help("number of brokers that are expected to be available.")
.type(Integer.class)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: aRMT
vendor: RADAR
model: aRMT-App
version: 1.2.0
version: 1.3.0
assessment_type: QUESTIONNAIRE
doc: aRMT Questionnaires definition. Includes Personal Health Questionnaire Depression Scale (PHQ-8), Experience sampling method (ESM) and RSES and other data.
data:
Expand Down Expand Up @@ -39,3 +39,11 @@ data:
- type: COMPLETION_LOG
topic: questionnaire_completion_log
value_schema: .monitor.questionnaire.QuestionnaireCompletionLog
- type: PDQ
topic: questionnaire_perceived_deficits_questionnaire
value_schema: .active.questionnaire.Questionnaire
questionnaire_definition_url: https://raw.githubusercontent.com/RADAR-base/RADAR-REDCap-aRMT-Definitions/master/questionnaires/perceived_deficits_questionnaire/perceived_deficits_questionnaire_armt.json
- type: PDDS
topic: questionnaire_patient_determined_disease_step
value_schema: .active.questionnaire.Questionnaire
questionnaire_definition_url: https://raw.githubusercontent.com/RADAR-base/RADAR-REDCap-aRMT-Definitions/master/questionnaires/patient_determined_disease_step/patient_determined_disease_step_armt.json
54 changes: 54 additions & 0 deletions specifications/active/aRMT-1.4.0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: aRMT
vendor: RADAR
model: aRMT-App
version: 1.4.0
assessment_type: QUESTIONNAIRE
doc: aRMT Questionnaires definition. Includes Personal Health Questionnaire Depression Scale (PHQ-8), Experience sampling method (ESM) and RSES and other data.
data:
- type: THINC-IT
topic: notification_thinc_it
value_schema: .active.notification.Notification
questionnaire_definition_url: https://github.com/RADAR-base/RADAR-REDCap-aRMT-Definitions/blob/master/questionnaires/thinc_it/thinc_it_armt.json
- type: ROMBERG_TEST
topic: task_romberg_test
value_schema: .active.task.Task
questionnaire_definition_url: https://github.com/RADAR-base/RADAR-REDCap-aRMT-Definitions/blob/master/questionnaires/romberg_test/romberg_test_armt.json
- type: 2MW_TEST
topic: task_2MW_test
value_schema: .active.task.Task
questionnaire_definition_url: https://github.com/RADAR-base/RADAR-REDCap-aRMT-Definitions/blob/master/questionnaires/2MW_test/2MW_test_armt.json
- type: TANDEM_WALKING_TEST
topic: task_tandem_walking_test
value_schema: .active.task.Task
questionnaire_definition_url: https://github.com/RADAR-base/RADAR-REDCap-aRMT-Definitions/blob/master/questionnaires/tandem_walking_test/tandem_walking_test_armt.json
- type: PHQ8
topic: questionnaire_phq8
value_schema: .active.questionnaire.Questionnaire
questionnaire_definition_url: https://raw.githubusercontent.com/RADAR-base/RADAR-REDCap-aRMT-Definitions/master/questionnaires/phq8/phq8_armt.json
- type: ESM
topic: questionnaire_esm
value_schema: .active.questionnaire.Questionnaire
questionnaire_definition_url: https://raw.githubusercontent.com/RADAR-base/RADAR-REDCap-aRMT-Definitions/master/questionnaires/esm/esm_armt.json
- type: AUDIO
topic: questionnaire_audio
value_schema: .active.opensmile.OpenSmile2AudioRecording
- type: RSES
topic: questionnaire_rses
value_schema: .active.questionnaire.Questionnaire
questionnaire_definition_url: https://raw.githubusercontent.com/RADAR-base/RADAR-REDCap-aRMT-Definitions/master/questionnaires/rses/rses_armt.json
- type: PDQ
topic: questionnaire_perceived_deficits_questionnaire
value_schema: .active.questionnaire.Questionnaire
questionnaire_definition_url: https://raw.githubusercontent.com/RADAR-base/RADAR-REDCap-aRMT-Definitions/master/questionnaires/perceived_deficits_questionnaire/perceived_deficits_questionnaire_armt.json
- type: PDDS
topic: questionnaire_patient_determined_disease_step
value_schema: .active.questionnaire.Questionnaire
questionnaire_definition_url: https://raw.githubusercontent.com/RADAR-base/RADAR-REDCap-aRMT-Definitions/master/questionnaires/patient_determined_disease_step/patient_determined_disease_step_armt.json
- type: COMPLETION_LOG
doc: Information about the completeness of each questionnaire.
topic: questionnaire_completion_log
value_schema: .monitor.questionnaire.QuestionnaireCompletionLog
- type: TIMEZONE
doc: Timezone information sent along with each questionnaire.
topic: questionnaire_timezone
value_schema: .monitor.application.ApplicationTimeZone
10 changes: 0 additions & 10 deletions specifications/passive/android_phone-1.0.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,3 @@ data:
value_schema: .passive.phone.PhoneUserInteraction
sample_rate:
dynamic: true
# Weather
- type: WEATHER
app_provider: .weather.WeatherApiProvider
unit: NON_DIMENSIONAL
processing_state: RAW
topic: android_local_weather
value_schema: .passive.weather.LocalWeather
sample_rate:
interval: 10800
configurable: true
15 changes: 15 additions & 0 deletions specifications/passive/openweathermap_api-0.1.0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#====================================== Android Phone Sensors =====================================#
vendor: OPENWEATHERMAP
model: API
version: 0.1.0
data:
# Weather
- type: WEATHER
app_provider: .weather.WeatherApiProvider
unit: NON_DIMENSIONAL
processing_state: RAW
topic: android_local_weather
value_schema: .passive.weather.LocalWeather
sample_rate:
interval: 10800
configurable: true
17 changes: 17 additions & 0 deletions specifications/passive/rateaf_ppg-0.1.0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#====================================== Android Phone Sensors =====================================#
vendor: RATE-AF
model: PPG
version: 0.1.0
data:
#Phone sensors
- type: PPG
app_provider: org.radarbase.passive.ppg.PhonePpgProvider
fields:
- name: red
- name: green
- name: blue
sample_rate:
dynamic: true
processing_state: RADAR
topic: android_phone_ppg
value_schema: .passive.ppg.PhoneCameraPpg

0 comments on commit 9a0f7e8

Please sign in to comment.