diff --git a/schema/omh/acceleration-2.0.json b/schema/omh/acceleration-2.0.json new file mode 100644 index 00000000..d422350f --- /dev/null +++ b/schema/omh/acceleration-2.0.json @@ -0,0 +1,47 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://w3id.org/openmhealth/schemas/omh/acceleration-1.1.json", + "description": "This schema represents accelerometer measurements. The assumption is a 2-axis accelerometer. For a 3-axis accelerometer, the z measurement should also be required.", + "type": "object", + + "definitions": { + "acceleration_unit_value": { + "$ref": "acceleration-unit-value-1.x.json" + }, + "time_frame": { + "$ref": "https://w3id.org/ieee/ieee-1752-schema/time-frame-1.0.json" + }, + "body_location": { + "$ref": "body-location-1.x.json" + }, + "descriptive_statistic": { + "$ref": "https://w3id.org/ieee/ieee-1752-schema/descriptive-statistic-1.0.json" + } + }, + + "properties": { + "acceleration_x": { + "$ref": "#/definitions/acceleration_unit_value" + }, + "acceleration_y": { + "$ref": "#/definitions/acceleration_unit_value" + }, + "acceleration_z": { + "$ref": "#/definitions/acceleration_unit_value" + }, + "effective_time_frame": { + "$ref": "#/definitions/time_frame" + }, + "sensor_body_location": { + "$ref": "#/definitions/body_location" + }, + "descriptive_statistic": { + "$ref": "#/definitions/descriptive_statistic" + } + }, + "required": [ + "acceleration_x", + "acceleration_y", + "effective_time_frame" + ] +} \ No newline at end of file diff --git a/schema/omh/acceleration-2.x.json b/schema/omh/acceleration-2.x.json new file mode 120000 index 00000000..6cbf4210 --- /dev/null +++ b/schema/omh/acceleration-2.x.json @@ -0,0 +1 @@ +acceleration-2.0.json \ No newline at end of file diff --git a/schema/omh/activity-name-1.0.json b/schema/omh/activity-name-1.0.json index 32fcc568..8a316f85 100644 --- a/schema/omh/activity-name-1.0.json +++ b/schema/omh/activity-name-1.0.json @@ -1,6 +1,6 @@ { - "$schema": "http://json-schema.org/draft-04/schema#", - + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://w3id.org/openmhealth/schemas/omh/activity-name-1.0.json", "description": "The name(s) of the physical activity(ies) in which the person is engaged. It is recommended that the activity name be drawn from the CDC guidelines to facilitate mapping to standard energy expenditure values (METs)", "references": [ diff --git a/schema/omh/ambient-temperature-1.0.json b/schema/omh/ambient-temperature-1.0.json index 9c6ca098..59fbd4f5 100644 --- a/schema/omh/ambient-temperature-1.0.json +++ b/schema/omh/ambient-temperature-1.0.json @@ -1,6 +1,10 @@ { - "$schema": "http://json-schema.org/draft-04/schema#", - + "$schema": "http://json-schema.org/draft-07/schema#", + "deprecation": { + "reason": "This schema is now deprecated, in favor of the IEEE 1752.1 schema with the same name.", + "supersededBy": "https://w3id.org/ieee/ieee-1752-schema/ambient-temperature.json", + "date": "2022-12-01" + }, "description": "This schema represents the ambient temperature, either a single measurement, or the result of aggregating several measurements made over time (see Descriptive schema for a list of aggregate measures)", "type": "object", "references": [ diff --git a/schema/omh/blood-glucose-4.0.json b/schema/omh/blood-glucose-4.0.json new file mode 100644 index 00000000..2f743b0c --- /dev/null +++ b/schema/omh/blood-glucose-4.0.json @@ -0,0 +1,72 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://w3id.org/openmhealth/schemas/omh/blood-glucose-4.0.json", + "description": "This schema represents a person's blood glucose level.", + "type": "object", + + "references": [ + { + "description": "The SNOMED code represents Blood glucose level (finding)", + "url": "http://purl.bioontology.org/ontology/SNOMEDCT/365812005" + } + ], + "definitions": { + "unit_value": { + "$ref": "https://w3id.org/ieee/ieee-1752-schema/unit-value-1.0.json" + }, + "specimen_source": { + "$ref": "specimen-source-2.x.json" + }, + "time_frame": { + "$ref": "https://w3id.org/ieee/ieee-1752-schema/time-frame-1.0.json" + }, + "temporal_relationship_to_meal": { + "$ref": "temporal-relationship-to-meal-1.x.json" + }, + "temporal_relationship_to_sleep": { + "$ref": "temporal-relationship-to-sleep-1.x.json" + }, + "descriptive_statistic": { + "$ref": "https://w3id.org/ieee/ieee-1752-schema/descriptive-statistic-1.0.json" + } + }, + + "properties": { + "blood_glucose": { + "allOf": [ + { + "$ref": "#/definitions/unit_value" + }, + { + "properties": { + "unit": { + "enum": [ + "mg/dL", + "mmol/L" + ] + } + } + } + ] + }, + "specimen_source": { + "$ref": "#/definitions/specimen_source" + }, + "effective_time_frame": { + "$ref": "#/definitions/time_frame" + }, + "temporal_relationship_to_meal": { + "$ref": "#/definitions/temporal_relationship_to_meal" + }, + "temporal_relationship_to_sleep": { + "$ref": "#/definitions/temporal_relationship_to_sleep" + }, + "descriptive_statistic": { + "$ref": "#/definitions/descriptive_statistic" + } + }, + "required": [ + "blood_glucose", + "effective_time_frame" + ] +} \ No newline at end of file diff --git a/schema/omh/blood-glucose-4.x.json b/schema/omh/blood-glucose-4.x.json new file mode 120000 index 00000000..6338de0f --- /dev/null +++ b/schema/omh/blood-glucose-4.x.json @@ -0,0 +1 @@ +blood-glucose-4.0.json \ No newline at end of file diff --git a/schema/omh/diastolic-blood-pressure-1.1.json b/schema/omh/diastolic-blood-pressure-1.1.json new file mode 100644 index 00000000..6455dcf9 --- /dev/null +++ b/schema/omh/diastolic-blood-pressure-1.1.json @@ -0,0 +1,31 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://w3id.org/openmhealth/schemas/omh/diastolic-blood-pressure-1.1.json", + "description": "This schema represents a person's diastolic blood pressure.", + "type": "object", + "references": [ + { + "description": "The SNOMED code represents diastolic blood pressure (observable entity)", + "url": "http://purl.bioontology.org/ontology/SNOMEDCT/271650006" + } + ], + + "definitions": { + "unit_value": { + "$ref": "https://w3id.org/ieee/ieee-1752-schema/unit-value-1.0.json" + } + }, + + "allOf": [ + { + "$ref": "#/definitions/unit_value" + }, + { + "properties": { + "unit": { + "enum": ["mmHg"] + } + } + } + ] +} \ No newline at end of file diff --git a/schema/omh/diastolic-blood-pressure-1.x.json b/schema/omh/diastolic-blood-pressure-1.x.json index b9c3dc11..62b2b2b3 120000 --- a/schema/omh/diastolic-blood-pressure-1.x.json +++ b/schema/omh/diastolic-blood-pressure-1.x.json @@ -1 +1 @@ -diastolic-blood-pressure-1.0.json \ No newline at end of file +diastolic-blood-pressure-1.1.json \ No newline at end of file diff --git a/schema/omh/speed-unit-value-1.0.json b/schema/omh/speed-unit-value-1.0.json index 9dcf722a..d51ed71c 100644 --- a/schema/omh/speed-unit-value-1.0.json +++ b/schema/omh/speed-unit-value-1.0.json @@ -1,6 +1,10 @@ { "$schema": "http://json-schema.org/draft-04/schema#", - + "deprecation": { + "reason": "This schema is now deprecated, in favor of the IEEE 1752.1 schema of the same name.", + "supersededBy": "https://w3id.org/ieee/ieee-1752-schema/speed-unit-value.json", + "date": "2024-01-30" + }, "description": "This schema represents a speed (distance over time).", "type": "object", "references": [ diff --git a/schema/omh/systolic-blood-pressure-1.1.json b/schema/omh/systolic-blood-pressure-1.1.json new file mode 100644 index 00000000..ec9ec7d8 --- /dev/null +++ b/schema/omh/systolic-blood-pressure-1.1.json @@ -0,0 +1,31 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://w3id.org/openmhealth/schemas/omh/systolic-blood-pressure-1.1.json", + "description": "This schema represents a person's systolic blood pressure.", + "type": "object", + "references": [ + { + "description": "The SNOMED code represents systolic blood pressure (observable entity)", + "url": "http://purl.bioontology.org/ontology/SNOMEDCT/271649006" + } + ], + + "definitions": { + "unit_value": { + "$ref": "https://w3id.org/ieee/ieee-1752-schema/unit-value-1.0.json" + } + }, + + "allOf": [ + { + "$ref": "#/definitions/unit_value" + }, + { + "properties": { + "unit": { + "enum": ["mmHg"] + } + } + } + ] +} \ No newline at end of file diff --git a/schema/omh/systolic-blood-pressure-1.x.json b/schema/omh/systolic-blood-pressure-1.x.json index 33e1df16..cf3a7e13 120000 --- a/schema/omh/systolic-blood-pressure-1.x.json +++ b/schema/omh/systolic-blood-pressure-1.x.json @@ -1 +1 @@ -systolic-blood-pressure-1.0.json \ No newline at end of file +systolic-blood-pressure-1.1.json \ No newline at end of file diff --git a/schema/omh/unit-value-1.0.json b/schema/omh/unit-value-1.0.json index 40cae65f..6a99154f 100644 --- a/schema/omh/unit-value-1.0.json +++ b/schema/omh/unit-value-1.0.json @@ -1,6 +1,10 @@ { "$schema": "http://json-schema.org/draft-04/schema#", - + "deprecation": { + "reason": "This schema is now deprecated, in favor of the IEEE 1752.1 schema of the same name.", + "supersededBy": "https://w3id.org/ieee/ieee-1752-schema/unit-value.json", + "date": "2024-01-30" + }, "description": "This schema represents a numerical value with a unit of measure.", "type": "object", diff --git a/schema/omh/unit-value-range-1.0.json b/schema/omh/unit-value-range-1.0.json index ee607757..ada42936 100644 --- a/schema/omh/unit-value-range-1.0.json +++ b/schema/omh/unit-value-range-1.0.json @@ -1,6 +1,10 @@ { "$schema": "http://json-schema.org/draft-04/schema#", - + "deprecation": { + "reason": "This schema is now deprecated, in favor of the IEEE 1752.1 schema of the same name.", + "supersededBy": "https://w3id.org/ieee/ieee-1752-schema/unit-value-range.json", + "date": "2024-01-30" + }, "description": "This schema represents a range of numerical values with a unit of measure. The lower and upper boundaries are included in the interval.", "type": "object", diff --git a/schema/omh/volume-unit-value-1.x.json b/schema/omh/volume-unit-value-1.x.json index 695c84d2..73083177 120000 --- a/schema/omh/volume-unit-value-1.x.json +++ b/schema/omh/volume-unit-value-1.x.json @@ -1 +1 @@ -volume-unit-value-1.0.json \ No newline at end of file +volume-unit-value-1.1.json \ No newline at end of file diff --git a/test-data/omh/acceleration/2.0/shouldFail/invalid-acceleration-unit.json b/test-data/omh/acceleration/2.0/shouldFail/invalid-acceleration-unit.json new file mode 100644 index 00000000..03ba5363 --- /dev/null +++ b/test-data/omh/acceleration/2.0/shouldFail/invalid-acceleration-unit.json @@ -0,0 +1,17 @@ +{ + "acceleration_x": { + "value": 0.0596923828125, + "unit": "m/s^2" + }, + "acceleration_y": { + "value": 0.0125, + "unit": "m/s" + }, + "acceleration_z": { + "value": 0.0001, + "unit": "m/s^2" + }, + "effective_time_frame": { + "date_time": "2015-08-18T07:25:00Z" + } +} \ No newline at end of file diff --git a/test-data/omh/acceleration/2.0/shouldPass/valid-acceleration.json b/test-data/omh/acceleration/2.0/shouldPass/valid-acceleration.json new file mode 100644 index 00000000..17cdd0d1 --- /dev/null +++ b/test-data/omh/acceleration/2.0/shouldPass/valid-acceleration.json @@ -0,0 +1,18 @@ +{ + "acceleration_x": { + "value": 0.0596923828125, + "unit": "m/s^2" + }, + "acceleration_y": { + "value": 0.0125, + "unit": "m/s^2" + }, + "acceleration_z": { + "value": 0.0001, + "unit": "m/s^2" + }, + "sensor_body_location": "right wrist", + "effective_time_frame": { + "date_time": "2015-08-18T07:25:00Z" + } +} \ No newline at end of file diff --git a/test-data/omh/blood-glucose/4.0/shouldFail/empty-document.json b/test-data/omh/blood-glucose/4.0/shouldFail/empty-document.json new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/test-data/omh/blood-glucose/4.0/shouldFail/empty-document.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/test-data/omh/blood-glucose/4.0/shouldFail/invalid-descriptive-statistic.json b/test-data/omh/blood-glucose/4.0/shouldFail/invalid-descriptive-statistic.json new file mode 100644 index 00000000..499918bc --- /dev/null +++ b/test-data/omh/blood-glucose/4.0/shouldFail/invalid-descriptive-statistic.json @@ -0,0 +1,13 @@ +{ + "blood_glucose": { + "unit": "mg/dL", + "value": 95 + }, + "effective_time_frame": { + "time_interval": { + "start_date_time": "2013-02-05T07:25:00Z", + "end_date_time": "2013-06-05T07:25:00Z" + } + }, + "descriptive_statistic": "minmum" +} \ No newline at end of file diff --git a/test-data/omh/blood-glucose/4.0/shouldFail/invalid-specimen-source.json b/test-data/omh/blood-glucose/4.0/shouldFail/invalid-specimen-source.json new file mode 100644 index 00000000..1a22bffd --- /dev/null +++ b/test-data/omh/blood-glucose/4.0/shouldFail/invalid-specimen-source.json @@ -0,0 +1,7 @@ +{ + "blood_glucose": { + "unit": "mg/dL", + "value": 95 + }, + "specimen_source": "fluid" +} \ No newline at end of file diff --git a/test-data/omh/blood-glucose/4.0/shouldFail/invalid-temporal-relationship-to-meal.json b/test-data/omh/blood-glucose/4.0/shouldFail/invalid-temporal-relationship-to-meal.json new file mode 100644 index 00000000..7f44bffd --- /dev/null +++ b/test-data/omh/blood-glucose/4.0/shouldFail/invalid-temporal-relationship-to-meal.json @@ -0,0 +1,7 @@ +{ + "blood_glucose": { + "unit": "mg/dL", + "value": 95 + }, + "temporal_relationship_to_meal": "fsting" +} \ No newline at end of file diff --git a/test-data/omh/blood-glucose/4.0/shouldFail/invalid-temporal-relationship-to-sleep.json b/test-data/omh/blood-glucose/4.0/shouldFail/invalid-temporal-relationship-to-sleep.json new file mode 100644 index 00000000..5ee3559f --- /dev/null +++ b/test-data/omh/blood-glucose/4.0/shouldFail/invalid-temporal-relationship-to-sleep.json @@ -0,0 +1,7 @@ +{ + "blood_glucose": { + "unit": "mg/dL", + "value": 95 + }, + "temporal_relationship_to_sleep": "bfore sleeping" +} \ No newline at end of file diff --git a/test-data/omh/blood-glucose/4.0/shouldFail/invalid-time-interval.json b/test-data/omh/blood-glucose/4.0/shouldFail/invalid-time-interval.json new file mode 100644 index 00000000..16138f48 --- /dev/null +++ b/test-data/omh/blood-glucose/4.0/shouldFail/invalid-time-interval.json @@ -0,0 +1,11 @@ +{ + "blood_glucose": { + "unit": "mg/dL", + "value": 120 + }, + "effective_time_frame": { + "time_interval": { + "start_date_time": "2013-02-05T07:25:00Z" + } + } +} \ No newline at end of file diff --git a/test-data/omh/blood-glucose/4.0/shouldFail/missing-time-frame.json b/test-data/omh/blood-glucose/4.0/shouldFail/missing-time-frame.json new file mode 100644 index 00000000..5e7d950f --- /dev/null +++ b/test-data/omh/blood-glucose/4.0/shouldFail/missing-time-frame.json @@ -0,0 +1,6 @@ +{ + "blood_glucose": { + "unit": "mg/dL", + "value": 120 + } +} \ No newline at end of file diff --git a/test-data/omh/blood-glucose/4.0/shouldPass/with-date-time-time-frame.json b/test-data/omh/blood-glucose/4.0/shouldPass/with-date-time-time-frame.json new file mode 100644 index 00000000..132a56f5 --- /dev/null +++ b/test-data/omh/blood-glucose/4.0/shouldPass/with-date-time-time-frame.json @@ -0,0 +1,9 @@ +{ + "blood_glucose": { + "unit": "mg/dL", + "value": 95 + }, + "effective_time_frame": { + "date_time": "2013-02-05T07:25:00Z" + } +} \ No newline at end of file diff --git a/test-data/omh/blood-glucose/4.0/shouldPass/with-descriptive-statistic.json b/test-data/omh/blood-glucose/4.0/shouldPass/with-descriptive-statistic.json new file mode 100644 index 00000000..84eb49f0 --- /dev/null +++ b/test-data/omh/blood-glucose/4.0/shouldPass/with-descriptive-statistic.json @@ -0,0 +1,13 @@ +{ + "blood_glucose": { + "unit": "mg/dL", + "value": 120 + }, + "effective_time_frame": { + "time_interval": { + "start_date_time": "2013-02-05T07:25:00Z", + "end_date_time": "2013-06-05T07:25:00Z" + } + }, + "descriptive_statistic": "minimum" +} \ No newline at end of file diff --git a/test-data/omh/blood-glucose/4.0/shouldPass/with-everything.json b/test-data/omh/blood-glucose/4.0/shouldPass/with-everything.json new file mode 100644 index 00000000..d8c52069 --- /dev/null +++ b/test-data/omh/blood-glucose/4.0/shouldPass/with-everything.json @@ -0,0 +1,16 @@ +{ + "blood_glucose": { + "unit": "mg/dL", + "value": 95 + }, + "effective_time_frame": { + "time_interval": { + "start_date_time": "2013-02-05T07:25:00Z", + "end_date_time": "2013-06-05T07:25:00Z" + } + }, + "specimen_source": "capillary blood", + "temporal_relationship_to_meal": "fasting", + "temporal_relationship_to_sleep": "on waking", + "descriptive_statistic": "minimum" +} \ No newline at end of file diff --git a/test-data/omh/blood-glucose/4.0/shouldPass/with-temporal-relationship-to-meal.json b/test-data/omh/blood-glucose/4.0/shouldPass/with-temporal-relationship-to-meal.json new file mode 100644 index 00000000..3559f3b8 --- /dev/null +++ b/test-data/omh/blood-glucose/4.0/shouldPass/with-temporal-relationship-to-meal.json @@ -0,0 +1,10 @@ +{ + "blood_glucose": { + "unit": "mg/dL", + "value": 95 + }, + "effective_time_frame": { + "date_time": "2013-02-05T07:25:00Z" + }, + "temporal_relationship_to_meal": "fasting" +} \ No newline at end of file diff --git a/test-data/omh/blood-glucose/4.0/shouldPass/with-temporal-relationship-to-sleep.json b/test-data/omh/blood-glucose/4.0/shouldPass/with-temporal-relationship-to-sleep.json new file mode 100644 index 00000000..c78b8279 --- /dev/null +++ b/test-data/omh/blood-glucose/4.0/shouldPass/with-temporal-relationship-to-sleep.json @@ -0,0 +1,10 @@ +{ + "blood_glucose": { + "unit": "mg/dL", + "value": 95 + }, + "effective_time_frame": { + "date_time": "2013-02-05T20:25:00Z" + }, + "temporal_relationship_to_sleep": "before sleeping" +} \ No newline at end of file