Skip to content

Commit

Permalink
Merge pull request #209 from RADAR-base/release-0.5.6
Browse files Browse the repository at this point in the history
Release 0.5.6
  • Loading branch information
nivemaham committed Jan 21, 2020
2 parents 857fede + a957bda commit 5dd99b6
Show file tree
Hide file tree
Showing 15 changed files with 252 additions and 19 deletions.
23 changes: 23 additions & 0 deletions commons/active/banking/BankingEvent.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"namespace": "org.radarcns.active.banking",
"type": "record",
"name": "BankingEvent",
"doc": "A Banking App Event, which is either a correct or wrong submission of a PIN number, an amount to withdraw, a cancelled or confirmed transaction. Notably, this allows us to distinguish between a wrong confirmed transaction or a correct cancelled transaction etc.",
"fields": [
{ "name": "time", "type": "double", "doc": "Time since the Unix Epoch (seconds), time stores the time an event has started." },
{ "name": "timeCompleted", "type": "double", "doc": "Time since the Unix Epoch (seconds), time stores the time an event has been completed." },
{ "name": "duration", "type": "double", "doc": "Duration of the event (seconds), duration is essentially timeCompleted - time."},
{ "name": "transactionId", "type":"string", "doc": "The uid of Transaction record that the event is related to." },
{ "name": "isCorrect", "type": ["null","boolean"], "doc": "Describes if the input Pin or Amount is correct. Null if this event is a confirmation or cancellation.", "default": null },
{ "name": "eventType",
"type": {
"name": "EventType",
"type": "enum",
"symbols": ["PIN", "AMOUNT", "TRANSACTION_CANCELLED", "TRANSACTION_CONFIRMED", "UNKNOWN"],
"doc": "PIN: PIN input, AMOUNT: Amount input, TRANSACTION_CANCELLED: the Transaction is canceled, TRANSACTION_CONFIRMED: the Transaction is confirmed, UNKNOWN: for any other input type."
},
"doc": "The type of submitted input: PIN or Amount.",
"default": "UNKNOWN"
}
]
}
38 changes: 38 additions & 0 deletions commons/active/banking/BankingTransaction.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"namespace": "org.radarcns.active.banking",
"type": "record",
"name": "BankingTransaction",
"doc": "Transaction in Banking App. This captures a full transaction: inputting a PIN number, then an amount and then a confirmation or cancellation. A transaction may also time out or end prematurely.",
"fields": [ {
"name": "transactionId",
"type": "string",
"doc": "Unique ID for an Transaction."
}, {
"name": "time",
"type": "double",
"doc": "Time since the Unix Epoch (seconds), time stores the time a transaction has started."
}, {
"name": "timeCompleted",
"type": "double",
"doc": "Time stores the time a transaction has been completed."
}, {
"name": "duration",
"type": "double",
"doc": "Duration of the transaction (seconds), duration is essentially timeCompleted - time."
}, {
"name": "isComplete",
"type": [ "null", "boolean" ],
"doc": "True if the result is CORRECT_CONFIRMED, WRONG_CONFIRMED, CORRECT_CANCELLED or WRONG_CANCELLED. False if TIME_OUT or EXIT.",
"default": null
}, {
"name": "transactionResult",
"type": {
"type": "enum",
"name": "TransactionResult",
"doc": "CORRECT_CONFIRMED: both inputs Correct- Confirmed Transaction, CORRECT_CANCELLED: Correct inputs - Cancelled Transaction, WRONG_CONFIRMED: (at least one of two inputs Wrong) - Confirmed Transaction, WRONG_CANCELLED: Wrong input Cancelled Transaction, TIME_OUT: Transaction timed Out, EXIT: Transaction Ended prematurely.",
"symbols" : [ "CORRECT_CONFIRMED", "CORRECT_CANCELLED", "WRONG_CONFIRMED", "WRONG_CANCELLED", "TIME_OUT", "EXIT", "UNKNOWN"]
},
"doc": "Shows the result of the Transaction which can be Correct Cancelled, Correct Cancelled, Wrong Confirmed, Wrong Cancelled, Timed Out, Ended.",
"default": "UNKNOWN"
} ]
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"namespace": "org.radarcns.connector.upload.axivity",
"type": "record",
"name": "AxivityBattery",
"name": "AxivityBatteryLevel",
"doc": "Battery level data from Axivity device.",
"fields": [
{"name": "time", "type": "double", "doc": "Timestamp in unix time acquired locally from the device."},
Expand Down
15 changes: 15 additions & 0 deletions commons/connector/upload/axivity/axivity_event.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"namespace": "org.radarcns.connector.upload.axivity",
"type": "record",
"name": "AxivityEvent",
"doc": "Event data available in a CWA block.",
"fields": [
{"name": "time", "type": "double", "doc": "Timestamp in unix time acquired locally from the device."},
{"name": "timeReceived", "type": "double", "doc": "Timestamp in unix time received from upload."},
{"name": "event", "type": {
"name": "AxivityEventType",
"type": "enum",
"doc": "Event types recorded from the axivity device.",
"symbols": ["RESUME", "SINGLE_TAP", "DOUBLE_TAP", "FIFO_OVERFLOW", "BUFFER_OVERFLOW", "UNHANDLED_INTERRUPT", "UNKNOWN"]}, "doc": "Event of the block.", "default": "UNKNOWN"}
]
}
6 changes: 2 additions & 4 deletions commons/connector/upload/axivity/axivity_metadata.avsc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
"fields": [
{"name": "time", "type": "double", "doc": "Timestamp in unix time acquired locally from the device."},
{"name": "timeReceived", "type": "double", "doc": "Timestamp in unix time received from upload."},
{"name": "deviceId", "type": "string", "doc": "Version number."},
{"name": "exerciseCode", "type": "string", "doc": "Exercise code from axivity."},
{"name": "bodyLocation", "type": "int", "doc": "Body location recorded on the axivity device."},
{"name": "studyCode", "type": "string", "doc": "Study code recorded on the axivity device."}
{"name": "annotationName", "type": "string", "doc": "Name of the annotation from cwa metadata."},
{"name": "annotationData", "type": "string", "doc": "Value available for this annotation in the cwa metadata."}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"name": "InteractionEventType",
"doc": "NOTIFICATION_OPEN = When a user presses the notification to open the app, APP_OPEN = When a user opens the app directly, QUESTIONNAIRE_STARTED = When a user starts a questionnaire, QUESTIONNAIRE_FINISHED = When a user completes a questionnaire, QUESTIONNAIRE_CANCELLED = When a user closes a questionnaire without completing it.",
"type": "enum",
"symbols": ["NOTIFICATION_OPEN", "APP_OPEN", "QUESTIONNAIRE_STARTED", "QUESTIONNAIRE_FINISHED", "QUESTIONNAIRE_CANCELLED", "OTHER", "UNKNOWN"]
"symbols": ["NOTIFICATION_OPEN", "APP_OPEN", "QUESTIONNAIRE_STARTED", "QUESTIONNAIRE_FINISHED", "QUESTIONNAIRE_CANCELLED", "OTHER", "UNKNOWN", "RECORDING_STARTED", "RECORDING_STOPPED"]
},
"doc": "Questionnaire app activity usage event type.",
"default": "UNKNOWN"
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.5.5'
compile 'org.radarcns:radar-schemas-commons:0.5.6'
// Questionnaire schemas (active remote monitoring app)
compile 'org.radarcns:radar-schemas-tools:0.5.5'
compile 'org.radarcns:radar-schemas-tools:0.5.6'
}
```
Usually, you only need to include the schemas you actually need in your dependencies.
Expand Down
2 changes: 1 addition & 1 deletion 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.5.5'
version = '0.5.6'
group = 'org.radarcns'
ext.githubRepoName = 'RADAR-base/RADAR-Schemas'

Expand Down
12 changes: 6 additions & 6 deletions java-sdk/radar-schemas-tools/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ ext {
description = 'RADAR Schemas specification and validation tools.'

argparseVersion = '0.8.1'
jacksonVersion = '2.9.9.1'
jacksonYamlVersion = '2.9.9'
jerseyVersion = '2.28'
jettyVersion = '9.4.17.v20190418'
jacksonVersion = '2.10.1'
jacksonYamlVersion = '2.10.1'
jerseyVersion = '2.29.1'
jettyVersion = '9.4.24.v20191120'
junitVersion = '4.12'
confluentVersion = '5.3.0'
confluentVersion = '5.3.1'
kafkaVersion = '2.3.0'
okHttpVersion = '4.0.0'
okHttpVersion = '4.2.2'
radarCommonsVersion = '0.12.1'
slf4jVersion = '1.7.26'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ public int execute(Namespace options, CommandLineApp app) {
try {
SchemaRegistry registration = new SchemaRegistry(url);
boolean forced = options.getBoolean("force");
if (forced) {
forced = registration.putCompatibility(Compatibility.NONE);
if (forced && !registration.putCompatibility(Compatibility.NONE)) {
return 1;
}
boolean result;
Pattern pattern = matchTopic(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,10 @@ public Validator<Schema> validateAvroData() {
org.apache.kafka.connect.data.Schema connectSchema = encoder
.toConnectSchema(schema);
Schema originalSchema = decoder.fromConnectSchema(connectSchema);
return check(schema.equals(originalSchema), "Schema changed by validation");
return check(schema.equals(originalSchema),
() -> "Schema changed by validation: "
+ schema.toString(true) + " is not equal to "
+ originalSchema.toString(true));
} catch (Exception ex) {
return raise("Failed to convert schema back to itself");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.Collection;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.function.Supplier;
import java.util.regex.Pattern;
import java.util.stream.Stream;
import org.radarcns.schema.validation.ValidationException;
Expand All @@ -32,6 +33,10 @@ static Stream<ValidationException> check(boolean test, String message) {
return test ? valid() : raise(message);
}

static Stream<ValidationException> check(boolean test, Supplier<String> message) {
return test ? valid() : raise(message.get());
}

/**
* TODO.
* @param predicate TODO
Expand Down
118 changes: 118 additions & 0 deletions specifications/active/aRMT-1.5.1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: aRMT
vendor: RADAR
model: aRMT-App
version: 1.5.1
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.questionnaire.Questionnaire
questionnaire_definition_url: https://github.com/RADAR-base/RADAR-REDCap-aRMT-Definitions/blob/master/questionnaires/thinc_it/thinc_it_armt.json
- type: ROMBERG_TEST
doc: The value of the task is in milliseconds (ms).
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
doc: The value of the task is in milliseconds (ms).
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
doc: The value of the task is in milliseconds (ms).
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.questionnaire.Questionnaire
questionnaire_definition_url: https://raw.githubusercontent.com/RADAR-base/RADAR-REDCap-aRMT-Definitions/master/questionnaires/audio/audio_armt.json
- type: AUDIO_2
topic: questionnaire_audio
value_schema: .active.questionnaire.Questionnaire
questionnaire_definition_url: https://raw.githubusercontent.com/RADAR-base/RADAR-REDCap-aRMT-Definitions/master/questionnaires/audio_2/audio_2_armt.json
- type: AUDIO_3
topic: questionnaire_audio
value_schema: .active.questionnaire.Questionnaire
questionnaire_definition_url: https://raw.githubusercontent.com/RADAR-base/RADAR-REDCap-aRMT-Definitions/master/questionnaires/audio_3/audio_3_armt.json
- type: AUDIO_4
topic: questionnaire_audio
value_schema: .active.questionnaire.Questionnaire
questionnaire_definition_url: https://raw.githubusercontent.com/RADAR-base/RADAR-REDCap-aRMT-Definitions/master/questionnaires/audio_4/audio_4_armt.json
- 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: PERCEIVED_DEFICITS_QUESTIONNAIRE
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: PATIENT_DETERMINED_DISEASE_STEP
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: ESM28Q
topic: questionnaire_esm28q
value_schema: .active.questionnaire.Questionnaire
questionnaire_definition_url: https://raw.githubusercontent.com/RADAR-base/RADAR-REDCap-aRMT-Definitions/master/questionnaires/esm28q/esm28q_armt.json
- type: BIPQ
topic: questionnaire_bipq
value_schema: .active.questionnaire.Questionnaire
questionnaire_definition_url: https://raw.githubusercontent.com/RADAR-base/RADAR-REDCap-aRMT-Definitions/master/questionnaires/bipq/bipq_armt.json
- type: ESM_EPI_MOD_1
topic: questionnaire_esm_epi_mod_1
value_schema: .active.questionnaire.Questionnaire
questionnaire_definition_url: https://raw.githubusercontent.com/RADAR-base/RADAR-REDCap-aRMT-Definitions/master/questionnaires/esm_epi_mod_1/esm_epi_mod_1_armt.json
- type: EVENING_ASSESSMENT
topic: questionnaire_evening_assessment
value_schema: .active.questionnaire.Questionnaire
questionnaire_definition_url: https://raw.githubusercontent.com/RADAR-base/RADAR-REDCap-aRMT-Definitions/master/questionnaires/evening_assessment/evening_assessment_armt.json
- type: MORNING_ASSESSMENT
topic: questionnaire_morning_assessment
value_schema: .active.questionnaire.Questionnaire
questionnaire_definition_url: https://raw.githubusercontent.com/RADAR-base/RADAR-REDCap-aRMT-Definitions/master/questionnaires/morning_assessment/morning_assessment_armt.json
- type: TAM
topic: questionnaire_tam
value_schema: .active.questionnaire.Questionnaire
questionnaire_definition_url: https://raw.githubusercontent.com/RADAR-base/RADAR-REDCap-aRMT-Definitions/master/questionnaires/tam/tam_armt.json
- type: BAARS_IV
topic: questionnaire_baars_iv
value_schema: .active.questionnaire.Questionnaire
questionnaire_definition_url: https://raw.githubusercontent.com/RADAR-base/RADAR-REDCap-aRMT-Definitions/master/questionnaires/baars_iv/baars_iv_armt.json
- type: ARI_SELF
topic: questionnaire_ari_self
value_schema: .active.questionnaire.Questionnaire
questionnaire_definition_url: https://raw.githubusercontent.com/RADAR-base/RADAR-REDCap-aRMT-Definitions/master/questionnaires/ari_self/ari_self_armt.json
- type: GAD7
topic: questionnaire_gad7
value_schema: .active.questionnaire.Questionnaire
questionnaire_definition_url: https://raw.githubusercontent.com/RADAR-base/RADAR-REDCap-aRMT-Definitions/master/questionnaires/gad7/gad7_armt.json
- type: RPQ
topic: questionnaire_rpq
value_schema: .active.questionnaire.Questionnaire
questionnaire_definition_url: https://raw.githubusercontent.com/RADAR-base/RADAR-REDCap-aRMT-Definitions/master/questionnaires/rpq/rpq_armt.json
- type: ART_COGNITIVE_TEST
topic: questionnaire_art_cognitive_test
value_schema: .active.questionnaire.Questionnaire
questionnaire_definition_url: https://raw.githubusercontent.com/RADAR-base/RADAR-REDCap-aRMT-Definitions/master/questionnaires/art_cognitive_test/art_cognitive_test_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
- type: APP_EVENT
doc: Questionnaire application interaction event.
topic: questionnaire_app_event
value_schema: .monitor.questionnaire.QuestionnaireApplicationInteractionEvent
17 changes: 17 additions & 0 deletions specifications/active/banking-app-1.0.0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#==================== BankingApp Specification ======================#
name: BankingApp
vendor: CERTH
model: BankingApp
version: 1.0.0
assessment_type: APP
doc: Banking App schemas and topics
data:
- type: APP_EVENT
doc: A Banking App Event, which is either a correct or wrong submission of a PIN number, an amount to withdraw, a cancelled or confirmed transaction. Notably, this allows us to distinguish between a wrong confirmed transaction or a correct cancelled transaction etc.
topic: certh_banking_app_event
value_schema: .active.banking.BankingEvent
- type: TRANSACTION
doc: Transaction in Banking App. This captures a full transaction inputting a PIN number, then an amount and then a confirmation or cancellation.
topic: certh_banking_app_transaction
value_schema: .active.banking.BankingTransaction

18 changes: 17 additions & 1 deletion specifications/connector/radar-axivity-connector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,28 @@ name: RADAR-AXIVITY-CONNECTOR
vendor: Axivity
model: Axivity.device
version: 1.0.0
doc: Spec for RADAR-base Axivity data upload connector. Schemas should be registered in the connector.
doc: Spec for RADAR-base Axivity data upload connector. Schemas should be registered in the connector. Information on the raw data can be found at https://github.com/digitalinteraction/openmovement/tree/master/Docs/ax3.
data:
- doc: Data from 3-axis accelerometer sensor with gravitational constant g as unit. Data extracted from CWA binary file.
topic: connect_upload_axivity_acceleration
value_schema: .connector.upload.axivity.AxivityAcceleration

- doc: Battery level information of axivity device extracted from CWA Block.
topic: connect_upload_axivity_battery_level
value_schema: .connector.upload.axivity.AxivityBatteryLevel

- doc: Ambient light data extracted from a CWA Block.
topic: connect_upload_axivity_light
value_schema: .connector.upload.axivity.AxivityLight

- doc: Temperature data extracted from CWA Block.
topic: connect_upload_axivity_temperature
value_schema: .connector.upload.axivity.AxivityLight

- doc: Event data extracted from from a CWA Block.
topic: connect_upload_axivity_event
value_schema: .connector.upload.axivity.AxivityEvent

# meta-data
- doc: Data that contains additional meta-data of the recording. Data extracted from the header of CWA binary file.
topic: connect_upload_axivity_metadata
Expand Down

0 comments on commit 5dd99b6

Please sign in to comment.