From fc0aad655f5d85499b19ee7079705d4a354abc04 Mon Sep 17 00:00:00 2001 From: Sebastian Boettcher Date: Tue, 25 Apr 2017 18:11:51 +0200 Subject: [PATCH 01/34] biovotion: changed some doc; added led current schema --- commons/biovotion/biovotion_vsm_battery_state.avsc | 4 ++-- commons/biovotion/biovotion_vsm_led_current.avsc | 14 ++++++++++++++ commons/biovotion/biovotion_vsm_temperature.avsc | 6 +++--- 3 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 commons/biovotion/biovotion_vsm_led_current.avsc diff --git a/commons/biovotion/biovotion_vsm_battery_state.avsc b/commons/biovotion/biovotion_vsm_battery_state.avsc index ea3bcbc4..85cbdab9 100644 --- a/commons/biovotion/biovotion_vsm_battery_state.avsc +++ b/commons/biovotion/biovotion_vsm_battery_state.avsc @@ -7,8 +7,8 @@ {"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"}, {"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"}, {"name": "batteryLevel", "type": "float", "doc": "battery level (0-1)"}, - {"name": "batteryChargeRate", "type": "float", "doc": "battery charge rate (0-1)"}, + {"name": "batteryChargeRate", "type": "float", "doc": "battery charge rate, level change per hour (0-1)"}, {"name": "batteryVoltage", "type": "float", "doc": "battery voltage (V)"}, - {"name": "batteryStatus", "type": "float", "doc": "battery status"} + {"name": "batteryStatus", "type": "float", "doc": "battery status; 0:not charging, not on charger; 2:not charging, on charger; 3:charging, on charger"} ] } diff --git a/commons/biovotion/biovotion_vsm_led_current.avsc b/commons/biovotion/biovotion_vsm_led_current.avsc new file mode 100644 index 00000000..58711f17 --- /dev/null +++ b/commons/biovotion/biovotion_vsm_led_current.avsc @@ -0,0 +1,14 @@ +{ + "namespace": "org.radarcns.biovotion", + "type": "record", + "name": "BiovotionVSMLedCurrent", + "doc": "Data from red, green and ir leds (PPG raw data).", + "fields": [ + {"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"}, + {"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"}, + {"name": "red", "type": "float", "doc": "current for red LED (mA)"}, + {"name": "green", "type": "float", "doc": "current for green LED (mA)"}, + {"name": "ir", "type": "float", "doc": "current for IR LED (mA)"}, + {"name": "offset", "type": "float", "doc": "current offset (mA)"} + ] +} diff --git a/commons/biovotion/biovotion_vsm_temperature.avsc b/commons/biovotion/biovotion_vsm_temperature.avsc index b6bdf5b8..f794f78d 100644 --- a/commons/biovotion/biovotion_vsm_temperature.avsc +++ b/commons/biovotion/biovotion_vsm_temperature.avsc @@ -2,12 +2,12 @@ "namespace": "org.radarcns.biovotion", "type": "record", "name": "BiovotionVSMTemperature", - "doc": "Data from temperature sensor expressed degrees on the Celsius (°C) scale.", + "doc": "Data from temperature sensor expressed in degrees on the Celsius (°C) scale.", "fields": [ {"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"}, {"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"}, - {"name": "temperature", "type": "float", "doc": "local temperature (°C)"}, - {"name": "temperatureObject", "type": "float", "doc": "object temperature (°C)"}, + {"name": "temperature", "type": "float", "doc": "skin temperature (°C)"}, + {"name": "temperatureLocal", "type": "float", "doc": "device (board) temperature (°C)"}, {"name": "temperatureBarometer", "type": "float", "doc": "barometer temperature (°C)"} ] } From 2e034030958bef25efcf28738aee3d01775679d4 Mon Sep 17 00:00:00 2001 From: Francesco Nobilia Date: Fri, 28 Apr 2017 13:38:51 +0100 Subject: [PATCH 02/34] New dataset with time-frame --- java-sdk/build.gradle | 2 +- restapi/{sensor => data}/acceleration.avsc | 8 ++++---- restapi/data/double_value.avsc | 9 +++++++++ restapi/{dataset => data}/quartiles.avsc | 2 +- restapi/dataset/item.avsc | 13 ++++--------- restapi/header/descriptive_statistic.avsc | 2 +- restapi/header/effective_time_frame.avsc | 2 +- restapi/header/header.avsc | 1 + restapi/header/time_frame.avsc | 15 +++++++++++++++ restapi/sensor/battery.avsc | 9 --------- restapi/sensor/blood_volume_pulse.avsc | 9 --------- restapi/sensor/electrodermal_activity.avsc | 9 --------- restapi/sensor/heart_rate.avsc | 9 --------- restapi/sensor/inter_beat_interval.avsc | 9 --------- restapi/sensor/sensor_type.avsc | 2 +- restapi/sensor/temperature.avsc | 9 --------- restapi/sensor/unit.avsc | 2 +- 17 files changed, 39 insertions(+), 73 deletions(-) rename restapi/{sensor => data}/acceleration.avsc (73%) create mode 100644 restapi/data/double_value.avsc rename restapi/{dataset => data}/quartiles.avsc (80%) create mode 100644 restapi/header/time_frame.avsc delete mode 100644 restapi/sensor/battery.avsc delete mode 100644 restapi/sensor/blood_volume_pulse.avsc delete mode 100644 restapi/sensor/electrodermal_activity.avsc delete mode 100644 restapi/sensor/heart_rate.avsc delete mode 100644 restapi/sensor/inter_beat_interval.avsc delete mode 100644 restapi/sensor/temperature.avsc diff --git a/java-sdk/build.gradle b/java-sdk/build.gradle index 908b7536..654a428d 100644 --- a/java-sdk/build.gradle +++ b/java-sdk/build.gradle @@ -15,7 +15,7 @@ subprojects { apply plugin: 'maven-publish' // Configuration - version = '0.1' + version = '0.1.1-SNAPSHOT' group = 'org.radarcns' ext.githubRepoName = 'RADAR-CNS/RADAR-Schemas' diff --git a/restapi/sensor/acceleration.avsc b/restapi/data/acceleration.avsc similarity index 73% rename from restapi/sensor/acceleration.avsc rename to restapi/data/acceleration.avsc index 1c40294a..4f32b365 100644 --- a/restapi/sensor/acceleration.avsc +++ b/restapi/data/acceleration.avsc @@ -1,11 +1,11 @@ { - "namespace": "org.radarcns.avro.restapi.sensor", + "namespace": "org.radarcns.avro.restapi.data", "type": "record", "name": "Acceleration", "doc": "Acceleration item for a dataset with gravitational constant g as unit.", "fields": [ - {"name": "x", "type": [ "double" , "org.radarcns.avro.restapi.dataset.Quartiles" ]}, - {"name": "y", "type": [ "double" , "org.radarcns.avro.restapi.dataset.Quartiles" ]}, - {"name": "z", "type": [ "double" , "org.radarcns.avro.restapi.dataset.Quartiles" ]} + {"name": "x", "type": [ "double" , "org.radarcns.avro.restapi.data.Quartiles" ]}, + {"name": "y", "type": [ "double" , "org.radarcns.avro.restapi.data.Quartiles" ]}, + {"name": "z", "type": [ "double" , "org.radarcns.avro.restapi.data.Quartiles" ]} ] } diff --git a/restapi/data/double_value.avsc b/restapi/data/double_value.avsc new file mode 100644 index 00000000..a1430957 --- /dev/null +++ b/restapi/data/double_value.avsc @@ -0,0 +1,9 @@ +{ + "namespace": "org.radarcns.avro.restapi.data", + "type": "record", + "name": "DoubleValue", + "doc": "Generic sample represented by a double value. A specific schema is provided to represent quartile values.", + "fields": [ + {"name": "value", "type": [ "double" , "org.radarcns.avro.restapi.data.Quartiles" ]} + ] +} diff --git a/restapi/dataset/quartiles.avsc b/restapi/data/quartiles.avsc similarity index 80% rename from restapi/dataset/quartiles.avsc rename to restapi/data/quartiles.avsc index 0e0e864e..318e2879 100644 --- a/restapi/dataset/quartiles.avsc +++ b/restapi/data/quartiles.avsc @@ -1,5 +1,5 @@ { - "namespace": "org.radarcns.avro.restapi.dataset", + "namespace": "org.radarcns.avro.restapi.data", "type": "record", "name": "Quartiles", "doc": "List of quartiles", diff --git a/restapi/dataset/item.avsc b/restapi/dataset/item.avsc index ab3a8fa2..9babe865 100644 --- a/restapi/dataset/item.avsc +++ b/restapi/dataset/item.avsc @@ -4,15 +4,10 @@ "name": "Item", "doc": "Dataset item. It contains a value and its related time.", "fields": [ - {"name": "value", "type": [ - "org.radarcns.avro.restapi.sensor.HeartRate" , - "org.radarcns.avro.restapi.sensor.Acceleration" , - "org.radarcns.avro.restapi.sensor.Battery" , - "org.radarcns.avro.restapi.sensor.BloodVolumePulse" , - "org.radarcns.avro.restapi.sensor.ElectroDermalActivity" , - "org.radarcns.avro.restapi.sensor.InterBeatInterval" , - "org.radarcns.avro.restapi.sensor.Temperature" + {"name": "sample", "type": [ + "org.radarcns.avro.restapi.data.DoubleValue" , + "org.radarcns.avro.restapi.data.Acceleration" ] } , - {"name": "effectiveTimeFrame", "type": "org.radarcns.avro.restapi.header.EffectiveTimeFrame"} + {"name": "startDateTime", "type": "string", "doc": "It is a point in time (ISO8601) with UTC timezone."} ] } diff --git a/restapi/header/descriptive_statistic.avsc b/restapi/header/descriptive_statistic.avsc index b9f1f429..3b683f9a 100644 --- a/restapi/header/descriptive_statistic.avsc +++ b/restapi/header/descriptive_statistic.avsc @@ -2,7 +2,7 @@ "namespace": "org.radarcns.avro.restapi.header", "type": "enum", "name": "DescriptiveStatistic", - "doc": "Set of available statical value", + "doc": "Statical values", "symbols": [ "AVERAGE" , "COUNT" , diff --git a/restapi/header/effective_time_frame.avsc b/restapi/header/effective_time_frame.avsc index 9a23ce8a..ec139cb2 100644 --- a/restapi/header/effective_time_frame.avsc +++ b/restapi/header/effective_time_frame.avsc @@ -2,7 +2,7 @@ "namespace": "org.radarcns.avro.restapi.header", "type": "record", "name": "EffectiveTimeFrame", - "doc": "Time window", + "doc": "Provide the first and the last timestamp contained in the dataset", "fields": [ {"name": "startDateTime", "type": "string", "doc": "It is a point in time (ISO8601) with UTC timezone."}, {"name": "endDateTime", "type": "string", "doc": "It is a point in time (ISO8601) with UTC timezone."} diff --git a/restapi/header/header.avsc b/restapi/header/header.avsc index 4e130905..05c370fb 100644 --- a/restapi/header/header.avsc +++ b/restapi/header/header.avsc @@ -6,6 +6,7 @@ "fields": [ {"name": "descriptiveStatistic", "type": "DescriptiveStatistic" }, {"name": "unit", "type": "org.radarcns.avro.restapi.sensor.Unit"}, + {"name": "timeFrame", "type": "TimeFrame"}, {"name": "effectiveTimeFrame", "type": "EffectiveTimeFrame" } ] } diff --git a/restapi/header/time_frame.avsc b/restapi/header/time_frame.avsc new file mode 100644 index 00000000..9a5e5feb --- /dev/null +++ b/restapi/header/time_frame.avsc @@ -0,0 +1,15 @@ +{ + "namespace": "org.radarcns.avro.restapi.header", + "type": "enum", + "name": "TimeFrame", + "doc": "Interval between two consecutive samples", + "symbols": [ + "TEN_SECOND" , + "THIRTY_SECOND" , + "ONE_MIN" , + "TEN_MIN" , + "ONE_HOUR" , + "ONE_DAY" , + "ONE_WEEK" + ] +} diff --git a/restapi/sensor/battery.avsc b/restapi/sensor/battery.avsc deleted file mode 100644 index a4b22359..00000000 --- a/restapi/sensor/battery.avsc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "namespace": "org.radarcns.avro.restapi.sensor", - "type": "record", - "name": "Battery", - "doc": "The battery level resulting from the data aggregation. It is a double value between 0 and 1", - "fields": [ - {"name": "value", "type": [ "double" , "org.radarcns.avro.restapi.dataset.Quartiles" ]} - ] -} diff --git a/restapi/sensor/blood_volume_pulse.avsc b/restapi/sensor/blood_volume_pulse.avsc deleted file mode 100644 index 276617ee..00000000 --- a/restapi/sensor/blood_volume_pulse.avsc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "namespace": "org.radarcns.avro.restapi.sensor", - "type": "record", - "name": "BloodVolumePulse", - "doc": "Data from photoplethysmograph expressed in light absorption (nW)", - "fields": [ - {"name": "value", "type": [ "double" , "org.radarcns.avro.restapi.dataset.Quartiles" ]} - ] -} diff --git a/restapi/sensor/electrodermal_activity.avsc b/restapi/sensor/electrodermal_activity.avsc deleted file mode 100644 index fb73431b..00000000 --- a/restapi/sensor/electrodermal_activity.avsc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "namespace": "org.radarcns.avro.restapi.sensor", - "type": "record", - "name": "ElectroDermalActivity", - "doc": "Aggregated data representing electrodermal activity expressed as microsiemens (µS)", - "fields": [ - {"name": "value", "type": [ "double" , "org.radarcns.avro.restapi.dataset.Quartiles" ]} - ] -} diff --git a/restapi/sensor/heart_rate.avsc b/restapi/sensor/heart_rate.avsc deleted file mode 100644 index 23ce4821..00000000 --- a/restapi/sensor/heart_rate.avsc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "namespace": "org.radarcns.avro.restapi.sensor", - "type": "record", - "name": "HeartRate", - "doc": "Heart Rate resulting from data aggregation. It is computed as (60 / ibi)", - "fields": [ - {"name": "value", "type": [ "double" , "org.radarcns.avro.restapi.dataset.Quartiles" ]} - ] -} diff --git a/restapi/sensor/inter_beat_interval.avsc b/restapi/sensor/inter_beat_interval.avsc deleted file mode 100644 index fe4fe615..00000000 --- a/restapi/sensor/inter_beat_interval.avsc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "namespace": "org.radarcns.avro.restapi.sensor", - "type": "record", - "name": "InterBeatInterval", - "doc": "Time between individuals heart beats", - "fields": [ - {"name": "value", "type": [ "double" , "org.radarcns.avro.restapi.dataset.Quartiles" ]} - ] -} diff --git a/restapi/sensor/sensor_type.avsc b/restapi/sensor/sensor_type.avsc index 48d6e3df..83945dd0 100644 --- a/restapi/sensor/sensor_type.avsc +++ b/restapi/sensor/sensor_type.avsc @@ -2,7 +2,7 @@ "namespace": "org.radarcns.avro.restapi.sensor", "type": "enum", "name": "SensorType", - "doc": "Set of sensor type", + "doc": "Sensor types", "symbols": [ "ACCELEROMETER" , "BATTERY", diff --git a/restapi/sensor/temperature.avsc b/restapi/sensor/temperature.avsc deleted file mode 100644 index 5852e4bf..00000000 --- a/restapi/sensor/temperature.avsc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "namespace": "org.radarcns.avro.restapi.sensor", - "type": "record", - "name": "Temperature", - "doc": "Temperature value expressed in Celsius (°C) scale", - "fields": [ - {"name": "value", "type": [ "double" , "org.radarcns.avro.restapi.dataset.Quartiles" ]} - ] -} diff --git a/restapi/sensor/unit.avsc b/restapi/sensor/unit.avsc index 239b088e..1f0a7709 100644 --- a/restapi/sensor/unit.avsc +++ b/restapi/sensor/unit.avsc @@ -2,7 +2,7 @@ "namespace": "org.radarcns.avro.restapi.sensor", "type": "enum", "name": "Unit", - "doc": "Set of measurement units", + "doc": "Measurement units", "symbols": [ "BEATS_PER_MIN" , "CELSIUS", From 9c02593a41bfad15395b1fa8e87cb25d72437926 Mon Sep 17 00:00:00 2001 From: Francesco Nobilia Date: Fri, 28 Apr 2017 16:26:19 +0100 Subject: [PATCH 03/34] Renamed DoubleValue to DoubleSample --- restapi/data/{double_value.avsc => double_sample.avsc} | 2 +- restapi/dataset/item.avsc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename restapi/data/{double_value.avsc => double_sample.avsc} (91%) diff --git a/restapi/data/double_value.avsc b/restapi/data/double_sample.avsc similarity index 91% rename from restapi/data/double_value.avsc rename to restapi/data/double_sample.avsc index a1430957..422437d8 100644 --- a/restapi/data/double_value.avsc +++ b/restapi/data/double_sample.avsc @@ -1,7 +1,7 @@ { "namespace": "org.radarcns.avro.restapi.data", "type": "record", - "name": "DoubleValue", + "name": "DoubleSample", "doc": "Generic sample represented by a double value. A specific schema is provided to represent quartile values.", "fields": [ {"name": "value", "type": [ "double" , "org.radarcns.avro.restapi.data.Quartiles" ]} diff --git a/restapi/dataset/item.avsc b/restapi/dataset/item.avsc index 9babe865..a5f6bd90 100644 --- a/restapi/dataset/item.avsc +++ b/restapi/dataset/item.avsc @@ -5,7 +5,7 @@ "doc": "Dataset item. It contains a value and its related time.", "fields": [ {"name": "sample", "type": [ - "org.radarcns.avro.restapi.data.DoubleValue" , + "org.radarcns.avro.restapi.data.DoubleSample" , "org.radarcns.avro.restapi.data.Acceleration" ] } , {"name": "startDateTime", "type": "string", "doc": "It is a point in time (ISO8601) with UTC timezone."} From 592e65de4acef3e4bb00fcdad89c3f608b2502c1 Mon Sep 17 00:00:00 2001 From: Francesco Nobilia Date: Tue, 9 May 2017 16:30:28 +0100 Subject: [PATCH 04/34] Added documentation --- java-sdk/build.gradle | 2 +- restapi/app/application.avsc | 4 +++- restapi/app/server_status.avsc | 8 ++++++-- restapi/data/acceleration.avsc | 8 ++++---- restapi/data/double_sample.avsc | 2 +- restapi/data/quartiles.avsc | 6 +++--- restapi/dataset/dataset.avsc | 6 +++--- restapi/dataset/item.avsc | 4 ++-- restapi/header/header.avsc | 8 ++++---- restapi/message.avsc | 2 +- restapi/sensor/data_type.avsc | 2 +- restapi/source/source.avsc | 6 +++--- restapi/user/patient.avsc | 2 +- 13 files changed, 33 insertions(+), 27 deletions(-) diff --git a/java-sdk/build.gradle b/java-sdk/build.gradle index 654a428d..52a69d65 100644 --- a/java-sdk/build.gradle +++ b/java-sdk/build.gradle @@ -15,7 +15,7 @@ subprojects { apply plugin: 'maven-publish' // Configuration - version = '0.1.1-SNAPSHOT' + version = '0.1.1-alpha.1' group = 'org.radarcns' ext.githubRepoName = 'RADAR-CNS/RADAR-Schemas' diff --git a/restapi/app/application.avsc b/restapi/app/application.avsc index 29784b15..ac971d4e 100644 --- a/restapi/app/application.avsc +++ b/restapi/app/application.avsc @@ -4,7 +4,9 @@ "name": "Application", "doc": "Smartphone application status", "fields": [ - {"name": "ipAddress", "type": ["null", "string"], "doc": "Hardware identifier of client application", "default": null}, + {"name": "ipAddress", "type": [ + "null", + "string" ], "doc": "Hardware identifier of client application", "default": null}, {"name": "uptime", "type": "double", "doc": "Time since last app start (s)"}, {"name": "serverStatus", "type": "ServerStatus", "doc": "server connection status", "default": "UNKNOWN"}, {"name": "recordsCached", "type": "int", "doc": "number of records currently being cached", "default": -1}, diff --git a/restapi/app/server_status.avsc b/restapi/app/server_status.avsc index 0a48935a..286ebf86 100644 --- a/restapi/app/server_status.avsc +++ b/restapi/app/server_status.avsc @@ -2,6 +2,10 @@ "namespace": "org.radarcns.avro.restapi.app", "type": "enum", "name": "ServerStatus", - "doc": "Set of device status", - "symbols": [ "CONNECTED" , "DISCONNECTED", "UNKNOWN" ] + "doc": "Set of connection status between smartphone app and the RADAR-CNS Platform.", + "symbols": [ + "CONNECTED" , + "DISCONNECTED", + "UNKNOWN" + ] } diff --git a/restapi/data/acceleration.avsc b/restapi/data/acceleration.avsc index 4f32b365..6dc1fcf3 100644 --- a/restapi/data/acceleration.avsc +++ b/restapi/data/acceleration.avsc @@ -2,10 +2,10 @@ "namespace": "org.radarcns.avro.restapi.data", "type": "record", "name": "Acceleration", - "doc": "Acceleration item for a dataset with gravitational constant g as unit.", + "doc": "Acceleration sample with gravitational constant g as unit.", "fields": [ - {"name": "x", "type": [ "double" , "org.radarcns.avro.restapi.data.Quartiles" ]}, - {"name": "y", "type": [ "double" , "org.radarcns.avro.restapi.data.Quartiles" ]}, - {"name": "z", "type": [ "double" , "org.radarcns.avro.restapi.data.Quartiles" ]} + {"name": "x", "type": [ "double" , "org.radarcns.avro.restapi.data.Quartiles" ], "doc": "acceleration in the x-axis (g)"}, + {"name": "y", "type": [ "double" , "org.radarcns.avro.restapi.data.Quartiles" ], "doc": "acceleration in the y-axis (g)"}, + {"name": "z", "type": [ "double" , "org.radarcns.avro.restapi.data.Quartiles" ], "doc": "acceleration in the z-axis (g)"} ] } diff --git a/restapi/data/double_sample.avsc b/restapi/data/double_sample.avsc index 422437d8..b8f631e0 100644 --- a/restapi/data/double_sample.avsc +++ b/restapi/data/double_sample.avsc @@ -4,6 +4,6 @@ "name": "DoubleSample", "doc": "Generic sample represented by a double value. A specific schema is provided to represent quartile values.", "fields": [ - {"name": "value", "type": [ "double" , "org.radarcns.avro.restapi.data.Quartiles" ]} + {"name": "value", "type": [ "double" , "org.radarcns.avro.restapi.data.Quartiles" ], "doc": "sample value"} ] } diff --git a/restapi/data/quartiles.avsc b/restapi/data/quartiles.avsc index 318e2879..5690710d 100644 --- a/restapi/data/quartiles.avsc +++ b/restapi/data/quartiles.avsc @@ -4,8 +4,8 @@ "name": "Quartiles", "doc": "List of quartiles", "fields": [ - {"name": "first", "type": "double"}, - {"name": "second", "type": "double"}, - {"name": "third", "type": "double"} + {"name": "first", "type": "double", "doc": "the middle number between the smallest number and the median of the data set"}, + {"name": "second", "type": "double", "doc": "the median of the data"}, + {"name": "third", "type": "double", "doc": "the middle value between the median and the highest value of the data set"} ] } diff --git a/restapi/dataset/dataset.avsc b/restapi/dataset/dataset.avsc index 9d59e87b..05ad8e83 100644 --- a/restapi/dataset/dataset.avsc +++ b/restapi/dataset/dataset.avsc @@ -2,9 +2,9 @@ "namespace": "org.radarcns.avro.restapi.dataset", "type": "record", "name": "Dataset", - "doc": "A generic dataset containing aggregated data. Its body is divide in Header and Dataset: metadata and sensor data.", + "doc": "A generic collection of samples. Its body is divide in Header and Dataset: metadata and sensor data.", "fields": [ - {"name": "header", "type": "org.radarcns.avro.restapi.header.Header" }, - {"name": "dataset", "type": {"type": "array", "items": "Item" } } + {"name": "header", "type": "org.radarcns.avro.restapi.header.Header", "doc": "Information useful to contextualise the data set"}, + {"name": "dataset", "type": {"type": "array", "items": "Item" }, "doc": "Collection of samples"} ] } diff --git a/restapi/dataset/item.avsc b/restapi/dataset/item.avsc index a5f6bd90..fa205495 100644 --- a/restapi/dataset/item.avsc +++ b/restapi/dataset/item.avsc @@ -7,7 +7,7 @@ {"name": "sample", "type": [ "org.radarcns.avro.restapi.data.DoubleSample" , "org.radarcns.avro.restapi.data.Acceleration" - ] } , - {"name": "startDateTime", "type": "string", "doc": "It is a point in time (ISO8601) with UTC timezone."} + ], "doc": "Sample value. For more details, check DoubleSample and Acceleration" } , + {"name": "startDateTime", "type": "string", "doc": "Point in time (ISO8601) with UTC timezone. It represents the timestamp of the first sample contained inside the aggregated data."} ] } diff --git a/restapi/header/header.avsc b/restapi/header/header.avsc index 05c370fb..5015789a 100644 --- a/restapi/header/header.avsc +++ b/restapi/header/header.avsc @@ -4,9 +4,9 @@ "name": "Header", "doc": "Metadata for Dataset. It is a summary explaining what kind of information are stored in the Dataset.", "fields": [ - {"name": "descriptiveStatistic", "type": "DescriptiveStatistic" }, - {"name": "unit", "type": "org.radarcns.avro.restapi.sensor.Unit"}, - {"name": "timeFrame", "type": "TimeFrame"}, - {"name": "effectiveTimeFrame", "type": "EffectiveTimeFrame" } + {"name": "descriptiveStatistic", "type": "DescriptiveStatistic", "doc": "Statical value expressed by samples" }, + {"name": "unit", "type": "org.radarcns.avro.restapi.sensor.Unit", "doc": "Measurement unit with which samples are measured" }, + {"name": "timeFrame", "type": "TimeFrame", "doc": "Time interval between two consecutive samples" }, + {"name": "effectiveTimeFrame", "type": "EffectiveTimeFrame", "doc": "Timestamps of the first and the last samples contained in the dataset" } ] } diff --git a/restapi/message.avsc b/restapi/message.avsc index f0c07ea0..3e48342c 100644 --- a/restapi/message.avsc +++ b/restapi/message.avsc @@ -2,7 +2,7 @@ "namespace": "org.radarcns.avro.restapi.avro", "type": "record", "name": "Message", - "doc": "Message to describe HTTP Response", + "doc": "Message to provide information to the end user in case a function does not provide the expected result", "fields": [ {"name": "message", "type": "string"} ] diff --git a/restapi/sensor/data_type.avsc b/restapi/sensor/data_type.avsc index 67db33b9..d41c74d1 100644 --- a/restapi/sensor/data_type.avsc +++ b/restapi/sensor/data_type.avsc @@ -2,7 +2,7 @@ "namespace": "org.radarcns.avro.restapi.sensor", "type": "enum", "name": "DataType", - "doc": "States if the value is provided directly by a sensor or it is computed. Any value different from RAW states who computes the value.", + "doc": "States if a sample is recorded directly by a sensor or it is computed. Any value different from RAW states who computes the value.", "symbols": [ "RAW" , "VENDOR", diff --git a/restapi/source/source.avsc b/restapi/source/source.avsc index deb2e67b..b1ea6c03 100644 --- a/restapi/source/source.avsc +++ b/restapi/source/source.avsc @@ -4,8 +4,8 @@ "name": "Source", "doc": "Source details", "fields": [ - {"name": "id", "type": "string", "doc": "Source id"}, - {"name": "type", "type": "SourceType", "doc": "Source name"}, - {"name": "summary", "type": ["null", "SourceSummary"], "default": null, "doc": "Source details"} + {"name": "id", "type": "string", "doc": "Source identifier" }, + {"name": "type", "type": "SourceType", "doc": "Source name" }, + {"name": "summary", "type": ["null", "SourceSummary"], "default": null, "doc": "Source details" } ] } diff --git a/restapi/user/patient.avsc b/restapi/user/patient.avsc index c575110a..2d74c37a 100644 --- a/restapi/user/patient.avsc +++ b/restapi/user/patient.avsc @@ -5,6 +5,6 @@ "doc": "Patient definition", "fields": [ {"name": "userId", "type": "string", "doc": "User identifier"}, - {"name": "sources", "type": {"type": "array", "items": "org.radarcns.avro.restapi.source.Source" }, "doc": "List of all sources used by the Patient"} + {"name": "sources", "type": {"type": "array", "items": "org.radarcns.avro.restapi.source.Source" }, "doc": "List of sources used by the patient"} ] } From 57459fc0ab37b7299a84bc3c12bf098b0f3cab7b Mon Sep 17 00:00:00 2001 From: Francesco Nobilia Date: Wed, 10 May 2017 15:55:40 +0100 Subject: [PATCH 05/34] New Dataset Header --- restapi/header/header.avsc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/restapi/header/header.avsc b/restapi/header/header.avsc index 5015789a..29870e52 100644 --- a/restapi/header/header.avsc +++ b/restapi/header/header.avsc @@ -4,6 +4,10 @@ "name": "Header", "doc": "Metadata for Dataset. It is a summary explaining what kind of information are stored in the Dataset.", "fields": [ + {"name": "patientId", "type": "string", "doc": "User identifier"}, + {"name": "sourceId", "type": "string", "doc": "Source identifier"}, + {"name": "source", "type": "org.radarcns.avro.restapi.source.SourceType", "doc": "Source type"}, + {"name": "sensor", "type": "org.radarcns.avro.restapi.sensor.SensorType", "doc": "Sensor that has generated data"}, {"name": "descriptiveStatistic", "type": "DescriptiveStatistic", "doc": "Statical value expressed by samples" }, {"name": "unit", "type": "org.radarcns.avro.restapi.sensor.Unit", "doc": "Measurement unit with which samples are measured" }, {"name": "timeFrame", "type": "TimeFrame", "doc": "Time interval between two consecutive samples" }, From cc896d806a575728a3406809bbeca27731c80371 Mon Sep 17 00:00:00 2001 From: Maxim Moinat Date: Tue, 16 May 2017 16:39:33 +0200 Subject: [PATCH 06/34] added phone_usage_event schema --- commons/phone/phone_usage_event.avsc | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 commons/phone/phone_usage_event.avsc diff --git a/commons/phone/phone_usage_event.avsc b/commons/phone/phone_usage_event.avsc new file mode 100644 index 00000000..5c443441 --- /dev/null +++ b/commons/phone/phone_usage_event.avsc @@ -0,0 +1,13 @@ +{ + "namespace": "org.radarcns.phone", + "type": "record", + "name": "PhoneUsageEvent", + "doc": "Event for closing or opening an app", + "fields": [ + {"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"}, + {"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"}, + {"name": "packageName", "type": "string", "doc": "package name of the launched app"}, + {"name": "categoryName", "type": "string", "doc": "app category as given by the play store"}, + {"name": "eventType", "type": {"name": "UsageEventType", "type": "enum", "symbols": ["FOREGROUND", "BACKGROUND", "OTHER"]}, "doc": "whether the event brought app to foreground or background or neither"} + ] +} From 685ba6c6fd367c00bbbf2274c70f62c75fd5a3cf Mon Sep 17 00:00:00 2001 From: Sebastian Boettcher Date: Thu, 18 May 2017 18:31:00 +0200 Subject: [PATCH 07/34] biovotion: added vsm_ppg_raw schema --- commons/biovotion/biovotion_vsm_led_current.avsc | 2 +- commons/biovotion/biovotion_vsm_ppg_raw.avsc | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 commons/biovotion/biovotion_vsm_ppg_raw.avsc diff --git a/commons/biovotion/biovotion_vsm_led_current.avsc b/commons/biovotion/biovotion_vsm_led_current.avsc index 58711f17..77bdc169 100644 --- a/commons/biovotion/biovotion_vsm_led_current.avsc +++ b/commons/biovotion/biovotion_vsm_led_current.avsc @@ -2,7 +2,7 @@ "namespace": "org.radarcns.biovotion", "type": "record", "name": "BiovotionVSMLedCurrent", - "doc": "Data from red, green and ir leds (PPG raw data).", + "doc": "Applied current for red, green and ir leds.", "fields": [ {"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"}, {"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"}, diff --git a/commons/biovotion/biovotion_vsm_ppg_raw.avsc b/commons/biovotion/biovotion_vsm_ppg_raw.avsc new file mode 100644 index 00000000..e34f9dd6 --- /dev/null +++ b/commons/biovotion/biovotion_vsm_ppg_raw.avsc @@ -0,0 +1,14 @@ +{ + "namespace": "org.radarcns.biovotion", + "type": "record", + "name": "BiovotionVSMPhotoRaw", + "doc": "Raw 14bit Photodiode ADC data for red, green, IR and dark portions (PPG raw data).", + "fields": [ + {"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"}, + {"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"}, + {"name": "red", "type": "float", "doc": "raw red light ADC response (normalized)"}, + {"name": "green", "type": "float", "doc": "raw green light ADC response (normalized)"}, + {"name": "ir", "type": "float", "doc": "raw IR light ADC response (normalized)"}, + {"name": "dark", "type": "float", "doc": "raw dark light ADC response (normalized)"} + ] +} From 6ce2ff936e441a2be8d9f567dd45b0339665f3cd Mon Sep 17 00:00:00 2001 From: Francesco Nobilia Date: Fri, 19 May 2017 16:18:45 +0100 Subject: [PATCH 08/34] Added the definition of subject --- restapi/header/descriptive_statistic.avsc | 3 ++- restapi/subject/cohort.avsc | 10 ++++++++++ restapi/subject/subject.avsc | 12 ++++++++++++ restapi/user/cohort.avsc | 10 ---------- restapi/user/patient.avsc | 10 ---------- 5 files changed, 24 insertions(+), 21 deletions(-) create mode 100644 restapi/subject/cohort.avsc create mode 100644 restapi/subject/subject.avsc delete mode 100644 restapi/user/cohort.avsc delete mode 100644 restapi/user/patient.avsc diff --git a/restapi/header/descriptive_statistic.avsc b/restapi/header/descriptive_statistic.avsc index 3b683f9a..abe0d841 100644 --- a/restapi/header/descriptive_statistic.avsc +++ b/restapi/header/descriptive_statistic.avsc @@ -13,6 +13,7 @@ "INTERQUARTILE_RANGE" , "LOWER_QUARTILE" , "UPPER_QUARTILE", - "QUARTILES" + "QUARTILES", + "DELIVERY_RATE" ] } diff --git a/restapi/subject/cohort.avsc b/restapi/subject/cohort.avsc new file mode 100644 index 00000000..ee6b39a6 --- /dev/null +++ b/restapi/subject/cohort.avsc @@ -0,0 +1,10 @@ +{ + "namespace": "org.radarcns.avro.restapi.subject", + "type": "record", + "name": "Cohort", + "doc": "Cohort definition", + "fields": [ + {"name": "studyId", "type": "int", "doc": "ID related to the study"}, + {"name": "subjects", "type": {"type": "array", "items": "Subject" }, "doc": "List of Subject involved in the study"} + ] +} diff --git a/restapi/subject/subject.avsc b/restapi/subject/subject.avsc new file mode 100644 index 00000000..974d74e9 --- /dev/null +++ b/restapi/subject/subject.avsc @@ -0,0 +1,12 @@ +{ + "namespace": "org.radarcns.avro.restapi.subject", + "type": "record", + "name": "Subject", + "doc": "Subject definition", + "fields": [ + {"name": "subjectId", "type": "string", "doc": "Subject identifier"}, + {"name": "active", "type": "boolean", "doc": "True if the subject is engaged, false otherwise. False means the subject is no longer monitored" }, + {"name": "effectiveTimeFrame", "type": "org.radarcns.avro.restapi.header.EffectiveTimeFrame", "doc": "Timestamps of the first and the last samples received by the subject" }, + {"name": "sources", "type": {"type": "array", "items": "org.radarcns.avro.restapi.source.Source" }, "doc": "List of sources used by the patient"} + ] +} diff --git a/restapi/user/cohort.avsc b/restapi/user/cohort.avsc deleted file mode 100644 index 5e44c7fc..00000000 --- a/restapi/user/cohort.avsc +++ /dev/null @@ -1,10 +0,0 @@ -{ - "namespace": "org.radarcns.avro.restapi.user", - "type": "record", - "name": "Cohort", - "doc": "Cohort definition", - "fields": [ - {"name": "studyId", "type": "int", "doc": "ID related to the study"}, - {"name": "patients", "type": {"type": "array", "items": "Patient" }, "doc": "List of patients involved in the study"} - ] -} diff --git a/restapi/user/patient.avsc b/restapi/user/patient.avsc deleted file mode 100644 index 2d74c37a..00000000 --- a/restapi/user/patient.avsc +++ /dev/null @@ -1,10 +0,0 @@ -{ - "namespace": "org.radarcns.avro.restapi.user", - "type": "record", - "name": "Patient", - "doc": "Patient definition", - "fields": [ - {"name": "userId", "type": "string", "doc": "User identifier"}, - {"name": "sources", "type": {"type": "array", "items": "org.radarcns.avro.restapi.source.Source" }, "doc": "List of sources used by the patient"} - ] -} From 6ca579ff385bbba0d40b82d1a949a0ce0eeea7c2 Mon Sep 17 00:00:00 2001 From: Francesco Nobilia Date: Tue, 23 May 2017 10:51:07 +0100 Subject: [PATCH 09/34] Removed patient form header --- restapi/header/header.avsc | 2 +- restapi/subject/subject.avsc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/restapi/header/header.avsc b/restapi/header/header.avsc index 29870e52..06bf7908 100644 --- a/restapi/header/header.avsc +++ b/restapi/header/header.avsc @@ -4,7 +4,7 @@ "name": "Header", "doc": "Metadata for Dataset. It is a summary explaining what kind of information are stored in the Dataset.", "fields": [ - {"name": "patientId", "type": "string", "doc": "User identifier"}, + {"name": "subjectId", "type": "string", "doc": "Subject identifier"}, {"name": "sourceId", "type": "string", "doc": "Source identifier"}, {"name": "source", "type": "org.radarcns.avro.restapi.source.SourceType", "doc": "Source type"}, {"name": "sensor", "type": "org.radarcns.avro.restapi.sensor.SensorType", "doc": "Sensor that has generated data"}, diff --git a/restapi/subject/subject.avsc b/restapi/subject/subject.avsc index 974d74e9..6cc7c283 100644 --- a/restapi/subject/subject.avsc +++ b/restapi/subject/subject.avsc @@ -7,6 +7,6 @@ {"name": "subjectId", "type": "string", "doc": "Subject identifier"}, {"name": "active", "type": "boolean", "doc": "True if the subject is engaged, false otherwise. False means the subject is no longer monitored" }, {"name": "effectiveTimeFrame", "type": "org.radarcns.avro.restapi.header.EffectiveTimeFrame", "doc": "Timestamps of the first and the last samples received by the subject" }, - {"name": "sources", "type": {"type": "array", "items": "org.radarcns.avro.restapi.source.Source" }, "doc": "List of sources used by the patient"} + {"name": "sources", "type": {"type": "array", "items": "org.radarcns.avro.restapi.source.Source" }, "doc": "List of sources used by the subject"} ] } From a2164bd81c855be4a3a95c0d4b32ee8d92307335 Mon Sep 17 00:00:00 2001 From: Francesco Nobilia Date: Tue, 23 May 2017 10:51:38 +0100 Subject: [PATCH 10/34] DELIVERY_RATE changed in RECEIVED_MESSAGES --- restapi/header/descriptive_statistic.avsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/restapi/header/descriptive_statistic.avsc b/restapi/header/descriptive_statistic.avsc index abe0d841..adf716c7 100644 --- a/restapi/header/descriptive_statistic.avsc +++ b/restapi/header/descriptive_statistic.avsc @@ -14,6 +14,6 @@ "LOWER_QUARTILE" , "UPPER_QUARTILE", "QUARTILES", - "DELIVERY_RATE" + "RECEIVED_MESSAGES" ] } From 0ca0354ff47e6e266861adfd278e36348306d49a Mon Sep 17 00:00:00 2001 From: Francesco Nobilia Date: Tue, 30 May 2017 15:27:28 +0100 Subject: [PATCH 11/34] Changed jar location for travis --- .travis.yml | 5 ++++- java-sdk/build.gradle | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4c12c17e..242767ec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ deploy: provider: releases api_key: ${GH_TOKEN} file_glob: true - file: "${TRAVIS_BUILD_DIR}/java-sdk/build/libs/*.jar" + file: "*/build/libs/*.jar" skip_cleanup: true on: tags: true @@ -16,5 +16,8 @@ deploy: before_install: - cd java-sdk +before_deploy: + - pwd + after_deploy: - ./gradlew bintrayUpload diff --git a/java-sdk/build.gradle b/java-sdk/build.gradle index 52a69d65..a5afb848 100644 --- a/java-sdk/build.gradle +++ b/java-sdk/build.gradle @@ -15,7 +15,7 @@ subprojects { apply plugin: 'maven-publish' // Configuration - version = '0.1.1-alpha.1' + version = '0.1.1-alpha.2' group = 'org.radarcns' ext.githubRepoName = 'RADAR-CNS/RADAR-Schemas' From 3bdadabf05af78cde972e6f9a3f34c20e40fa59f Mon Sep 17 00:00:00 2001 From: Maxim Moinat Date: Tue, 16 May 2017 17:01:05 +0200 Subject: [PATCH 12/34] added event types --- commons/phone/phone_usage_event.avsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commons/phone/phone_usage_event.avsc b/commons/phone/phone_usage_event.avsc index 5c443441..44fab4a3 100644 --- a/commons/phone/phone_usage_event.avsc +++ b/commons/phone/phone_usage_event.avsc @@ -8,6 +8,6 @@ {"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"}, {"name": "packageName", "type": "string", "doc": "package name of the launched app"}, {"name": "categoryName", "type": "string", "doc": "app category as given by the play store"}, - {"name": "eventType", "type": {"name": "UsageEventType", "type": "enum", "symbols": ["FOREGROUND", "BACKGROUND", "OTHER"]}, "doc": "whether the event brought app to foreground or background or neither"} + {"name": "eventType", "type": {"name": "UsageEventType", "type": "enum", "symbols": ["FOREGROUND", "BACKGROUND", "CONFIG", "SHORTCUT", "INTERACTION", "NONE"]}, "doc": "whether the event brought app to foreground or background or neither"} ] } From 68860148c2d12fb3e49822db1e836868d01bbfce Mon Sep 17 00:00:00 2001 From: Maxim Moinat Date: Fri, 9 Jun 2017 15:33:09 +0200 Subject: [PATCH 13/34] renamed lockState to interactionState --- commons/phone/phone_user_interaction.avsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commons/phone/phone_user_interaction.avsc b/commons/phone/phone_user_interaction.avsc index 29f8c10d..a32fbc12 100644 --- a/commons/phone/phone_user_interaction.avsc +++ b/commons/phone/phone_user_interaction.avsc @@ -6,6 +6,6 @@ "fields": [ {"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"}, {"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"}, - {"name": "lockState", "type": {"name": "PhoneLockState", "type": "enum", "symbols": ["STANDBY", "UNLOCKED"]}, "doc": "what lock state the phone has"} + {"name": "interactionState", "type": {"name": "PhoneInteractionState", "type": "enum", "symbols": ["STANDBY", "UNLOCKED","SHUTDOWN"]}, "doc": "what interaction state the phone has"} ] -} \ No newline at end of file +} From 9a7064695ec2c558f0935558d52bc64cb06b3755 Mon Sep 17 00:00:00 2001 From: "Abhishek G.L" Date: Sun, 11 Jun 2017 19:22:42 +0200 Subject: [PATCH 14/34] schema for aRMT submit questionare added --- questionnaire/aRMT_submit_questionare.avsc | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 questionnaire/aRMT_submit_questionare.avsc diff --git a/questionnaire/aRMT_submit_questionare.avsc b/questionnaire/aRMT_submit_questionare.avsc new file mode 100644 index 00000000..2d39c87d --- /dev/null +++ b/questionnaire/aRMT_submit_questionare.avsc @@ -0,0 +1,42 @@ +{ + "namespace": "org.radarcns.questionnaire", + "name": "Phq", + "doc": "Phq questionnaire", + "type": "record", + "fields": [{ + "name": "questionnaireId", + "type": "int", + "doc": "Questionnaire identifier" + }, { + "name": "answers", + "type": { + "type": "array", + "items": { + "type": "record", + "doc": "Questionnaire answer", + "fields": [{ + "name": "value", + "type": ["string", "int"], + "doc": "Subject answer" + }, { + "name": "startTime", + "type": "int", + "doc": "timestamp in UTC (s) when the question is shown" + }, { + "name": "endTime", + "type": "int", + "doc": "timestamp in UTC (s) when the question is answered" + }] + } + }, + "doc": "Answers List" + }, { + "name": "startTime", + "type": "int", + "doc": "timestamp in UTC (s) when the questionnaire is submitted to the subject" + }, { + "name": "endTime", + "type": "int", + "doc": "timestamp in UTC (s) when the questionnaire is sent out to the platform" + }] +} \ No newline at end of file From d6c092a979122387fd6ba61bdeaf2bd0bc551079 Mon Sep 17 00:00:00 2001 From: "Abhishek G.L" Date: Sun, 11 Jun 2017 19:27:30 +0200 Subject: [PATCH 15/34] schema for aRMT submit questionare added --- questionnaire/aRMT_submit_questionare.avsc | 1 + 1 file changed, 1 insertion(+) diff --git a/questionnaire/aRMT_submit_questionare.avsc b/questionnaire/aRMT_submit_questionare.avsc index 2d39c87d..a9b4fc3f 100644 --- a/questionnaire/aRMT_submit_questionare.avsc +++ b/questionnaire/aRMT_submit_questionare.avsc @@ -12,6 +12,7 @@ "type": { "type": "array", "items": { + "name":"Answer", "type": "record", "doc": "Questionnaire answer", "fields": [{ From 2f313b5e3499ca6a36224bc6ab69745e27071a5c Mon Sep 17 00:00:00 2001 From: Maximilian Kerz Date: Tue, 13 Jun 2017 11:07:04 +0200 Subject: [PATCH 16/34] Questionnaire config specifications --- questionnaire/specification/DEMO_config.json | 42 ++++++ questionnaire/specification/PHQ8_config.json | 149 +++++++++++++++++++ 2 files changed, 191 insertions(+) create mode 100644 questionnaire/specification/DEMO_config.json create mode 100644 questionnaire/specification/PHQ8_config.json diff --git a/questionnaire/specification/DEMO_config.json b/questionnaire/specification/DEMO_config.json new file mode 100644 index 00000000..958d0154 --- /dev/null +++ b/questionnaire/specification/DEMO_config.json @@ -0,0 +1,42 @@ +{ + "name" : "DEMO", + "version": 1, + "estimatedCompletionTime" : 2, + "startText" : "Here you can test some all available input types.", + "endText" : "Thanks for giving it a try.", + "protocol" : { + "reminders" : { + "amount" : 15, + "repeat" : 1, + "unit" : "min" + }, + "repeatProtocol" : { + "amount" : 2, + "unit" : "week" + }, + "repeatQuestionnaire" : { + "unit" : "min", + "unitsFromZero" : [ 450, 600, 1890, 2004 ] + } + }, + "questions" : [ { + "content" : "The slider as fine-grained input.", + "id" : "Test-0", + "lead" : "Some other input types.", + "range" : { + "max" : 100, + "min" : 0, + "step" : 5 + }, + "type" : "slider" + }, { + "content" : "The multiple values for a smaller range.", + "id" : "Test-2", + "lead" : "Some other input types.", + "range" : { + "max" : 7, + "min" : 1 + }, + "type" : "range" + } ] +} diff --git a/questionnaire/specification/PHQ8_config.json b/questionnaire/specification/PHQ8_config.json new file mode 100644 index 00000000..0f30d94e --- /dev/null +++ b/questionnaire/specification/PHQ8_config.json @@ -0,0 +1,149 @@ +{ + "name" : "PHQ8", + "version": 1, + "estimatedCompletionTime" : 7, + "startText" : "This questionnaire is known as the PHQ8. Clinicians use it to assess current depression in patients. Thank you for taking part in this focus group.", + "endText" : "Thank you for partcipating today.", + "protocol" : { + "reminders" : { + "amount" : 15, + "repeat" : 2, + "unit" : "min" + }, + "repeatProtocol" : { + "amount" : 1, + "unit" : "month" + }, + "repeatQuestionnaire" : { + "unit" : "min", + "unitsFromZero" : [ 600 ] + } + }, + "questions" : [ { + "content" : "Little interest or pleasure in doing things.", + "id" : "PHQ8-0", + "lead" : "Over the past two weeks, how often have you been bothered by any of the following problems?", + "responses" : [ { + "response" : "Not at all", + "score" : 0 + }, { + "response" : "Several days", + "score" : 1 + }, { + "response" : "More than half the days", + "score" : 2 + }, { + "response" : "Nearly every day", + "score" : 3 + } ], + "type" : "radio" + }, { + "content" : "Feeling down, depressed, or hopeless.", + "id" : "PHQ8-1", + "lead" : "Over the past two weeks, how often have you been bothered by any of the following problems?", + "responses" : [ { + "response" : "Not at all", + "score" : 0 + }, { + "response" : "Several days", + "score" : 1 + }, { + "response" : "More than half the days", + "score" : 2 + }, { + "response" : "Nearly every day", + "score" : 3 + } ], + "type" : "radio" + }, { + "content" : "Trouble falling asleep or staying asleep, or sleeping too much.", + "id" : "PHQ8-2", + "lead" : "Over the past two weeks, how often have you been bothered by any of the following problems?", + "responses" : [ { + "response" : "Not at all", + "score" : 0 + }, { + "response" : "Several days", + "score" : 1 + }, { + "response" : "More than half the days", + "score" : 2 + }, { + "response" : "Nearly every day", + "score" : 3 + } ], + "type" : "radio" + }, { + "content" : "Feeling tired or having little energy.", + "id" : "PHQ8-3", + "lead" : "Over the past two weeks, how often have you been bothered by any of the following problems?", + "responses" : [ { + "response" : "Not at all", + "score" : 0 + }, { + "response" : "Several days", + "score" : 1 + }, { + "response" : "More than half the days", + "score" : 2 + }, { + "response" : "Nearly every day", + "score" : 3 + } ], + "type" : "radio" + }, { + "content" : "Feeling bad about yourself – or that you are a failure or have let yourself or your family down.", + "id" : "PHQ8-4", + "lead" : "Over the past two weeks, how often have you been bothered by any of the following problems?", + "responses" : [ { + "response" : "Not at all", + "score" : 0 + }, { + "response" : "Several days", + "score" : 1 + }, { + "response" : "More than half the days", + "score" : 2 + }, { + "response" : "Nearly every day", + "score" : 3 + } ], + "type" : "radio" + }, { + "content" : "Trouble concentrating on things such as reading the newspaper of watching television.", + "id" : "PHQ8-5", + "lead" : "Over the past two weeks, how often have you been bothered by any of the following problems?", + "responses" : [ { + "response" : "Not at all", + "score" : 0 + }, { + "response" : "Several days", + "score" : 1 + }, { + "response" : "More than half the days", + "score" : 2 + }, { + "response" : "Nearly every day", + "score" : 3 + } ], + "type" : "radio" + }, { + "content" : "Moving or speaking so slowly that other people have noticed. Or the opposite – being so fidgety or restless that you have been moving around a lot more than usual.", + "id" : "PHQ8-6", + "lead" : "Over the past two weeks, how often have you been bothered by any of the following problems?", + "responses" : [ { + "response" : "Not at all", + "score" : 0 + }, { + "response" : "Several days", + "score" : 1 + }, { + "response" : "More than half the days", + "score" : 2 + }, { + "response" : "Nearly every day", + "score" : 3 + } ], + "type" : "radio" + } ] +} From cd074dd81c76b5bc05d44e0d6a204816d73de918 Mon Sep 17 00:00:00 2001 From: Francesco Nobilia Date: Tue, 13 Jun 2017 11:22:16 +0100 Subject: [PATCH 17/34] General questionnaire schema --- questionnaire/aRMT_submit_questionare.avsc | 43 ---------------------- questionnaire/questionare.avsc | 28 ++++++++++++++ 2 files changed, 28 insertions(+), 43 deletions(-) delete mode 100644 questionnaire/aRMT_submit_questionare.avsc create mode 100644 questionnaire/questionare.avsc diff --git a/questionnaire/aRMT_submit_questionare.avsc b/questionnaire/aRMT_submit_questionare.avsc deleted file mode 100644 index a9b4fc3f..00000000 --- a/questionnaire/aRMT_submit_questionare.avsc +++ /dev/null @@ -1,43 +0,0 @@ -{ - "namespace": "org.radarcns.questionnaire", - "name": "Phq", - "doc": "Phq questionnaire", - "type": "record", - "fields": [{ - "name": "questionnaireId", - "type": "int", - "doc": "Questionnaire identifier" - }, { - "name": "answers", - "type": { - "type": "array", - "items": { - "name":"Answer", - "type": "record", - "doc": "Questionnaire answer", - "fields": [{ - "name": "value", - "type": ["string", "int"], - "doc": "Subject answer" - }, { - "name": "startTime", - "type": "int", - "doc": "timestamp in UTC (s) when the question is shown" - }, { - "name": "endTime", - "type": "int", - "doc": "timestamp in UTC (s) when the question is answered" - }] - } - }, - "doc": "Answers List" - }, { - "name": "startTime", - "type": "int", - "doc": "timestamp in UTC (s) when the questionnaire is submitted to the subject" - }, { - "name": "endTime", - "type": "int", - "doc": "timestamp in UTC (s) when the questionnaire is sent out to the platform" - }] -} \ No newline at end of file diff --git a/questionnaire/questionare.avsc b/questionnaire/questionare.avsc new file mode 100644 index 00000000..fb88090c --- /dev/null +++ b/questionnaire/questionare.avsc @@ -0,0 +1,28 @@ +{ + "namespace": "org.radarcns.questionnaire", + "type": "record", + "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": "name", "type": {"name": "QuestionnaireType", "type": "enum", "symbols": ["PHQ8", "ESM", "UNKNOWN"]}, "doc": "Questionnaire names", "default": "UNKNOWN" }, + { "name": "version", "type": "string", "doc": "It reports the questionnaire version stated in the JSON specification" }, + { "name": "answers", + "type": { + "type": "array", + "items": { + "name": "Answer", + "type": "record", + "doc": "Questionnaire answer", + "fields": [ + { "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" } + ] + } + }, + "doc": "Answers list. The answers order must follow the questions order" + }, + { "name": "startTime", "type": "double", "doc": "timestamp in UTC (s) when the questionnaire is submitted to the subject" }, + { "name": "endTime", "type": "double", "doc": "timestamp in UTC (s) when the questionnaire is sent out to the platform" } + ] +} From 0f2117bc50318e47dd1ded49539819cd6c409a87 Mon Sep 17 00:00:00 2001 From: Francesco Nobilia Date: Mon, 19 Jun 2017 11:31:43 +0100 Subject: [PATCH 18/34] Fixed typo --- questionnaire/specification/PHQ8_config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/questionnaire/specification/PHQ8_config.json b/questionnaire/specification/PHQ8_config.json index 0f30d94e..80eed0fa 100644 --- a/questionnaire/specification/PHQ8_config.json +++ b/questionnaire/specification/PHQ8_config.json @@ -3,7 +3,7 @@ "version": 1, "estimatedCompletionTime" : 7, "startText" : "This questionnaire is known as the PHQ8. Clinicians use it to assess current depression in patients. Thank you for taking part in this focus group.", - "endText" : "Thank you for partcipating today.", + "endText" : "Thank you for participating today.", "protocol" : { "reminders" : { "amount" : 15, From 8b5ea843c788745f2fa8583178ca0c16ee0d54e1 Mon Sep 17 00:00:00 2001 From: Francesco Nobilia Date: Mon, 19 Jun 2017 11:35:19 +0100 Subject: [PATCH 19/34] Fixed Typo --- questionnaire/{questionare.avsc => questionnaire.avsc} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename questionnaire/{questionare.avsc => questionnaire.avsc} (100%) diff --git a/questionnaire/questionare.avsc b/questionnaire/questionnaire.avsc similarity index 100% rename from questionnaire/questionare.avsc rename to questionnaire/questionnaire.avsc From a516cb4c231b7b3ab87bf2025fbd52a34b5e2487 Mon Sep 17 00:00:00 2001 From: "Abhishek G.L" Date: Thu, 22 Jun 2017 17:43:27 +0200 Subject: [PATCH 20/34] version type changed from string to double --- questionnaire/questionnaire.avsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/questionnaire/questionnaire.avsc b/questionnaire/questionnaire.avsc index fb88090c..be45e876 100644 --- a/questionnaire/questionnaire.avsc +++ b/questionnaire/questionnaire.avsc @@ -5,7 +5,7 @@ "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": "name", "type": {"name": "QuestionnaireType", "type": "enum", "symbols": ["PHQ8", "ESM", "UNKNOWN"]}, "doc": "Questionnaire names", "default": "UNKNOWN" }, - { "name": "version", "type": "string", "doc": "It reports the questionnaire version stated in the JSON specification" }, + { "name": "version", "type": "double", "doc": "It reports the questionnaire version stated in the JSON specification" }, { "name": "answers", "type": { "type": "array", From 41ec194c250a7891de53ed0f1db2916d3e1919f9 Mon Sep 17 00:00:00 2001 From: Francesco Nobilia Date: Wed, 5 Jul 2017 11:15:52 +0100 Subject: [PATCH 21/34] Fixed Windowed Key style --- commons/key/windowed_key.avsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commons/key/windowed_key.avsc b/commons/key/windowed_key.avsc index 315f8a93..a6ccdbc1 100644 --- a/commons/key/windowed_key.avsc +++ b/commons/key/windowed_key.avsc @@ -3,8 +3,8 @@ "name": "WindowedKey", "doc": "Windowed key in the RADAR-CNS project", "fields": [ - {"name": "userID", "type": "string"}, - {"name": "sourceID", "type": "string"}, + {"name": "userId", "type": "string"}, + {"name": "sourceId", "type": "string"}, {"name": "start", "type": "long"}, {"name": "end", "type": "long"} ] From cff86fc104ec9d461edafb95c6ae369aba9167f6 Mon Sep 17 00:00:00 2001 From: Francesco Nobilia Date: Wed, 5 Jul 2017 11:21:54 +0100 Subject: [PATCH 22/34] Revert version to string in questionnaire --- questionnaire/questionnaire.avsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/questionnaire/questionnaire.avsc b/questionnaire/questionnaire.avsc index be45e876..fb88090c 100644 --- a/questionnaire/questionnaire.avsc +++ b/questionnaire/questionnaire.avsc @@ -5,7 +5,7 @@ "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": "name", "type": {"name": "QuestionnaireType", "type": "enum", "symbols": ["PHQ8", "ESM", "UNKNOWN"]}, "doc": "Questionnaire names", "default": "UNKNOWN" }, - { "name": "version", "type": "double", "doc": "It reports the questionnaire version stated in the JSON specification" }, + { "name": "version", "type": "string", "doc": "It reports the questionnaire version stated in the JSON specification" }, { "name": "answers", "type": { "type": "array", From 7257d116c9df40bad1922e6b1782cda3cb0d6d74 Mon Sep 17 00:00:00 2001 From: Francesco Nobilia Date: Wed, 5 Jul 2017 11:25:51 +0100 Subject: [PATCH 23/34] Moved questionnaire.avsc to common folder --- {questionnaire => commons/questionnaire}/questionnaire.avsc | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {questionnaire => commons/questionnaire}/questionnaire.avsc (100%) diff --git a/questionnaire/questionnaire.avsc b/commons/questionnaire/questionnaire.avsc similarity index 100% rename from questionnaire/questionnaire.avsc rename to commons/questionnaire/questionnaire.avsc From 112d9c0c2882194d721108826fb44a81661edf34 Mon Sep 17 00:00:00 2001 From: Maxim Moinat Date: Thu, 6 Jul 2017 18:18:00 +0200 Subject: [PATCH 24/34] updated Usage event with categoryName and Usage interaction with booted state --- commons/phone/phone_usage_event.avsc | 12 +++++++++++- commons/phone/phone_user_interaction.avsc | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/commons/phone/phone_usage_event.avsc b/commons/phone/phone_usage_event.avsc index 44fab4a3..2dd62013 100644 --- a/commons/phone/phone_usage_event.avsc +++ b/commons/phone/phone_usage_event.avsc @@ -7,7 +7,17 @@ {"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"}, {"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"}, {"name": "packageName", "type": "string", "doc": "package name of the launched app"}, - {"name": "categoryName", "type": "string", "doc": "app category as given by the play store"}, + {"name": "categoryName", "type": ["null","string"], "doc": "app category as given by the play store"}, + {"name": "categoryNameFetchTime", "type": ["null","double"], "doc": "timestamp in UTC when the category was fetched from the play store (s)"}, {"name": "eventType", "type": {"name": "UsageEventType", "type": "enum", "symbols": ["FOREGROUND", "BACKGROUND", "CONFIG", "SHORTCUT", "INTERACTION", "NONE"]}, "doc": "whether the event brought app to foreground or background or neither"} ] } + +Initial implementation of adding app category to usage event + +Takes Usage Events stream and adds: +- app category name (from Play Store webpage or from cache) +- timestamp category fetched from Play Store + +Still needs to be tested. + diff --git a/commons/phone/phone_user_interaction.avsc b/commons/phone/phone_user_interaction.avsc index a32fbc12..781f696b 100644 --- a/commons/phone/phone_user_interaction.avsc +++ b/commons/phone/phone_user_interaction.avsc @@ -6,6 +6,6 @@ "fields": [ {"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"}, {"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"}, - {"name": "interactionState", "type": {"name": "PhoneInteractionState", "type": "enum", "symbols": ["STANDBY", "UNLOCKED","SHUTDOWN"]}, "doc": "what interaction state the phone has"} + {"name": "interactionState", "type": {"name": "PhoneInteractionState", "type": "enum", "symbols": ["STANDBY", "UNLOCKED","SHUTDOWN","BOOTED"]}, "doc": "what interaction state the phone has"} ] } From 5156c0480e8c14a85d14db5773c3dc230bd49169 Mon Sep 17 00:00:00 2001 From: Joris Borgdorff Date: Mon, 10 Jul 2017 09:28:52 +0200 Subject: [PATCH 25/34] Layout fixes phone usage --- commons/phone/phone_usage_event.avsc | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/commons/phone/phone_usage_event.avsc b/commons/phone/phone_usage_event.avsc index 2dd62013..00a2aefa 100644 --- a/commons/phone/phone_usage_event.avsc +++ b/commons/phone/phone_usage_event.avsc @@ -7,17 +7,10 @@ {"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"}, {"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"}, {"name": "packageName", "type": "string", "doc": "package name of the launched app"}, - {"name": "categoryName", "type": ["null","string"], "doc": "app category as given by the play store"}, - {"name": "categoryNameFetchTime", "type": ["null","double"], "doc": "timestamp in UTC when the category was fetched from the play store (s)"}, - {"name": "eventType", "type": {"name": "UsageEventType", "type": "enum", "symbols": ["FOREGROUND", "BACKGROUND", "CONFIG", "SHORTCUT", "INTERACTION", "NONE"]}, "doc": "whether the event brought app to foreground or background or neither"} + {"name": "categoryName", "type": ["null", "string"], "doc": "app category as given by the play store", "default": null}, + {"name": "categoryNameFetchTime", "type": ["null", "double"], "doc": "timestamp in UTC when the category was fetched from the play store (s)", "default": null}, + {"name": "eventType", "type": + {"name": "UsageEventType", "type": "enum", "symbols": ["FOREGROUND", "BACKGROUND", "CONFIG", "SHORTCUT", "INTERACTION", "NONE"]}, + "doc": "whether the event brought app to foreground or background or neither", "default": "NONE"} ] } - -Initial implementation of adding app category to usage event - -Takes Usage Events stream and adds: -- app category name (from Play Store webpage or from cache) -- timestamp category fetched from Play Store - -Still needs to be tested. - From b5d811f5cdf42cdf429f5bf12aa521121cc7517a Mon Sep 17 00:00:00 2001 From: Maxim Moinat Date: Mon, 26 Jun 2017 11:17:19 +0200 Subject: [PATCH 26/34] Gyroscope, sms unread and step count sensors --- commons/phone/phone_gyroscope.avsc | 13 +++++++++++++ commons/phone/phone_sms_unread.avsc | 11 +++++++++++ commons/phone/phone_step_count.avsc | 11 +++++++++++ 3 files changed, 35 insertions(+) create mode 100644 commons/phone/phone_gyroscope.avsc create mode 100644 commons/phone/phone_sms_unread.avsc create mode 100644 commons/phone/phone_step_count.avsc diff --git a/commons/phone/phone_gyroscope.avsc b/commons/phone/phone_gyroscope.avsc new file mode 100644 index 00000000..df5a1c33 --- /dev/null +++ b/commons/phone/phone_gyroscope.avsc @@ -0,0 +1,13 @@ +{ + "namespace": "org.radarcns.phone", + "type": "record", + "name": "PhoneGyroscope", + "doc": "Data from the 3-axis gyroscope.", + "fields": [ + {"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"}, + {"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"}, + {"name": "x", "type": "float", "doc": "gyration in the x-axis (rad/s)"}, + {"name": "y", "type": "float", "doc": "gyration in the y-axis (rad/s)"}, + {"name": "z", "type": "float", "doc": "gyration in the z-axis (rad/s)"} + ] +} diff --git a/commons/phone/phone_sms_unread.avsc b/commons/phone/phone_sms_unread.avsc new file mode 100644 index 00000000..4f5f5347 --- /dev/null +++ b/commons/phone/phone_sms_unread.avsc @@ -0,0 +1,11 @@ +{ + "namespace": "org.radarcns.phone", + "type": "record", + "name": "PhoneSmsUnread", + "doc": "Number of SMS messages in the inbox that have an unread status.", + "fields": [ + {"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"}, + {"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"}, + {"name": "unreadSMS", "type": "boolean", "doc": "number of unread SMS messages currently in the inbox"} + ] +} diff --git a/commons/phone/phone_step_count.avsc b/commons/phone/phone_step_count.avsc new file mode 100644 index 00000000..97fa97c8 --- /dev/null +++ b/commons/phone/phone_step_count.avsc @@ -0,0 +1,11 @@ +{ + "namespace": "org.radarcns.phone", + "type": "record", + "name": "PhoneStepCount", + "doc": "Data from the step counter.", + "fields": [ + {"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"}, + {"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"}, + {"name": "steps", "type": "float", "doc": "number of steps taken since last reboot"} + ] +} From a39d33d06a7e2ba615a1e1268e69dbbbddb2e109 Mon Sep 17 00:00:00 2001 From: Maxim Moinat Date: Fri, 7 Jul 2017 11:14:46 +0200 Subject: [PATCH 27/34] added magnetic field schema. steps and unreadSms made integers --- commons/phone/phone_magnetic_field.avsc | 13 +++++++++++++ commons/phone/phone_sms_unread.avsc | 2 +- commons/phone/phone_step_count.avsc | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 commons/phone/phone_magnetic_field.avsc diff --git a/commons/phone/phone_magnetic_field.avsc b/commons/phone/phone_magnetic_field.avsc new file mode 100644 index 00000000..7a562d64 --- /dev/null +++ b/commons/phone/phone_magnetic_field.avsc @@ -0,0 +1,13 @@ +{ + "namespace": "org.radarcns.phone", + "type": "record", + "name": "PhoneMagneticField", + "doc": "Data from the 3-axis magnetometer.", + "fields": [ + {"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"}, + {"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"}, + {"name": "x", "type": "float", "doc": "magnetic field in the x-axis (μT)"}, + {"name": "y", "type": "float", "doc": "magnetic field in the y-axis (μT)"}, + {"name": "z", "type": "float", "doc": "magnetic field in the z-axis (μT)"} + ] +} diff --git a/commons/phone/phone_sms_unread.avsc b/commons/phone/phone_sms_unread.avsc index 4f5f5347..8927dc5a 100644 --- a/commons/phone/phone_sms_unread.avsc +++ b/commons/phone/phone_sms_unread.avsc @@ -6,6 +6,6 @@ "fields": [ {"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"}, {"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"}, - {"name": "unreadSMS", "type": "boolean", "doc": "number of unread SMS messages currently in the inbox"} + {"name": "unreadSMS", "type": "int", "doc": "number of unread SMS messages currently in the inbox"} ] } diff --git a/commons/phone/phone_step_count.avsc b/commons/phone/phone_step_count.avsc index 97fa97c8..1936582f 100644 --- a/commons/phone/phone_step_count.avsc +++ b/commons/phone/phone_step_count.avsc @@ -6,6 +6,6 @@ "fields": [ {"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"}, {"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"}, - {"name": "steps", "type": "float", "doc": "number of steps taken since last reboot"} + {"name": "steps", "type": "int", "doc": "number of steps taken between this and the previous record"} ] } From 2284489dae8934a502cc6721979343f8035580c7 Mon Sep 17 00:00:00 2001 From: Maxim Moinat Date: Fri, 7 Jul 2017 14:36:31 +0200 Subject: [PATCH 28/34] new isContact field for call/sms, isService and isNonNumeric fields for sms --- commons/phone/phone_call.avsc | 5 +++-- commons/phone/phone_sms.avsc | 7 +++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/commons/phone/phone_call.avsc b/commons/phone/phone_call.avsc index c9e3fc60..2d366358 100644 --- a/commons/phone/phone_call.avsc +++ b/commons/phone/phone_call.avsc @@ -8,6 +8,7 @@ {"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"}, {"name": "duration", "type": "float", "doc": "duration of the call (s)", "default": "NaN"}, {"name": "target", "type": ["null", "bytes"], "doc": "HMAC SHA-256 one-way source/target of the call. This hash of a given phone number will be the same unless the app is reinstalled. If the number is unknown or anonymous, this contains null.", "default": null}, - {"name": "type", "type": {"name": "PhoneCallType", "type": "enum", "symbols": ["INCOMING", "OUTGOING", "MISSED", "VOICEMAIL", "UNKNOWN"]}, "doc": "direction of phone call", "default": "UNKNOWN"} + {"name": "type", "type": {"name": "PhoneCallType", "type": "enum", "symbols": ["INCOMING", "OUTGOING", "MISSED", "VOICEMAIL", "UNKNOWN"]}, "doc": "direction of phone call", "default": "UNKNOWN"}, + {"name": "targetIsContact", "type": ["null","boolean"], "doc": "call to/from a known contact", "default": null} ] -} \ No newline at end of file +} diff --git a/commons/phone/phone_sms.avsc b/commons/phone/phone_sms.avsc index ac5b7fb6..cad04b53 100644 --- a/commons/phone/phone_sms.avsc +++ b/commons/phone/phone_sms.avsc @@ -8,6 +8,9 @@ {"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"}, {"name": "target", "type": ["null", "bytes"], "doc": "HMAC SHA-256 one-way source/target of the SMS. This hash of a given phone number will be the same unless the app is reinstalled. If the number is unknown or anonymous, this contains null.", "default": null}, {"name": "type", "type": {"name": "PhoneSmsType", "type": "enum", "symbols": ["INCOMING", "OUTGOING", "OTHER", "UNKNOWN"]}, "doc": "direction of the SMS", "default": "UNKNOWN"}, - {"name": "length", "type": "int", "doc": "number of characters in the message (-1 if unknown)", "default": -1} + {"name": "length", "type": ["null","int"], "doc": "number of characters in the message (null if unknown)", "default": null}, + {"name": "targetIsContact", "type": ["null","boolean"], "doc": "sms sender is a known contact", "default": null}, + {"name": "targetIsNonNumeric", "type": "boolean", "doc": "sms sender ID is replaced by text, e.g. a company name", "default": false}, + {"name": "targetIsService", "type": "boolean", "doc": "target is a service, e.g. a 4-digit target", "default": false} ] -} \ No newline at end of file +} From e3cd6277c2b0735a1e814c82c2018b5fed8c1b71 Mon Sep 17 00:00:00 2001 From: Francesco Nobilia Date: Wed, 12 Jul 2017 15:08:01 +0100 Subject: [PATCH 29/34] Added Questionnaire to Item --- commons/questionnaire/questionnaire.avsc | 6 +++--- java-sdk/radar-schemas-restapi/build.gradle | 5 ++++- restapi/app/application.avsc | 2 +- restapi/app/server_status.avsc | 11 ----------- restapi/dataset/item.avsc | 5 +++-- 5 files changed, 11 insertions(+), 18 deletions(-) delete mode 100644 restapi/app/server_status.avsc diff --git a/commons/questionnaire/questionnaire.avsc b/commons/questionnaire/questionnaire.avsc index fb88090c..6a36c15d 100644 --- a/commons/questionnaire/questionnaire.avsc +++ b/commons/questionnaire/questionnaire.avsc @@ -4,6 +4,8 @@ "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": "name", "type": {"name": "QuestionnaireType", "type": "enum", "symbols": ["PHQ8", "ESM", "UNKNOWN"]}, "doc": "Questionnaire names", "default": "UNKNOWN" }, { "name": "version", "type": "string", "doc": "It reports the questionnaire version stated in the JSON specification" }, { "name": "answers", @@ -21,8 +23,6 @@ } }, "doc": "Answers list. The answers order must follow the questions order" - }, - { "name": "startTime", "type": "double", "doc": "timestamp in UTC (s) when the questionnaire is submitted to the subject" }, - { "name": "endTime", "type": "double", "doc": "timestamp in UTC (s) when the questionnaire is sent out to the platform" } + } ] } diff --git a/java-sdk/radar-schemas-restapi/build.gradle b/java-sdk/radar-schemas-restapi/build.gradle index 3f8b9af2..5d300eca 100644 --- a/java-sdk/radar-schemas-restapi/build.gradle +++ b/java-sdk/radar-schemas-restapi/build.gradle @@ -5,12 +5,15 @@ ext.description = 'RADAR Schemas REST API SDK' // AVRO file manipulation // //---------------------------------------------------------------------------// task generateAvro(type: com.commercehub.gradle.plugin.avro.GenerateAvroJavaTask) { + source rootProject.fileTree('../commons') { + include 'questionnaire/questionnaire.avsc' + include 'application/application_server_status.avsc' + } source rootProject.fileTree('../restapi') { include '**/*.avsc' } outputDir avroOutputDir } - compileJava.dependsOn generateAvro //---------------------------------------------------------------------------// diff --git a/restapi/app/application.avsc b/restapi/app/application.avsc index ac971d4e..434536e6 100644 --- a/restapi/app/application.avsc +++ b/restapi/app/application.avsc @@ -8,7 +8,7 @@ "null", "string" ], "doc": "Hardware identifier of client application", "default": null}, {"name": "uptime", "type": "double", "doc": "Time since last app start (s)"}, - {"name": "serverStatus", "type": "ServerStatus", "doc": "server connection status", "default": "UNKNOWN"}, + {"name": "serverStatus", "type": "org.radarcns.application.ServerStatus", "doc": "server connection status", "default": "UNKNOWN"}, {"name": "recordsCached", "type": "int", "doc": "number of records currently being cached", "default": -1}, {"name": "recordsSent", "type": "int", "doc": "number of records sent since application start"}, {"name": "recordsUnsent", "type": "int", "doc": "number of unsent records", "default": -1} diff --git a/restapi/app/server_status.avsc b/restapi/app/server_status.avsc deleted file mode 100644 index 286ebf86..00000000 --- a/restapi/app/server_status.avsc +++ /dev/null @@ -1,11 +0,0 @@ -{ - "namespace": "org.radarcns.avro.restapi.app", - "type": "enum", - "name": "ServerStatus", - "doc": "Set of connection status between smartphone app and the RADAR-CNS Platform.", - "symbols": [ - "CONNECTED" , - "DISCONNECTED", - "UNKNOWN" - ] -} diff --git a/restapi/dataset/item.avsc b/restapi/dataset/item.avsc index fa205495..667a6e6c 100644 --- a/restapi/dataset/item.avsc +++ b/restapi/dataset/item.avsc @@ -6,8 +6,9 @@ "fields": [ {"name": "sample", "type": [ "org.radarcns.avro.restapi.data.DoubleSample" , - "org.radarcns.avro.restapi.data.Acceleration" - ], "doc": "Sample value. For more details, check DoubleSample and Acceleration" } , + "org.radarcns.avro.restapi.data.Acceleration", + "org.radarcns.questionnaire.Questionnaire" + ], "doc": "Sample value. For more details, check org.radarcns.avro.restapi.data.Acceleration, org.radarcns.avro.restapi.data.DoubleSample and org.radarcns.questionnaire.Questionnaire" } , {"name": "startDateTime", "type": "string", "doc": "Point in time (ISO8601) with UTC timezone. It represents the timestamp of the first sample contained inside the aggregated data."} ] } From 6e1f42909f946609b14e6dfa4a44e27132cb3a31 Mon Sep 17 00:00:00 2001 From: Joris Borgdorff Date: Thu, 13 Jul 2017 09:44:51 +0200 Subject: [PATCH 30/34] Added some doc strings about null phone usage category name --- commons/phone/phone_usage_event.avsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commons/phone/phone_usage_event.avsc b/commons/phone/phone_usage_event.avsc index 00a2aefa..ff9a9f34 100644 --- a/commons/phone/phone_usage_event.avsc +++ b/commons/phone/phone_usage_event.avsc @@ -7,8 +7,8 @@ {"name": "time", "type": "double", "doc": "device timestamp in UTC (s)"}, {"name": "timeReceived", "type": "double", "doc": "device receiver timestamp in UTC (s)"}, {"name": "packageName", "type": "string", "doc": "package name of the launched app"}, - {"name": "categoryName", "type": ["null", "string"], "doc": "app category as given by the play store", "default": null}, - {"name": "categoryNameFetchTime", "type": ["null", "double"], "doc": "timestamp in UTC when the category was fetched from the play store (s)", "default": null}, + {"name": "categoryName", "type": ["null", "string"], "doc": "app category as given by the play store, null if a category is not listed or unable to be fetched", "default": null}, + {"name": "categoryNameFetchTime", "type": ["null", "double"], "doc": "timestamp in UTC when the category was attempted to fetch from the play store (s), null if not fetched", "default": null}, {"name": "eventType", "type": {"name": "UsageEventType", "type": "enum", "symbols": ["FOREGROUND", "BACKGROUND", "CONFIG", "SHORTCUT", "INTERACTION", "NONE"]}, "doc": "whether the event brought app to foreground or background or neither", "default": "NONE"} From b282f7fb28751e408cea389677e2e4a565d25bb9 Mon Sep 17 00:00:00 2001 From: Joris Borgdorff Date: Thu, 13 Jul 2017 15:11:04 +0200 Subject: [PATCH 31/34] Update phone_call.avsc Doc update --- commons/phone/phone_call.avsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commons/phone/phone_call.avsc b/commons/phone/phone_call.avsc index 2d366358..44839428 100644 --- a/commons/phone/phone_call.avsc +++ b/commons/phone/phone_call.avsc @@ -9,6 +9,6 @@ {"name": "duration", "type": "float", "doc": "duration of the call (s)", "default": "NaN"}, {"name": "target", "type": ["null", "bytes"], "doc": "HMAC SHA-256 one-way source/target of the call. This hash of a given phone number will be the same unless the app is reinstalled. If the number is unknown or anonymous, this contains null.", "default": null}, {"name": "type", "type": {"name": "PhoneCallType", "type": "enum", "symbols": ["INCOMING", "OUTGOING", "MISSED", "VOICEMAIL", "UNKNOWN"]}, "doc": "direction of phone call", "default": "UNKNOWN"}, - {"name": "targetIsContact", "type": ["null","boolean"], "doc": "call to/from a known contact", "default": null} + {"name": "targetIsContact", "type": ["null","boolean"], "doc": "call to/from a known contact, null if unknown", "default": null} ] } From a4ec28d0714215cb36a520a670442d3e60758e75 Mon Sep 17 00:00:00 2001 From: Joris Borgdorff Date: Thu, 13 Jul 2017 15:12:02 +0200 Subject: [PATCH 32/34] Update phone_sms.avsc --- commons/phone/phone_sms.avsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commons/phone/phone_sms.avsc b/commons/phone/phone_sms.avsc index cad04b53..805929ff 100644 --- a/commons/phone/phone_sms.avsc +++ b/commons/phone/phone_sms.avsc @@ -9,7 +9,7 @@ {"name": "target", "type": ["null", "bytes"], "doc": "HMAC SHA-256 one-way source/target of the SMS. This hash of a given phone number will be the same unless the app is reinstalled. If the number is unknown or anonymous, this contains null.", "default": null}, {"name": "type", "type": {"name": "PhoneSmsType", "type": "enum", "symbols": ["INCOMING", "OUTGOING", "OTHER", "UNKNOWN"]}, "doc": "direction of the SMS", "default": "UNKNOWN"}, {"name": "length", "type": ["null","int"], "doc": "number of characters in the message (null if unknown)", "default": null}, - {"name": "targetIsContact", "type": ["null","boolean"], "doc": "sms sender is a known contact", "default": null}, + {"name": "targetIsContact", "type": ["null","boolean"], "doc": "sms sender is a known contact, null if unknown", "default": null}, {"name": "targetIsNonNumeric", "type": "boolean", "doc": "sms sender ID is replaced by text, e.g. a company name", "default": false}, {"name": "targetIsService", "type": "boolean", "doc": "target is a service, e.g. a 4-digit target", "default": false} ] From fe354d0d7d0d450203549174aed82d6cf2d3fdd6 Mon Sep 17 00:00:00 2001 From: Joris Borgdorff Date: Thu, 13 Jul 2017 15:45:39 +0200 Subject: [PATCH 33/34] Bumped version --- java-sdk/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-sdk/build.gradle b/java-sdk/build.gradle index a5afb848..bdd72bf2 100644 --- a/java-sdk/build.gradle +++ b/java-sdk/build.gradle @@ -15,7 +15,7 @@ subprojects { apply plugin: 'maven-publish' // Configuration - version = '0.1.1-alpha.2' + version = '0.2-alpha.1' group = 'org.radarcns' ext.githubRepoName = 'RADAR-CNS/RADAR-Schemas' From f058f2537f72728dcbbbfab9796793475791c4e2 Mon Sep 17 00:00:00 2001 From: Joris Borgdorff Date: Mon, 17 Jul 2017 09:35:49 +0200 Subject: [PATCH 34/34] Changed isService assertion in phone_call to number length --- commons/phone/phone_call.avsc | 4 +++- commons/phone/phone_sms.avsc | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/commons/phone/phone_call.avsc b/commons/phone/phone_call.avsc index 44839428..4997dddf 100644 --- a/commons/phone/phone_call.avsc +++ b/commons/phone/phone_call.avsc @@ -9,6 +9,8 @@ {"name": "duration", "type": "float", "doc": "duration of the call (s)", "default": "NaN"}, {"name": "target", "type": ["null", "bytes"], "doc": "HMAC SHA-256 one-way source/target of the call. This hash of a given phone number will be the same unless the app is reinstalled. If the number is unknown or anonymous, this contains null.", "default": null}, {"name": "type", "type": {"name": "PhoneCallType", "type": "enum", "symbols": ["INCOMING", "OUTGOING", "MISSED", "VOICEMAIL", "UNKNOWN"]}, "doc": "direction of phone call", "default": "UNKNOWN"}, - {"name": "targetIsContact", "type": ["null","boolean"], "doc": "call to/from a known contact, null if unknown", "default": null} + {"name": "targetIsContact", "type": ["null","boolean"], "doc": "call to/from a known contact, null if unknown", "default": null}, + {"name": "targetIsNonNumeric", "type": "boolean", "doc": "sms sender ID is replaced by text, e.g. a company name", "default": false}, + {"name": "targetLength", "type": "int", "doc": "length of the target phone number, -1 if not collected.", "default": -1} ] } diff --git a/commons/phone/phone_sms.avsc b/commons/phone/phone_sms.avsc index 805929ff..46bb17c1 100644 --- a/commons/phone/phone_sms.avsc +++ b/commons/phone/phone_sms.avsc @@ -11,6 +11,6 @@ {"name": "length", "type": ["null","int"], "doc": "number of characters in the message (null if unknown)", "default": null}, {"name": "targetIsContact", "type": ["null","boolean"], "doc": "sms sender is a known contact, null if unknown", "default": null}, {"name": "targetIsNonNumeric", "type": "boolean", "doc": "sms sender ID is replaced by text, e.g. a company name", "default": false}, - {"name": "targetIsService", "type": "boolean", "doc": "target is a service, e.g. a 4-digit target", "default": false} + {"name": "targetLength", "type": "int", "doc": "length of the target phone number, -1 if not collected.", "default": -1} ] }