From 5f475452f996ed726f30e02a90b6b752d22781cd Mon Sep 17 00:00:00 2001 From: Emerson Farrugia Date: Sat, 29 Jul 2023 22:22:33 +0200 Subject: [PATCH] Revert "Revert "Feature/reference ieee schemas"" This reverts commit f25a749de01544868ad53831f90d9622c5686ab3. --- schema/omh/area-unit-value-1.1.json | 39 +++++++++++ schema/omh/blood-pressure-4.0.json | 66 +++++++++++++++++++ schema/omh/blood-pressure-4.x.json | 1 + schema/omh/body-posture-1.0.json | 6 +- schema/omh/physical-activity-1.2.json | 6 +- schema/omh/step-count-3.0.json | 6 +- schema/omh/time-frame-1.0.json | 6 +- schema/omh/time-interval-1.0.json | 6 +- .../1.0/shouldFail/invalid-ambient-sound.json | 9 +++ .../1.0/shouldFail/invalid-posture.json | 1 + .../1.0/shouldPass/valid-posture.json | 1 + .../1.0/shouldFail/empty-document.json | 1 + .../time-interval-and-date-time.json | 10 +++ .../1.0/shouldFail/duration-only.json | 6 ++ .../1.0/shouldFail/empty-document.json | 1 + .../1.0/shouldFail/end-time-only.json | 3 + .../1.0/shouldFail/start-time-only.json | 3 + .../1.1/shouldFail/invalid-unit.json | 4 ++ .../1.1/shouldFail/unit-only.json | 3 + .../1.1/shouldFail/value-only.json | 3 + .../1.1/shouldPass/positive-value.json | 4 ++ .../4.0/shouldFail/empty-document.json | 1 + .../4.0/shouldFail/invalid-pa-value.json | 14 ++++ .../shouldFail/invalid-timeframe-format.json | 17 +++++ .../4.0/shouldFail/invalid-unit.json | 13 ++++ .../4.0/shouldPass/blood-pressure-only.json | 13 ++++ .../with-descriptive-statistic.json | 19 ++++++ .../shouldPass/with-posture-and-location.json | 15 +++++ .../with-posture-location-relation.json | 16 +++++ 29 files changed, 288 insertions(+), 5 deletions(-) create mode 100644 schema/omh/area-unit-value-1.1.json create mode 100644 schema/omh/blood-pressure-4.0.json create mode 120000 schema/omh/blood-pressure-4.x.json create mode 100644 test-data/ieee/ambient-sound/1.0/shouldFail/invalid-ambient-sound.json create mode 100644 test-data/ieee/body-posture/1.0/shouldFail/invalid-posture.json create mode 100644 test-data/ieee/body-posture/1.0/shouldPass/valid-posture.json create mode 100644 test-data/ieee/time-frame/1.0/shouldFail/empty-document.json create mode 100644 test-data/ieee/time-frame/1.0/shouldFail/time-interval-and-date-time.json create mode 100644 test-data/ieee/time-interval/1.0/shouldFail/duration-only.json create mode 100644 test-data/ieee/time-interval/1.0/shouldFail/empty-document.json create mode 100644 test-data/ieee/time-interval/1.0/shouldFail/end-time-only.json create mode 100644 test-data/ieee/time-interval/1.0/shouldFail/start-time-only.json create mode 100644 test-data/omh/area-unit-value/1.1/shouldFail/invalid-unit.json create mode 100644 test-data/omh/area-unit-value/1.1/shouldFail/unit-only.json create mode 100644 test-data/omh/area-unit-value/1.1/shouldFail/value-only.json create mode 100644 test-data/omh/area-unit-value/1.1/shouldPass/positive-value.json create mode 100644 test-data/omh/blood-pressure/4.0/shouldFail/empty-document.json create mode 100644 test-data/omh/blood-pressure/4.0/shouldFail/invalid-pa-value.json create mode 100644 test-data/omh/blood-pressure/4.0/shouldFail/invalid-timeframe-format.json create mode 100644 test-data/omh/blood-pressure/4.0/shouldFail/invalid-unit.json create mode 100644 test-data/omh/blood-pressure/4.0/shouldPass/blood-pressure-only.json create mode 100644 test-data/omh/blood-pressure/4.0/shouldPass/with-descriptive-statistic.json create mode 100644 test-data/omh/blood-pressure/4.0/shouldPass/with-posture-and-location.json create mode 100644 test-data/omh/blood-pressure/4.0/shouldPass/with-posture-location-relation.json diff --git a/schema/omh/area-unit-value-1.1.json b/schema/omh/area-unit-value-1.1.json new file mode 100644 index 00000000..86fdb681 --- /dev/null +++ b/schema/omh/area-unit-value-1.1.json @@ -0,0 +1,39 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://w3id.org/openmhealth/schemas/omh/area-unit-value-1.1.json", + "type": "object", + "description": "This schema represents an area (measure of a surface)", + "references": [ + { + "description": "The SNOMED code represents Area", + "url": "http://purl.bioontology.org/ontology/SNOMEDCT/42798000" + } + ], + "allOf": [ + { + "$ref": "https://w3id.org/ieee/ieee-1752-schema/unit-value-1.0.json" + }, + { + "properties": { + "unit": { + "references": [ + { + "description": "The unit of measure of the element. Basic unit is meter (m). Allowed values are drawn from the SI Area Units and English Area Units Common Synonyms (non-UCUM). The valid UCUM code is different for square inch ([sin_i]), square foot ([sft_i]), square yard ([syd_i]).", + "url": "http://download.hl7.de/documents/ucum/ucumdata.html" + } + ], + "enum": [ + "mm^2", + "cm^2", + "m^2", + "km^2", + "in^2", + "ft^2", + "yd^2", + "mi^2" + ] + } + } + } + ] +} \ No newline at end of file diff --git a/schema/omh/blood-pressure-4.0.json b/schema/omh/blood-pressure-4.0.json new file mode 100644 index 00000000..55bf2d49 --- /dev/null +++ b/schema/omh/blood-pressure-4.0.json @@ -0,0 +1,66 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://w3id.org/openmhealth/schemas/omh/blood-pressure-4.0.json", + "description": "This schema represents a person's blood pressure as a combination of systolic and diastolic blood pressure.", + "type": "object", + "references": [ + { + "description": "The SNOMED codes represents Blood pressure (observable entity)", + "url": "http://purl.bioontology.org/ontology/SNOMEDCT/75367002" + } + ], + "definitions": { + "systolic_blood_pressure": { + "$ref": "systolic-blood-pressure-1.x.json" + }, + "diastolic_blood_pressure": { + "$ref": "diastolic-blood-pressure-1.x.json" + }, + "time_frame": { + "$ref": "https://w3id.org/ieee/ieee-1752-schema/time-frame-1.0.json" + }, + "body_posture": { + "$ref": "https://w3id.org/ieee/ieee-1752-schema/body-posture-1.0.json" + }, + "body_location": { + "$ref": "body-location-1.x.json" + }, + "temporal_relationship_to_physical_activity": { + "$ref": "temporal-relationship-to-physical-activity-1.x.json" + }, + "descriptive_statistic": { + "$ref": "https://w3id.org/ieee/ieee-1752-schema/descriptive-statistic-1.0.json" + } + }, + + "properties": { + "systolic_blood_pressure": { + "$ref": "#/definitions/systolic_blood_pressure" + }, + "diastolic_blood_pressure": { + "$ref": "#/definitions/diastolic_blood_pressure" + }, + "effective_time_frame": { + "$ref": "#/definitions/time_frame" + }, + "body_posture": { + "$ref": "#/definitions/body_posture" + }, + "descriptive_statistic": { + "$ref": "#/definitions/descriptive_statistic" + }, + "measurement_location": { + "description": "The location on the body where the blood pressure measuring device is placed for measurement.", + "$ref": "#/definitions/body_location" + }, + "temporal_relationship_to_physical_activity": { + "$ref": "#/definitions/temporal_relationship_to_physical_activity" + } + }, + + "required": [ + "systolic_blood_pressure", + "diastolic_blood_pressure", + "effective_time_frame" + ] +} \ No newline at end of file diff --git a/schema/omh/blood-pressure-4.x.json b/schema/omh/blood-pressure-4.x.json new file mode 120000 index 00000000..2411562a --- /dev/null +++ b/schema/omh/blood-pressure-4.x.json @@ -0,0 +1 @@ +blood-pressure-4.0.json \ No newline at end of file diff --git a/schema/omh/body-posture-1.0.json b/schema/omh/body-posture-1.0.json index 69060ede..57bec066 100644 --- a/schema/omh/body-posture-1.0.json +++ b/schema/omh/body-posture-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/body-posture.json", + "date": "2022-12-01" + }, "type": "string", "description": "The posture of the subject (for example, during a clinical measurement). This value set is not exhaustive.", "references": [ diff --git a/schema/omh/physical-activity-1.2.json b/schema/omh/physical-activity-1.2.json index 0e83ca1b..7f3acc89 100644 --- a/schema/omh/physical-activity-1.2.json +++ b/schema/omh/physical-activity-1.2.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 with the same name.", + "supersededBy": "https://w3id.org/ieee/ieee-1752-schema/physical-activity.json", + "date": "2022-12-01" + }, "description": "This schema represents a single episode of physical activity.", "type": "object", "references": [ diff --git a/schema/omh/step-count-3.0.json b/schema/omh/step-count-3.0.json index cfe82f81..972aebfa 100644 --- a/schema/omh/step-count-3.0.json +++ b/schema/omh/step-count-3.0.json @@ -1,6 +1,10 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - + "deprecation": { + "reason": "This schema is now deprecated, in favor of the IEEE 1752.1 physical-activity schema which models also number of steps.", + "supersededBy": "https://w3id.org/ieee/ieee-1752-schema/physical-activity.json", + "date": "2022-12-01" + }, "description": "This schema represents number of steps.", "type": "object", diff --git a/schema/omh/time-frame-1.0.json b/schema/omh/time-frame-1.0.json index 45748204..704685ad 100644 --- a/schema/omh/time-frame-1.0.json +++ b/schema/omh/time-frame-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/time-frame.json", + "date": "2022-12-01" + }, "description": "This schema describes a time frame as a point in time or a time interval.", "type": "object", diff --git a/schema/omh/time-interval-1.0.json b/schema/omh/time-interval-1.0.json index f614df55..6072277e 100644 --- a/schema/omh/time-interval-1.0.json +++ b/schema/omh/time-interval-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/time-interval.json", + "date": "2022-12-01" + }, "description": "This schema describes an interval of time. In the absence of a precise start and/or end time, the time interval can be described as a date + a part of the day (morning, afternoon, evening, night). No commitments are made as to whether the start or end time point itself is included in the interval (i.e., whether the defined interval includes the boundary point(s) or not).", "type": "object", diff --git a/test-data/ieee/ambient-sound/1.0/shouldFail/invalid-ambient-sound.json b/test-data/ieee/ambient-sound/1.0/shouldFail/invalid-ambient-sound.json new file mode 100644 index 00000000..c968d212 --- /dev/null +++ b/test-data/ieee/ambient-sound/1.0/shouldFail/invalid-ambient-sound.json @@ -0,0 +1,9 @@ +{ + "ambient_sound": { + "value": 75, + "unit": "deciB" + }, + "effective_time_frame": { + "date_time": "2019-02-05T06:00:00Z" + } +} diff --git a/test-data/ieee/body-posture/1.0/shouldFail/invalid-posture.json b/test-data/ieee/body-posture/1.0/shouldFail/invalid-posture.json new file mode 100644 index 00000000..c4671b9b --- /dev/null +++ b/test-data/ieee/body-posture/1.0/shouldFail/invalid-posture.json @@ -0,0 +1 @@ +"stnding" \ No newline at end of file diff --git a/test-data/ieee/body-posture/1.0/shouldPass/valid-posture.json b/test-data/ieee/body-posture/1.0/shouldPass/valid-posture.json new file mode 100644 index 00000000..71569d80 --- /dev/null +++ b/test-data/ieee/body-posture/1.0/shouldPass/valid-posture.json @@ -0,0 +1 @@ +"semi-recumbent" \ No newline at end of file diff --git a/test-data/ieee/time-frame/1.0/shouldFail/empty-document.json b/test-data/ieee/time-frame/1.0/shouldFail/empty-document.json new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/test-data/ieee/time-frame/1.0/shouldFail/empty-document.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/test-data/ieee/time-frame/1.0/shouldFail/time-interval-and-date-time.json b/test-data/ieee/time-frame/1.0/shouldFail/time-interval-and-date-time.json new file mode 100644 index 00000000..4d596734 --- /dev/null +++ b/test-data/ieee/time-frame/1.0/shouldFail/time-interval-and-date-time.json @@ -0,0 +1,10 @@ +{ + "date_time": "2013-02-05T07:25:00.123Z", + "time_interval": { + "duration": { + "value": 10, + "unit": "d" + }, + "end_date_time": "2013-02-05T07:35:00Z" + } +} \ No newline at end of file diff --git a/test-data/ieee/time-interval/1.0/shouldFail/duration-only.json b/test-data/ieee/time-interval/1.0/shouldFail/duration-only.json new file mode 100644 index 00000000..7ae9cfc6 --- /dev/null +++ b/test-data/ieee/time-interval/1.0/shouldFail/duration-only.json @@ -0,0 +1,6 @@ +{ + "duration": { + "unit": "h", + "value": 7.6 + } +} \ No newline at end of file diff --git a/test-data/ieee/time-interval/1.0/shouldFail/empty-document.json b/test-data/ieee/time-interval/1.0/shouldFail/empty-document.json new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/test-data/ieee/time-interval/1.0/shouldFail/empty-document.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/test-data/ieee/time-interval/1.0/shouldFail/end-time-only.json b/test-data/ieee/time-interval/1.0/shouldFail/end-time-only.json new file mode 100644 index 00000000..1b2fdd15 --- /dev/null +++ b/test-data/ieee/time-interval/1.0/shouldFail/end-time-only.json @@ -0,0 +1,3 @@ +{ + "end_date_time": "2013-02-05T07:25:00Z" +} \ No newline at end of file diff --git a/test-data/ieee/time-interval/1.0/shouldFail/start-time-only.json b/test-data/ieee/time-interval/1.0/shouldFail/start-time-only.json new file mode 100644 index 00000000..b86c583d --- /dev/null +++ b/test-data/ieee/time-interval/1.0/shouldFail/start-time-only.json @@ -0,0 +1,3 @@ +{ + "start_date_time": "2013-02-05T07:25:00Z" +} \ No newline at end of file diff --git a/test-data/omh/area-unit-value/1.1/shouldFail/invalid-unit.json b/test-data/omh/area-unit-value/1.1/shouldFail/invalid-unit.json new file mode 100644 index 00000000..a6088f97 --- /dev/null +++ b/test-data/omh/area-unit-value/1.1/shouldFail/invalid-unit.json @@ -0,0 +1,4 @@ +{ + "unit": "foo", + "value": 7.6 +} \ No newline at end of file diff --git a/test-data/omh/area-unit-value/1.1/shouldFail/unit-only.json b/test-data/omh/area-unit-value/1.1/shouldFail/unit-only.json new file mode 100644 index 00000000..c01cd442 --- /dev/null +++ b/test-data/omh/area-unit-value/1.1/shouldFail/unit-only.json @@ -0,0 +1,3 @@ +{ + "unit": "m^2" +} \ No newline at end of file diff --git a/test-data/omh/area-unit-value/1.1/shouldFail/value-only.json b/test-data/omh/area-unit-value/1.1/shouldFail/value-only.json new file mode 100644 index 00000000..10711972 --- /dev/null +++ b/test-data/omh/area-unit-value/1.1/shouldFail/value-only.json @@ -0,0 +1,3 @@ +{ + "value": 10 +} \ No newline at end of file diff --git a/test-data/omh/area-unit-value/1.1/shouldPass/positive-value.json b/test-data/omh/area-unit-value/1.1/shouldPass/positive-value.json new file mode 100644 index 00000000..a1ba7713 --- /dev/null +++ b/test-data/omh/area-unit-value/1.1/shouldPass/positive-value.json @@ -0,0 +1,4 @@ +{ + "unit": "m^2", + "value": 7.6 +} \ No newline at end of file diff --git a/test-data/omh/blood-pressure/4.0/shouldFail/empty-document.json b/test-data/omh/blood-pressure/4.0/shouldFail/empty-document.json new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/test-data/omh/blood-pressure/4.0/shouldFail/empty-document.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/test-data/omh/blood-pressure/4.0/shouldFail/invalid-pa-value.json b/test-data/omh/blood-pressure/4.0/shouldFail/invalid-pa-value.json new file mode 100644 index 00000000..97af5c09 --- /dev/null +++ b/test-data/omh/blood-pressure/4.0/shouldFail/invalid-pa-value.json @@ -0,0 +1,14 @@ +{ + "systolic_blood_pressure": { + "value": 115, + "unit": "mmHg" + }, + "diastolic_blood_pressure": { + "value": 60, + "unit": "mmHg" + }, + "effective_time_frame": { + "date_time": "2020-02-05T07:25:00-08:00" + }, + "temporal_relationship_to_physical_activity": "rest" +} diff --git a/test-data/omh/blood-pressure/4.0/shouldFail/invalid-timeframe-format.json b/test-data/omh/blood-pressure/4.0/shouldFail/invalid-timeframe-format.json new file mode 100644 index 00000000..2754b774 --- /dev/null +++ b/test-data/omh/blood-pressure/4.0/shouldFail/invalid-timeframe-format.json @@ -0,0 +1,17 @@ +{ + "systolic_blood_pressure": { + "value": 115, + "unit": "mmHg" + }, + "diastolic_blood_pressure": { + "value": 60, + "unit": "mmHg" + }, + "effective_time_frame": { + "time_interval": { + "date": "2013-02-05", + "part_of_day": "morning" + } + }, + "temporal_relationship_to_physical_activity": "at rest" +} diff --git a/test-data/omh/blood-pressure/4.0/shouldFail/invalid-unit.json b/test-data/omh/blood-pressure/4.0/shouldFail/invalid-unit.json new file mode 100644 index 00000000..10a915a1 --- /dev/null +++ b/test-data/omh/blood-pressure/4.0/shouldFail/invalid-unit.json @@ -0,0 +1,13 @@ +{ + "systolic_blood_pressure": { + "value": 115, + "unit": "mmH" + }, + "diastolic_blood_pressure": { + "value": 60, + "unit": "mmHg" + }, + "effective_time_frame": { + "date_time": "2020-02-05T07:25:00-08:00" + } +} \ No newline at end of file diff --git a/test-data/omh/blood-pressure/4.0/shouldPass/blood-pressure-only.json b/test-data/omh/blood-pressure/4.0/shouldPass/blood-pressure-only.json new file mode 100644 index 00000000..50349949 --- /dev/null +++ b/test-data/omh/blood-pressure/4.0/shouldPass/blood-pressure-only.json @@ -0,0 +1,13 @@ +{ + "systolic_blood_pressure": { + "value": 115, + "unit": "mmHg" + }, + "diastolic_blood_pressure": { + "value": 60, + "unit": "mmHg" + }, + "effective_time_frame": { + "date_time": "2020-02-05T07:25:00-08:00" + } +} \ No newline at end of file diff --git a/test-data/omh/blood-pressure/4.0/shouldPass/with-descriptive-statistic.json b/test-data/omh/blood-pressure/4.0/shouldPass/with-descriptive-statistic.json new file mode 100644 index 00000000..1c70e428 --- /dev/null +++ b/test-data/omh/blood-pressure/4.0/shouldPass/with-descriptive-statistic.json @@ -0,0 +1,19 @@ +{ + "systolic_blood_pressure": { + "value": 160, + "unit": "mmHg" + }, + "diastolic_blood_pressure": { + "value": 60, + "unit": "mmHg" + }, + "effective_time_frame": { + "time_interval": { + "start_date_time": "2020-02-05T07:00:00-08:00", + "end_date_time": "2020-02-12T07:00:00-08:00" + } + }, + "body_posture": "sitting", + "measurement_location": "left wrist", + "descriptive_statistic": "maximum" +} \ No newline at end of file diff --git a/test-data/omh/blood-pressure/4.0/shouldPass/with-posture-and-location.json b/test-data/omh/blood-pressure/4.0/shouldPass/with-posture-and-location.json new file mode 100644 index 00000000..d57bc28a --- /dev/null +++ b/test-data/omh/blood-pressure/4.0/shouldPass/with-posture-and-location.json @@ -0,0 +1,15 @@ +{ + "systolic_blood_pressure": { + "value": 140, + "unit": "mmHg" + }, + "diastolic_blood_pressure": { + "value": 60, + "unit": "mmHg" + }, + "body_posture": "sitting", + "measurement_location": "left upper arm", + "effective_time_frame": { + "date_time": "2020-02-05T07:25:00-08:00" + } +} \ No newline at end of file diff --git a/test-data/omh/blood-pressure/4.0/shouldPass/with-posture-location-relation.json b/test-data/omh/blood-pressure/4.0/shouldPass/with-posture-location-relation.json new file mode 100644 index 00000000..13aeae2c --- /dev/null +++ b/test-data/omh/blood-pressure/4.0/shouldPass/with-posture-location-relation.json @@ -0,0 +1,16 @@ +{ + "systolic_blood_pressure": { + "value": 125, + "unit": "mmHg" + }, + "diastolic_blood_pressure": { + "value": 60, + "unit": "mmHg" + }, + "body_posture": "sitting", + "measurement_location": "left wrist", + "temporal_relationship_to_physical_activity": "at rest", + "effective_time_frame": { + "date_time": "2020-02-05T07:25:00-08:00" + } +} \ No newline at end of file