From e8b7cc3f620ad20af72d8c6168dfc5219e452b82 Mon Sep 17 00:00:00 2001 From: Simona Carini Date: Tue, 30 Jan 2024 17:32:48 -0800 Subject: [PATCH] Updated blood glucose schema to reference IEEE schemas and added sample data --- schema/omh/blood-glucose-4.0.json | 72 +++++++++++++++++++ schema/omh/blood-glucose-4.x.json | 1 + .../4.0/shouldFail/empty-document.json | 1 + .../invalid-descriptive-statistic.json | 13 ++++ .../shouldFail/invalid-specimen-source.json | 7 ++ ...invalid-temporal-relationship-to-meal.json | 7 ++ ...nvalid-temporal-relationship-to-sleep.json | 7 ++ .../4.0/shouldFail/invalid-time-interval.json | 11 +++ .../4.0/shouldFail/missing-time-frame.json | 6 ++ .../shouldPass/with-date-time-time-frame.json | 9 +++ .../with-descriptive-statistic.json | 13 ++++ .../4.0/shouldPass/with-everything.json | 16 +++++ .../with-temporal-relationship-to-meal.json | 10 +++ .../with-temporal-relationship-to-sleep.json | 10 +++ 14 files changed, 183 insertions(+) create mode 100644 schema/omh/blood-glucose-4.0.json create mode 120000 schema/omh/blood-glucose-4.x.json create mode 100644 test-data/omh/blood-glucose/4.0/shouldFail/empty-document.json create mode 100644 test-data/omh/blood-glucose/4.0/shouldFail/invalid-descriptive-statistic.json create mode 100644 test-data/omh/blood-glucose/4.0/shouldFail/invalid-specimen-source.json create mode 100644 test-data/omh/blood-glucose/4.0/shouldFail/invalid-temporal-relationship-to-meal.json create mode 100644 test-data/omh/blood-glucose/4.0/shouldFail/invalid-temporal-relationship-to-sleep.json create mode 100644 test-data/omh/blood-glucose/4.0/shouldFail/invalid-time-interval.json create mode 100644 test-data/omh/blood-glucose/4.0/shouldFail/missing-time-frame.json create mode 100644 test-data/omh/blood-glucose/4.0/shouldPass/with-date-time-time-frame.json create mode 100644 test-data/omh/blood-glucose/4.0/shouldPass/with-descriptive-statistic.json create mode 100644 test-data/omh/blood-glucose/4.0/shouldPass/with-everything.json create mode 100644 test-data/omh/blood-glucose/4.0/shouldPass/with-temporal-relationship-to-meal.json create mode 100644 test-data/omh/blood-glucose/4.0/shouldPass/with-temporal-relationship-to-sleep.json 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/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