From 74693d14d63442390f1b4d3757289d76de96c464 Mon Sep 17 00:00:00 2001 From: Elisa Du <79795653+Alizzie@users.noreply.github.com> Date: Fri, 4 Jul 2025 14:38:43 +0200 Subject: [PATCH 01/15] create all biosignals schema From refactored healthcare_msgs --- schema/ros4hc/Notes.txt | 7 + schema/ros4hc/bcg-1.x.json | 33 ++-- schema/ros4hc/bcg-info-1.x.json | 89 +++++++++- .../{ecg-lead-1.x.json => ecg-1.x.json} | 33 ++-- schema/ros4hc/ecg-info-1.x.json | 72 +++++++- schema/ros4hc/eda-1.x.json | 81 +++++++++ schema/ros4hc/eda-info-1-x.json | 127 +++++++++++++++ schema/ros4hc/eeg-1.x.json | 65 ++++++++ schema/ros4hc/eeg-info-1.x.json | 127 +++++++++++++++ schema/ros4hc/emg-1.x.json | 65 ++++++++ schema/ros4hc/emg-info-1.x.json | 125 ++++++++++++++ schema/ros4hc/eog-1.x.json | 65 ++++++++ schema/ros4hc/eog-info-1.x.json | 154 ++++++++++++++++++ schema/ros4hc/healthcare-filterbase-1-x.json | 0 schema/ros4hc/icg-1.x.json | 63 +++++++ schema/ros4hc/icg-info-1.x.json | 124 ++++++++++++++ schema/ros4hc/lead-location-1.x.json | 2 +- schema/ros4hc/pcg-1.x.json | 75 +++++++++ schema/ros4hc/pcg-info-1.x.json | 115 +++++++++++++ schema/ros4hc/toChange/eda-1.x.json | 64 -------- schema/ros4hc/toChange/emg-1.x.json | 64 -------- schema/ros4hc/toChange/eog-1.x.json | 64 -------- .../unfinished-ideas/ecg-leads-1.x.json | 42 ----- .../bcg-full-sample-data.json | 0 .../bcg-sample-body-data.json | 0 .../deprecated/ecg-full-sample-data.json | 77 +++++++++ .../{ => deprecated}/eda-sample-data.json | 0 .../sensor-device-header-data.json | 0 .../bcg-full-sample-data-1.x.json | 91 +++++++++++ .../ecg-full-sample-data.json | 65 +++++--- .../eda-full-sample-data.json | 99 +++++++++++ .../eeg-full-sample-data.json | 68 ++++++++ .../emg-full-sample-data.json | 90 ++++++++++ .../eog-full-sample-data.json | 108 ++++++++++++ .../icg-full-sample-data.json | 101 ++++++++++++ .../ppg-full-sample-data.json | 57 +++++++ 36 files changed, 2117 insertions(+), 295 deletions(-) create mode 100644 schema/ros4hc/Notes.txt rename schema/ros4hc/{ecg-lead-1.x.json => ecg-1.x.json} (67%) create mode 100644 schema/ros4hc/eda-1.x.json create mode 100644 schema/ros4hc/eda-info-1-x.json create mode 100644 schema/ros4hc/eeg-1.x.json create mode 100644 schema/ros4hc/eeg-info-1.x.json create mode 100644 schema/ros4hc/emg-1.x.json create mode 100644 schema/ros4hc/emg-info-1.x.json create mode 100644 schema/ros4hc/eog-1.x.json create mode 100644 schema/ros4hc/eog-info-1.x.json create mode 100644 schema/ros4hc/healthcare-filterbase-1-x.json create mode 100644 schema/ros4hc/icg-1.x.json create mode 100644 schema/ros4hc/icg-info-1.x.json create mode 100644 schema/ros4hc/pcg-1.x.json create mode 100644 schema/ros4hc/pcg-info-1.x.json delete mode 100644 schema/ros4hc/toChange/eda-1.x.json delete mode 100644 schema/ros4hc/toChange/emg-1.x.json delete mode 100644 schema/ros4hc/toChange/eog-1.x.json delete mode 100644 schema/ros4hc/unfinished-ideas/ecg-leads-1.x.json rename test-data/ros4hc/{full-sample-data => deprecated}/bcg-full-sample-data.json (100%) rename test-data/ros4hc/{ => deprecated}/bcg-sample-body-data.json (100%) create mode 100644 test-data/ros4hc/deprecated/ecg-full-sample-data.json rename test-data/ros4hc/{ => deprecated}/eda-sample-data.json (100%) rename test-data/ros4hc/{ => deprecated}/sensor-device-header-data.json (100%) create mode 100644 test-data/ros4hc/full-sample-data/bcg-full-sample-data-1.x.json create mode 100644 test-data/ros4hc/full-sample-data/eda-full-sample-data.json create mode 100644 test-data/ros4hc/full-sample-data/eeg-full-sample-data.json create mode 100644 test-data/ros4hc/full-sample-data/emg-full-sample-data.json create mode 100644 test-data/ros4hc/full-sample-data/eog-full-sample-data.json create mode 100644 test-data/ros4hc/full-sample-data/icg-full-sample-data.json create mode 100644 test-data/ros4hc/full-sample-data/ppg-full-sample-data.json diff --git a/schema/ros4hc/Notes.txt b/schema/ros4hc/Notes.txt new file mode 100644 index 00000000..f45f0db3 --- /dev/null +++ b/schema/ros4hc/Notes.txt @@ -0,0 +1,7 @@ +There are some inconsistencies in the Ros4HC messages as well for the headers. + +- EEGInfo.msg uses "Signal mode" which is the same as "Electrode Type" referred in EDAInfo. Hence, we use the first one for all schemas. + +- There are multiple sampling frequencies, and units in both deviceInfo and specific signal info message. A better distinguishing between both is needed, or remove one duplicate. + +- Some parts of the signal's header is the same for all signals, we can summarize them in one specific section, e.g. sampling_info. \ No newline at end of file diff --git a/schema/ros4hc/bcg-1.x.json b/schema/ros4hc/bcg-1.x.json index eab58720..8cc30e5f 100644 --- a/schema/ros4hc/bcg-1.x.json +++ b/schema/ros4hc/bcg-1.x.json @@ -14,20 +14,33 @@ }, "properties": { - "bcg_sensor_readings": { - "description": "BCG waveform segments", + "session_id": { + "description": "match BCGInfo's session_id (if used)", + "type": "string" + }, + + "sample_size": { + "type": "integer" + }, + + "bcg": { + "description": "Raw or filtered BCG values", "type": "array", "items": { "type": "number" } }, - "unit": { - "type": "string", - "enum": ["mV", "uV", "V"] - }, - "error_message": { - "type": "string" + + "signal_quality": { + "description": "From 0 (poor) to 1 [%]", + "type": "array", + "items": { + "type": "number", + "maximum": 1, + "minimum": 0 + } }, + "effective_time_frame": { "description": "The time interval at which, or time interval during which the measurement is asserted as being valid.", "allOf": [ @@ -43,8 +56,8 @@ } }, "required": [ - "bcg_sensor_readings", - "unit", + "bcg", + "signal_quality", "effective_time_frame" ] } \ No newline at end of file diff --git a/schema/ros4hc/bcg-info-1.x.json b/schema/ros4hc/bcg-info-1.x.json index 8d8c2b32..533ac560 100644 --- a/schema/ros4hc/bcg-info-1.x.json +++ b/schema/ros4hc/bcg-info-1.x.json @@ -12,6 +12,10 @@ "bcg_body": { "$ref": "bcg-1.x.json" + }, + + "filter": { + "$ref": "healthcare-filterbase-1.x.json" } }, @@ -22,33 +26,100 @@ "type":"object", "allOf": [ {"$ref": "#/definitions/header"}, + + + {"$ref": "#/definitions/filter"}, + { "type": "object", "properties": { "bcg_info": { "type": "object", "properties": { + + "session_id": { + "type": "string" + }, + + "sampling_frequency": { + "allOf": [ + { + "$ref": "#/definitions/unit_value" + }, + { + "type": "object", + "properties": { + "unit": { + "enum": [ + "Hz" + ] + } + } + } + ] + }, + + "window_size_samples": { + "description": "Number of samples per BCG.msg", + "type": "integer" + }, + + "quality_window_size_samples": { + "description": "Number of samples per quality value", + "type": "integer" + }, + + "units": { + "type": "string", + "enum": ["Unknown", "mV", "uV", "Counts", "M/s2", "Newton"] + }, + + "gain": { + "type": "number", + "description": "Multiplicative factor (e.g., µV/count); set to 1.0 if signal is already scaled" + }, + + "adc_resolution": { + "description": "Bits (e.g. 12, 16)", + "type": "integer" + }, + "number_of_sensors": { - "type": "number" + "description": "Number of sensors used for measurement", + "type": "integer" }, - "sensor_locations": { - "type": "array", - "items": { - "type": "string" - } + + "sensor_placements": { + "description": "Sensor Placements", + "type": "string", + "enum": [ + "Chest", "Back", "Mattress", "Chair", "Feet", "Wrist", "Arm", "Desk", "Clothing", "Custom" + ] }, "sensing_direction": { - "type": "string" + "description": "Axis along which BCG is measured", + "type": "string", + "enum": [ + "Dorso Ventral", "Longitudinal", "Medio Lateral", "Unkown" + ] }, "sensing_modality": { - "type": "string" + "description": "Type of Sensor used", + "type": "string", + "enum": [ + "Piezoelectric Film", "Forceplate", "Accelerometer", "Piezoelectric crystal", "Unkown" + ] }, "measurement_system": { - "type": "string" + "description": "System Type", + "type": "string", + "enum": [ + "Starr", "Nickerson", "Dock", "Other", "Unknown" + ] } } } diff --git a/schema/ros4hc/ecg-lead-1.x.json b/schema/ros4hc/ecg-1.x.json similarity index 67% rename from schema/ros4hc/ecg-lead-1.x.json rename to schema/ros4hc/ecg-1.x.json index d868318f..d0e61b4a 100644 --- a/schema/ros4hc/ecg-lead-1.x.json +++ b/schema/ros4hc/ecg-1.x.json @@ -14,8 +14,21 @@ }, "properties": { - "ecg_lead_data": { - "description": "EDA signal amplitude", + "session_id": { + "description": "match ECGInfo's session_id (if used)", + "type": "string" + }, + + "channel_size": { + "type": "integer" + }, + + "sample_size": { + "type": "integer" + }, + + "ecg": { + "description": "Raw or filtered ECG values", "type": "array", "items": { "type": "number" @@ -23,19 +36,14 @@ }, "signal_quality": { - "description": "Signal quality score (0-1)", - "type:": "array", + "description": "From 0 (poor) to 1 [%]", + "type": "array", "items": { "type": "number", - "minimum": 0, - "maximum": 1 + "maximum": 1, + "minimum": 0 } }, - - "unit": { - "type": "string", - "enum": ["µV", "mV"] - }, "effective_time_frame": { "allOf": [ @@ -50,9 +58,8 @@ }, "required": [ - "ecg_lead_data", + "ecg", "signal_quality", - "unit", "effective_time_frame" ] } diff --git a/schema/ros4hc/ecg-info-1.x.json b/schema/ros4hc/ecg-info-1.x.json index 1f552a9b..e9dd45a0 100644 --- a/schema/ros4hc/ecg-info-1.x.json +++ b/schema/ros4hc/ecg-info-1.x.json @@ -11,11 +11,15 @@ }, "ecg_body": { - "$ref": "ecg-lead-1.x.json" + "$ref": "ecg-1.x.json" }, "lead_location_enum": { "$ref": "lead-location-1.x.json" + }, + + "filter": { + "$ref": "healthcare-filterbase-1.x.json" } }, @@ -26,20 +30,78 @@ "type":"object", "allOf": [ {"$ref": "#/definitions/header"}, + + {"$ref": "#/definitions/filter"}, + { "type": "object", "properties": { "ecg_info": { "type": "object", "properties": { - "lead_number": { - "type": "number" + + "sampling_frequency": { + "allOf": [ + { + "$ref": "#/definitions/unit_value" + }, + { + "type": "object", + "properties": { + "unit": { + "enum": [ + "Hz" + ] + } + } + } + ] }, - "location_lead": { + "window_size_samples": { + "description": "Number of samples per ECG.msg", + "type": "integer" + }, + + "quality_window_size_samples": { + "description": "Number of samples per quality value", + "type": "integer" + }, + + "units": { + "type": "string", + "enum": ["Unknown", "mV", "uV", "Counts"] + }, + + "gain": { + "type": "number", + "description": "Multiplicative factor (e.g., µV/count); set to 1.0 if signal is already scaled" + }, + + "adc_resolution": { + "description": "Bits (e.g. 12, 16)", + "type": "integer" + }, + + "electrode_placement": { + "description": "Support multiple electrode placements", + "type": "array", + "items": { + "type": "string", + "enum": [ + "Unknown", "Placement Limb", "Wrist Ankle", "Chest", "Torso", "Abdomen", "Back", "Ear", "Neck", "Left Arm", "Right Arm", "Left Leg", "Right Leg", "Custom" + ] + } + }, + + "lead_type": { "$ref": "#/definitions/lead_location_enum" } - } + }, + + "required": [ + "sampling_frequency", "units" + ] } } } diff --git a/schema/ros4hc/eda-1.x.json b/schema/ros4hc/eda-1.x.json new file mode 100644 index 00000000..b748401d --- /dev/null +++ b/schema/ros4hc/eda-1.x.json @@ -0,0 +1,81 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "EDA Data", + "description": "This schema represents eda waveform data", + "type": "object", + + "definitions": { + "time_frame": { + "$ref": "time-frame-1.0.json" + }, + "time_interval": { + "$ref": "time-interval-1.0.json" + } + }, + + "properties": { + "session_id": { + "description": "match EdaInfo's session_id (if used)", + "type": "string" + }, + + "sample_size": { + "type": "integer" + }, + + "scl": { + "description": "Skin Conductance Level (tonic)", + "type": "array", + "items": { + "type": "number" + } + }, + + "scr": { + "description": "Skin Conductance Response (phasic)", + "type": "array", + "items": { + "type": "number" + } + }, + + "eda": { + "description": "Sum of signals (scl + scr", + "type": "array", + "items": { + "type": "number" + } + }, + + "signal_quality": { + "description": "From 0 (poor) to 1 [%]", + "type": "array", + "items": { + "type": "number", + "maximum": 1, + "minimum": 0 + } + }, + + "effective_time_frame": { + "description": "The time interval at which, or time interval during which the measurement is asserted as being valid.", + "allOf": [ + { + "$ref": "#/definitions/time_frame" + }, + { + "required": [ + "time_interval" + ] + } + ] + } + }, + "required": [ + "scl", + "scr", + "eda", + "signal_quality", + "effective_time_frame" + ] +} \ No newline at end of file diff --git a/schema/ros4hc/eda-info-1-x.json b/schema/ros4hc/eda-info-1-x.json new file mode 100644 index 00000000..46988307 --- /dev/null +++ b/schema/ros4hc/eda-info-1-x.json @@ -0,0 +1,127 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + + "title": "EdaInfo Data Series", + "type": "object", + "description": "This schema represents a eda data series, i.e., an array of measures that share the same header.", + + "definitions": { + "header": { + "$ref": "sensor-device-header-1.x.json" + }, + + "eda_body": { + "$ref": "eda-1.x.json" + }, + + "filter": { + "$ref": "healthcare-filterbase-1.x.json" + } + }, + + + "properties": { + "header": { + "description": "The header of the data point.", + "type":"object", + "allOf": [ + {"$ref": "#/definitions/header"}, + + {"$ref": "#/definitions/filter"}, + + { + "type": "object", + "properties": { + "eda_info": { + "type": "object", + "properties": { + + "sampling_frequency": { + "allOf": [ + { + "$ref": "#/definitions/unit_value" + }, + { + "type": "object", + "properties": { + "unit": { + "enum": [ + "Hz" + ] + } + } + } + ] + }, + + "window_size_samples": { + "description": "Number of samples per EDA.msg", + "type": "integer" + }, + + "quality_window_size_samples": { + "description": "Number of samples per quality value", + "type": "integer" + }, + + "units": { + "type": "string", + "enum": ["Unknown", "Micro Siemens", "Counts"] + }, + + "gain": { + "type": "number", + "description": "Multiplicative factor (e.g., µV/count); set to 1.0 if signal is already scaled" + }, + + "adc_resolution": { + "description": "Bits (e.g. 12, 16)", + "type": "integer" + }, + + "electrode_placement": { + "description": "Support multiple electrode placements", + "type": "array", + "items": { + "type": "string", + "enum": [ + "Unknown", "Palm", "Fingertip", "Wrist", "Forearm", "Sole", "Shoulder", "Custom" + ] + } + }, + + "signal_mode": { + "type": "string", + "enum": ["Unknown", "Surface", "Intracutaneous", "Custom"] + }, + + "measuring_technique": { + "type": "string", + "enum": ["Unknown", "Endosomatic", "Exosomatic", "Custom"] + }, + + "current_form": { + "type": "string", + "enum": ["Unknown", "DC", "AC"] + } + }, + + "required": [ + "sampling_frequency", "units" + ] + } + } + } + ] + }, + + "body": { + "$ref": "#/definitions/eda_body" + } + }, + + "required": [ + "header", + "body" + ] +} diff --git a/schema/ros4hc/eeg-1.x.json b/schema/ros4hc/eeg-1.x.json new file mode 100644 index 00000000..a9509955 --- /dev/null +++ b/schema/ros4hc/eeg-1.x.json @@ -0,0 +1,65 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "EEG Data", + "description": "This schema represents EEG waveform segments with associated signal quality and recording timestamps.", + "type": "object", + + "definitions": { + "time_frame": { + "$ref": "time-frame-1.0.json" + }, + "time_interval": { + "$ref": "time-interval-1.0.json" + } + }, + + "properties": { + "session_id": { + "description": "match EEGInfo's session_id (if used)", + "type": "string" + }, + + "channel_size": { + "type": "integer" + }, + + "sample_size": { + "type": "integer" + }, + + "eeg": { + "description": "Raw or filtered EEG values", + "type": "array", + "items": { + "type": "number" + } + }, + + "signal_quality": { + "description": "From 0 (poor) to 1 [%]", + "type": "array", + "items": { + "type": "number", + "maximum": 1, + "minimum": 0 + } + }, + + "effective_time_frame": { + "allOf": [ + { + "$ref": "#/definitions/time_frame" + }, + { + "required": ["time_interval"] + } + ] + } + }, + + "required": [ + "eeg", + "signal_quality", + "effective_time_frame" + ] +} diff --git a/schema/ros4hc/eeg-info-1.x.json b/schema/ros4hc/eeg-info-1.x.json new file mode 100644 index 00000000..fc588309 --- /dev/null +++ b/schema/ros4hc/eeg-info-1.x.json @@ -0,0 +1,127 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + + "title": "EEGInfo Data Series", + "type": "object", + "description": "This schema represents a eeg data series, i.e., an array of measures that share the same header.", + + "definitions": { + "header": { + "$ref": "sensor-device-header-1.x.json" + }, + + "eeg_body": { + "$ref": "eeg-1.x.json" + }, + + "filter": { + "$ref": "healthcare-filterbase-1.x.json" + } + }, + + + "properties": { + "header": { + "description": "The header of the data point.", + "type":"object", + "allOf": [ + {"$ref": "#/definitions/header"}, + + {"$ref": "#/definitions/filter"}, + + { + "type": "object", + "properties": { + "eeg_info": { + "type": "object", + "properties": { + + "sampling_frequency": { + "allOf": [ + { + "$ref": "#/definitions/unit_value" + }, + { + "type": "object", + "properties": { + "unit": { + "enum": [ + "Hz" + ] + } + } + } + ] + }, + + "window_size_samples": { + "description": "Number of samples per EEG.msg", + "type": "integer" + }, + + "quality_window_size_samples": { + "description": "Number of samples per quality value", + "type": "integer" + }, + + "units": { + "type": "string", + "enum": ["Unknown", "uV", "mV", "Counts"] + }, + + "gain": { + "type": "number", + "description": "Multiplicative factor (e.g., µV/count); set to 1.0 if signal is already scaled" + }, + + "adc_resolution": { + "description": "Bits (e.g. 12, 16)", + "type": "integer" + }, + + "electrode_placement": { + "description": "Support multiple electrode placements", + "type": "array", + "items": { + "type": "string", + "enum": [ + "Unknown", "Method 1020", "Method 1010", "Method 105", "Custom" + ] + } + }, + + "electrode_site": { + "type": "string", + "enum": ["Unknown", "FP1", "FP2", "F3", "F4", "C3", "C4", "P3", "P4", "O1", "O2", "F7", "F8", "T3", "T4", "T5", "T6", "FZ", "CZ", "PZ", "OZ", "Custom"] + }, + + "electrode_physical_type": { + "type": "string", + "enum": ["Unknown", "AgCl", "Gold Cup", "Dry", "Wet", "Hydrogel", "Microneedle", "Custom"] + }, + + "signal_mode": { + "type": "string", + "enum": ["Unknown", "Surface", "Intracranial", "Custom"] + } + }, + + "required": [ + "sampling_frequency", "units" + ] + } + } + } + ] + }, + + "body": { + "$ref": "#/definitions/eeg_body" + } + }, + + "required": [ + "header", + "body" + ] +} diff --git a/schema/ros4hc/emg-1.x.json b/schema/ros4hc/emg-1.x.json new file mode 100644 index 00000000..bf580776 --- /dev/null +++ b/schema/ros4hc/emg-1.x.json @@ -0,0 +1,65 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "EMG Data", + "description": "This schema represents EMG waveform segments with associated signal quality and recording timestamps.", + "type": "object", + + "definitions": { + "time_frame": { + "$ref": "time-frame-1.0.json" + }, + "time_interval": { + "$ref": "time-interval-1.0.json" + } + }, + + "properties": { + "session_id": { + "description": "match EMGInfo's session_id (if used)", + "type": "string" + }, + + "channel_size": { + "type": "integer" + }, + + "sample_size": { + "type": "integer" + }, + + "emg": { + "description": "Raw or filtered EMG values", + "type": "array", + "items": { + "type": "number" + } + }, + + "signal_quality": { + "description": "From 0 (poor) to 1 [%]", + "type": "array", + "items": { + "type": "number", + "maximum": 1, + "minimum": 0 + } + }, + + "effective_time_frame": { + "allOf": [ + { + "$ref": "#/definitions/time_frame" + }, + { + "required": ["time_interval"] + } + ] + } + }, + + "required": [ + "emg", + "signal_quality", + "effective_time_frame" + ] +} diff --git a/schema/ros4hc/emg-info-1.x.json b/schema/ros4hc/emg-info-1.x.json new file mode 100644 index 00000000..770d13dc --- /dev/null +++ b/schema/ros4hc/emg-info-1.x.json @@ -0,0 +1,125 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + + "title": "EMGInfo Data Series", + "type": "object", + "description": "This schema represents a emg data series, i.e., an array of measures that share the same header.", + + "definitions": { + "header": { + "$ref": "sensor-device-header-1.x.json" + }, + + "emg_body": { + "$ref": "emg-1.x.json" + }, + + "filter": { + "$ref": "healthcare-filterbase-1.x.json" + } + }, + + + "properties": { + "header": { + "description": "The header of the data point.", + "type":"object", + "allOf": [ + {"$ref": "#/definitions/header"}, + + {"$ref": "#/definitions/filter"}, + + { + "type": "object", + "properties": { + "emg_info": { + "type": "object", + "properties": { + + "sampling_frequency": { + "allOf": [ + { + "$ref": "#/definitions/unit_value" + }, + { + "type": "object", + "properties": { + "unit": { + "enum": [ + "Hz" + ] + } + } + } + ] + }, + + "window_size_samples": { + "description": "Number of samples per EMG.msg", + "type": "integer" + }, + + "quality_window_size_samples": { + "description": "Number of samples per quality value", + "type": "integer" + }, + + "units": { + "type": "string", + "enum": ["Unknown", "uV", "mV", "Counts"] + }, + + "gain": { + "type": "number", + "description": "Multiplicative factor (e.g., µV/count); set to 1.0 if signal is already scaled" + }, + + "adc_resolution": { + "description": "Bits (e.g. 12, 16)", + "type": "integer" + }, + + "electrode_placement": { + "description": "Support multiple electrode placements", + "type": "array", + "items": { + "type": "string", + "enum": ["Unknown", "Biceps", "Triceps", "Forearm", "Calf", "Back", "Abdomen", "Quadriceps", "Hamstring", "Face", "Neck", "Custom"] + } + }, + + "electrode_type": { + "type": "string", + "enum": ["Unknown", "Surface", "Needle", "Wire", "Interferential", "Custom"] + }, + + "external_device": { + "type": "string", + "enum": ["Unknown", "TENS", "FES", "EMG Trigger", "Custom"] + }, + + "signal_mode": { + "type": "string", + "enum": ["Unknown", "Surface", "Intramuscular", "Custom"] + } + }, + + "required": [ + "sampling_frequency", "units" + ] + } + } + } + ] + }, + + "body": { + "$ref": "#/definitions/emg_body" + } + }, + + "required": [ + "header", + "body" + ] +} diff --git a/schema/ros4hc/eog-1.x.json b/schema/ros4hc/eog-1.x.json new file mode 100644 index 00000000..1689a0d5 --- /dev/null +++ b/schema/ros4hc/eog-1.x.json @@ -0,0 +1,65 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "EOG Data", + "description": "This schema represents EOG waveform segments with associated signal quality and recording timestamps.", + "type": "object", + + "definitions": { + "time_frame": { + "$ref": "time-frame-1.0.json" + }, + "time_interval": { + "$ref": "time-interval-1.0.json" + } + }, + + "properties": { + "session_id": { + "description": "match EOGInfo's session_id (if used)", + "type": "string" + }, + + "channel_size": { + "type": "integer" + }, + + "sample_size": { + "type": "integer" + }, + + "eog": { + "description": "Raw or filtered EOG values", + "type": "array", + "items": { + "type": "number" + } + }, + + "signal_quality": { + "description": "From 0 (poor) to 1 [%]", + "type": "array", + "items": { + "type": "number", + "maximum": 1, + "minimum": 0 + } + }, + + "effective_time_frame": { + "allOf": [ + { + "$ref": "#/definitions/time_frame" + }, + { + "required": ["time_interval"] + } + ] + } + }, + + "required": [ + "eog", + "signal_quality", + "effective_time_frame" + ] +} diff --git a/schema/ros4hc/eog-info-1.x.json b/schema/ros4hc/eog-info-1.x.json new file mode 100644 index 00000000..f1046910 --- /dev/null +++ b/schema/ros4hc/eog-info-1.x.json @@ -0,0 +1,154 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + + "title": "EOGInfo Data Series", + "type": "object", + "description": "This schema represents a eog data series, i.e., an array of measures that share the same header.", + + "definitions": { + "header": { + "$ref": "sensor-device-header-1.x.json" + }, + + "eog_body": { + "$ref": "eog-1.x.json" + }, + + "filter": { + "$ref": "healthcare-filterbase-1.x.json" + }, + + "unit_value": { + "$ref": "unit-value-1.0.json" + } + }, + + + "properties": { + "header": { + "description": "The header of the data point.", + "type":"object", + "allOf": [ + {"$ref": "#/definitions/header"}, + + {"$ref": "#/definitions/filter"}, + + { + "type": "object", + "properties": { + "eog_info": { + "type": "object", + "properties": { + + "sampling_frequency": { + "allOf": [ + { + "$ref": "#/definitions/unit_value" + }, + { + "type": "object", + "properties": { + "unit": { + "enum": [ + "Hz" + ] + } + } + } + ] + }, + + "window_size_samples": { + "description": "Number of samples per EOG.msg", + "type": "integer" + }, + + "quality_window_size_samples": { + "description": "Number of samples per quality value", + "type": "integer" + }, + + "units": { + "type": "string", + "enum": ["Unknown", "uV", "mV", "Counts"] + }, + + "gain": { + "type": "number", + "description": "Multiplicative factor (e.g., µV/count); set to 1.0 if signal is already scaled" + }, + + "adc_resolution": { + "description": "Bits (e.g. 12, 16)", + "type": "integer" + }, + + "electrode_placement": { + "description": "Support multiple electrode placements", + "type": "array", + "items": { + "type": "string", + "enum": ["Unknown", "Left Eye", "Right Eye", "Forehead", "Temple Left", "Temple Right", "Above Eye", "Below Eye", "Custom"] + } + }, + + "lead_type": { + "type": "string", + "enum": ["Unknown", "Bipolar Horizontal", "Bipolar Vertical", "Unipolar", "Corneal Retinal", "Custom"] + }, + + "signal_mode": { + "type": "string", + "enum": ["Unknown", "Surface", "Bipolar", "Unipolar", "Corneal Retinal", "Intracular", "Derived", "Custom"] + }, + + "lightsource": { + "type": "string", + "enum": ["Unknown", "Tungsten", "Halogen", "LED", "Fluorescent", "Sunlight", "Custom"] + }, + + "gazefield_background_light_brightness": { + "allOf": [ + { + "$ref": "#/definitions/unit_value" + }, + { + "type": "object", + "properties": { + "unit": { + "enum": [ + "cd/m^2" + ] + } + } + } + ] + }, + + "length_light_dark_phase" : { + "type": "array", + "items": { + "type": "number" + } + } + }, + + "required": [ + "sampling_frequency", "units" + ] + } + } + } + ] + }, + + "body": { + "$ref": "#/definitions/eog_body" + } + }, + + "required": [ + "header", + "body" + ] +} diff --git a/schema/ros4hc/healthcare-filterbase-1-x.json b/schema/ros4hc/healthcare-filterbase-1-x.json new file mode 100644 index 00000000..e69de29b diff --git a/schema/ros4hc/icg-1.x.json b/schema/ros4hc/icg-1.x.json new file mode 100644 index 00000000..4a4865eb --- /dev/null +++ b/schema/ros4hc/icg-1.x.json @@ -0,0 +1,63 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ICG Data", + "description": "This schema represents ICG waveform data from a specific lead with signal quality and temporal context", + "type": "object", + + "definitions": { + "time_frame": { + "$ref": "time-frame-1.0.json" + }, + "time_interval": { + "$ref": "time-interval-1.0.json" + } + }, + + "properties": { + "session_id": { + "description": "match ICGInfo's session_id (if used)", + "type": "string" + }, + + "sample_size": { + "type": "integer" + }, + + "icg": { + "description": "Raw or filtered ICG values", + "type": "array", + "items": { + "type": "number" + } + }, + + "signal_quality": { + "description": "From 0 (poor) to 1 [%]", + "type": "array", + "items": { + "type": "number", + "maximum": 1, + "minimum": 0 + } + }, + + "effective_time_frame": { + "description": "The time interval at which, or time interval during which the measurement is asserted as being valid.", + "allOf": [ + { + "$ref": "#/definitions/time_frame" + }, + { + "required": [ + "time_interval" + ] + } + ] + } + }, + "required": [ + "icg", + "signal_quality", + "effective_time_frame" + ] +} \ No newline at end of file diff --git a/schema/ros4hc/icg-info-1.x.json b/schema/ros4hc/icg-info-1.x.json new file mode 100644 index 00000000..bfd77fc4 --- /dev/null +++ b/schema/ros4hc/icg-info-1.x.json @@ -0,0 +1,124 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + + "title": "ICGInfo Data Series", + "type": "object", + "description": "This schema represents a icg data series, i.e., an array of measures that share the same header.", + + "definitions": { + "header": { + "$ref": "sensor-device-header-1.x.json" + }, + + "icg_body": { + "$ref": "icg-1.x.json" + }, + + "filter": { + "$ref": "healthcare-filterbase-1.x.json" + }, + + "unit_value": { + "$ref": "unit-value-1.0.json" + } + }, + + + "properties": { + "header": { + "description": "The header of the data point.", + "type":"object", + "allOf": [ + {"$ref": "#/definitions/header"}, + + {"$ref": "#/definitions/filter"}, + + { + "type": "object", + "properties": { + "icg_info": { + "type": "object", + "properties": { + + "sampling_frequency": { + "allOf": [ + { + "$ref": "#/definitions/unit_value" + }, + { + "type": "object", + "properties": { + "unit": { + "enum": [ + "Hz" + ] + } + } + } + ] + }, + + "window_size_samples": { + "description": "Number of samples per ICG.msg", + "type": "integer" + }, + + "quality_window_size_samples": { + "description": "Number of samples per quality value", + "type": "integer" + }, + + "units": { + "type": "string", + "enum": ["Unknown", "Ohms", "MOhms", "Counts"] + }, + + "gain": { + "type": "number", + "description": "Multiplicative factor (e.g., µV/count); set to 1.0 if signal is already scaled" + }, + + "adc_resolution": { + "description": "Bits (e.g. 12, 16)", + "type": "integer" + }, + + "electrode_placement": { + "description": "Support multiple electrode placements", + "type": "array", + "items": { + "type": "string", + "enum": ["Unknown", "Chest", "Back", "Left Arm", "Right Arm", "Left Leg", "Right Leg", "Neck", "Abdomen", "Custom"] + } + }, + + "lead_type": { + "type": "string", + "enum": ["Unknown", "Transthoracic", "Four Electrode", "Six Electrode", "Spot", "Custom"] + }, + + "technique": { + "type": "string", + "enum": ["Unknown", "Tetrapolar", "Octapolar", "Custom"] + } + }, + + "required": [ + "sampling_frequency", "units" + ] + } + } + } + ] + }, + + "body": { + "$ref": "#/definitions/icg_body" + } + }, + + "required": [ + "header", + "body" + ] +} diff --git a/schema/ros4hc/lead-location-1.x.json b/schema/ros4hc/lead-location-1.x.json index e65f02bc..5cf37ccc 100644 --- a/schema/ros4hc/lead-location-1.x.json +++ b/schema/ros4hc/lead-location-1.x.json @@ -15,6 +15,6 @@ "I", "II", "III", "aVR", "aVL", "aVF", "V1", "V2", "V3", "V4", "V5", "V6", - "V1R", "V2R", "V3R", "V4R", "V5R", "V6R" + "Unknown", "Custom" ] } diff --git a/schema/ros4hc/pcg-1.x.json b/schema/ros4hc/pcg-1.x.json new file mode 100644 index 00000000..46aa9467 --- /dev/null +++ b/schema/ros4hc/pcg-1.x.json @@ -0,0 +1,75 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PPG Data", + "description": "This schema represents PPG waveform data from a specific lead with signal quality and temporal context", + "type": "object", + + "definitions": { + "time_frame": { + "$ref": "time-frame-1.0.json" + }, + "time_interval": { + "$ref": "time-interval-1.0.json" + } + }, + + "properties": { + "session_id": { + "description": "match PPGInfo's session_id (if used)", + "type": "string" + }, + + "sample_size": { + "type": "integer" + }, + + "wavelength_size": { + "type": "integer" + }, + + "ac_component": { + "type": "number" + }, + + "dc_component" : { + "type": "number" + }, + + "ppg": { + "description": "Raw or filtered PPF values", + "type": "array", + "items": { + "type": "number" + } + }, + + "signal_quality": { + "description": "From 0 (poor) to 1 [%]", + "type": "array", + "items": { + "type": "number", + "maximum": 1, + "minimum": 0 + } + }, + + "effective_time_frame": { + "description": "The time interval at which, or time interval during which the measurement is asserted as being valid.", + "allOf": [ + { + "$ref": "#/definitions/time_frame" + }, + { + "required": [ + "time_interval" + ] + } + ] + } + }, + "required": [ + "ppg", + "signal_quality", + "effective_time_frame" + ] +} \ No newline at end of file diff --git a/schema/ros4hc/pcg-info-1.x.json b/schema/ros4hc/pcg-info-1.x.json new file mode 100644 index 00000000..cfc0f1ad --- /dev/null +++ b/schema/ros4hc/pcg-info-1.x.json @@ -0,0 +1,115 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + + "title": "PPGInfo Data Series", + "type": "object", + "description": "This schema represents a ppg data series, i.e., an array of measures that share the same header.", + + "definitions": { + "header": { + "$ref": "sensor-device-header-1.x.json" + }, + + "ppg_body": { + "$ref": "ppg-1.x.json" + }, + + "filter": { + "$ref": "healthcare-filterbase-1.x.json" + }, + + "unit_value": { + "$ref": "unit-value-1.0.json" + } + }, + + + "properties": { + "header": { + "description": "The header of the data point.", + "type":"object", + "allOf": [ + {"$ref": "#/definitions/header"}, + + {"$ref": "#/definitions/filter"}, + + { + "type": "object", + "properties": { + "ppg_info": { + "type": "object", + "properties": { + + "sampling_frequency": { + "allOf": [ + { + "$ref": "#/definitions/unit_value" + }, + { + "type": "object", + "properties": { + "unit": { + "enum": [ + "Hz" + ] + } + } + } + ] + }, + + "window_size_samples": { + "description": "Number of samples per ICG.msg", + "type": "integer" + }, + + "quality_window_size_samples": { + "description": "Number of samples per quality value", + "type": "integer" + }, + + "units": { + "type": "string", + "enum": ["Unknown", "mV", "uV", "RLU", "Counts"] + }, + + "gain": { + "type": "number", + "description": "Multiplicative factor (e.g., µV/count); set to 1.0 if signal is already scaled" + }, + + "wavelengths_mm": { + "description": "One entry per PPG channel; may be [660, 880, 940]", + "type": "integer" + }, + + "sensor_placement": { + "type": "string", + "enum": ["Unknown", "Finger", "Wrist", "Earlobe", "Forehead", "Toe", "Arm", "Chest", "Ankle", "Nose", "Palm", "Sole", "Custom"] + }, + + "measuring_mode": { + "type": "string", + "enum": ["Unknown", "Transmissive Absorption", "Reflective", "Custom"] + } + }, + + "required": [ + "sampling_frequency", "units" + ] + } + } + } + ] + }, + + "body": { + "$ref": "#/definitions/ppg_body" + } + }, + + "required": [ + "header", + "body" + ] +} diff --git a/schema/ros4hc/toChange/eda-1.x.json b/schema/ros4hc/toChange/eda-1.x.json deleted file mode 100644 index 804b68bf..00000000 --- a/schema/ros4hc/toChange/eda-1.x.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "EDA Data", - "description": "This schema represents EDA waveform segments with associated signal quality and recording timestamps.", - "type": "object", - - "definitions": { - "time_frame": { - "$ref": "time-frame-1.0.json" - } - }, - - "properties": { - "eda_episodes": { - "description": "EDA waveform samples", - "type": "array", - "items": { - "type": "object", - "properties": { - "eda_value": { - "type": "number", - "description": "EDA signal amplitude" - }, - "unit": { - "type": "string", - "enum": ["uS"] - }, - "signal_quality": { - "type": "number", - "minimum": 0, - "maximum": 1, - "description": "Signal quality score (0-1)" - }, - "eda_time_frame":{ - "description": "Timestamp when this sample was recorded", - "allOf": [ - { - "$ref": "#/definitions/time_frame" - }, - { - "required": [ - "date_time" - ] - } - ] - } - }, - "required": ["eda_value", "signal_quality", "unit", "eda_time_frame"] - } - }, - "effective_time_frame": { - "allOf": [ - { - "$ref": "#/definitions/time_frame" - }, - { - "required": ["time_interval"] - } - ] - } - }, - - "required": ["eda_episodes", "effective_time_frame"] -} diff --git a/schema/ros4hc/toChange/emg-1.x.json b/schema/ros4hc/toChange/emg-1.x.json deleted file mode 100644 index a07cb5a5..00000000 --- a/schema/ros4hc/toChange/emg-1.x.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "EMG Data", - "description": "This schema represents EMG waveform segments with associated signal quality and recording timestamps.", - "type": "object", - - "definitions": { - "time_frame": { - "$ref": "time-frame-1.0.json" - } - }, - - "properties": { - "emg_episodes": { - "description": "EMG waveform samples", - "type": "array", - "items": { - "type": "object", - "properties": { - "emg_value": { - "type": "number", - "description": "EMG signal amplitude" - }, - "unit": { - "type": "string", - "enum": ["µV", "mV"] - }, - "signal_quality": { - "type": "number", - "minimum": 0, - "maximum": 1, - "description": "Signal quality score (0-1)" - }, - "emg_time_frame":{ - "description": "Timestamp when this sample was recorded", - "allOf": [ - { - "$ref": "#/definitions/time_frame" - }, - { - "required": [ - "date_time" - ] - } - ] - } - }, - "required": ["emg_value", "signal_quality", "unit", "emg_time_frame"] - } - }, - "effective_time_frame": { - "allOf": [ - { - "$ref": "#/definitions/time_frame" - }, - { - "required": ["time_interval"] - } - ] - } - }, - - "required": ["emg_episodes", "effective_time_frame"] -} diff --git a/schema/ros4hc/toChange/eog-1.x.json b/schema/ros4hc/toChange/eog-1.x.json deleted file mode 100644 index 85c59f2a..00000000 --- a/schema/ros4hc/toChange/eog-1.x.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "EOG Data", - "description": "This schema represents EOG waveform segments with associated signal quality and recording timestamps.", - "type": "object", - - "definitions": { - "time_frame": { - "$ref": "time-frame-1.0.json" - } - }, - - "properties": { - "eog_episodes": { - "description": "EOG waveform samples", - "type": "array", - "items": { - "type": "object", - "properties": { - "eog_value": { - "type": "number", - "description": "EOG signal amplitude" - }, - "unit": { - "type": "string", - "enum": ["µV", "mV"] - }, - "signal_quality": { - "type": "number", - "minimum": 0, - "maximum": 1, - "description": "Signal quality score (0-1)" - }, - "eog_time_frame":{ - "description": "Timestamp when this sample was recorded", - "allOf": [ - { - "$ref": "#/definitions/time_frame" - }, - { - "required": [ - "date_time" - ] - } - ] - } - }, - "required": ["eog_value", "signal_quality", "unit", "eog_time_frame"] - } - }, - "effective_time_frame": { - "allOf": [ - { - "$ref": "#/definitions/time_frame" - }, - { - "required": ["time_interval"] - } - ] - } - }, - - "required": ["eog_episodes", "effective_time_frame"] -} diff --git a/schema/ros4hc/unfinished-ideas/ecg-leads-1.x.json b/schema/ros4hc/unfinished-ideas/ecg-leads-1.x.json deleted file mode 100644 index 92299244..00000000 --- a/schema/ros4hc/unfinished-ideas/ecg-leads-1.x.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "ECG Leads", - "description": "This schema represents ECG Leads with each associated signal quality and recording timestamps.", - "type": "object", - - "definitions": { - "time_frame": { - "$ref": "time-frame-1.0.json" - }, - "time_interval": { - "$ref": "time-interval-1.0.json" - }, - "ecg_lead": { - "$ref": "ecg-lead-1.x.json" - } - - }, - - "properties": { - "ecg_leads_data": { - "description": "Array of ECG lead measurements", - "type": "object" - }, - - "effective_time_frame": { - "allOf": [ - { - "$ref": "#/definitions/time_frame" - }, - { - "required": ["time_interval"] - } - ] - } - }, - - "required": [ - "ecg_leads_data", - "effective_time_frame" - ] -} diff --git a/test-data/ros4hc/full-sample-data/bcg-full-sample-data.json b/test-data/ros4hc/deprecated/bcg-full-sample-data.json similarity index 100% rename from test-data/ros4hc/full-sample-data/bcg-full-sample-data.json rename to test-data/ros4hc/deprecated/bcg-full-sample-data.json diff --git a/test-data/ros4hc/bcg-sample-body-data.json b/test-data/ros4hc/deprecated/bcg-sample-body-data.json similarity index 100% rename from test-data/ros4hc/bcg-sample-body-data.json rename to test-data/ros4hc/deprecated/bcg-sample-body-data.json diff --git a/test-data/ros4hc/deprecated/ecg-full-sample-data.json b/test-data/ros4hc/deprecated/ecg-full-sample-data.json new file mode 100644 index 00000000..afd4703f --- /dev/null +++ b/test-data/ros4hc/deprecated/ecg-full-sample-data.json @@ -0,0 +1,77 @@ +{ + "header": { + "uuid": "123e4567-e89b-12d3-a456-426614174000-LLMGenerated", + "schema_id": "ecg-lead-1.x", + "source_creation_date_time": "2025-06-21T14:30:00Z", + "modality": "sensed", + "acquisition_rate": { + "value": 250, + "unit": "Hz" + }, + "external_datasheets": [ + { + "datasheet_type": "hardware", + "datasheet_reference": "https://example.com/devices/ecg-sensor-3000" + } + ], + "device_identity": { + "device_manufacturer": "HealthTech Inc.", + "device_name": "ECG Sensor 3000", + "device_type": "wearable", + "device_serial_number": "HTI-ECG-987654" + }, + "environmental_requirements": { + "battery_level": { + "value": 85, + "unit": "%" + }, + "minimal_operation_temperature": { + "value": -5, + "unit": "°C" + }, + "maximal_operation_temperature": { + "value": 45, + "unit": "°C" + }, + "maximal_relative_humidity": { + "value": 95, + "unit": "%" + }, + "minimal_atmospheric_pressure": { + "value": 0.8, + "unit": "atm" + }, + "maximal_atmospheric_pressure": { + "value": 1.2, + "unit": "atm" + } + }, + "measurement_specs": { + "measuring_unit": "µV", + "sampling_frequency_hz": 250, + "resolution": 0.1, + "accuracy": 0.98, + "max_range": 5000, + "min_range": -5000 + }, + "ecg_info": { + "lead_number": 1, + "location_lead": "II" + } + }, + + "body": { + "ecg_lead_data": [ + 120.4, 118.9, 119.7, 122.1, 121.0, 120.8 + ], + "signal_quality": [ + 1.0, 0.99, 0.98, 1.0, 0.97, 1.0 + ], + "effective_time_frame": { + "time_interval": { + "start_date_time": "2025-06-21T14:30:00Z", + "end_date_time": "2025-06-21T14:30:02Z" + } + } + } +} diff --git a/test-data/ros4hc/eda-sample-data.json b/test-data/ros4hc/deprecated/eda-sample-data.json similarity index 100% rename from test-data/ros4hc/eda-sample-data.json rename to test-data/ros4hc/deprecated/eda-sample-data.json diff --git a/test-data/ros4hc/sensor-device-header-data.json b/test-data/ros4hc/deprecated/sensor-device-header-data.json similarity index 100% rename from test-data/ros4hc/sensor-device-header-data.json rename to test-data/ros4hc/deprecated/sensor-device-header-data.json diff --git a/test-data/ros4hc/full-sample-data/bcg-full-sample-data-1.x.json b/test-data/ros4hc/full-sample-data/bcg-full-sample-data-1.x.json new file mode 100644 index 00000000..bfedb1c0 --- /dev/null +++ b/test-data/ros4hc/full-sample-data/bcg-full-sample-data-1.x.json @@ -0,0 +1,91 @@ +{ + "header": { + "uuid": "d4c10ef2-babc-4f2d-b7f5-b05a3c6151a7", + "schema_id": { + "namespace": "org.example.health", + "name": "bcg", + "version": "1.0" + }, + "source_creation_date_time": "2025-07-04T12:00:00Z", + "modality": "sensed", + "acquisition_rate": { + "value": 100, + "unit": "Hz" + }, + "device_identity": { + "device_manufacturer": "BioSensor Inc.", + "device_name": "BCG-Monitor 2000", + "device_type": "BedSensor", + "device_serial_number": "BS2000-XYZ123" + }, + "environmental_requirements": { + "battery_level": { + "value": 85, + "unit": "%" + }, + "minimal_operation_temperature": { + "value": 10, + "unit": "°C" + }, + "maximal_operation_temperature": { + "value": 40, + "unit": "°C" + }, + "maximal_relative_humidity": { + "value": 90, + "unit": "%" + }, + "minimal_atmospheric_pressure": { + "value": 0.8, + "unit": "atm" + }, + "maximal_atmospheric_pressure": { + "value": 1.2, + "unit": "atm" + } + }, + "measurement_specs": { + "measuring_unit": "mV", + "sampling_frequency_hz": 100, + "resolution": 0.01, + "accuracy": 0.95, + "max_range": 5, + "min_range": -5 + }, + "bcg_info": { + "session_id": "bcg-session-20250704-001", + "sampling_frequency": { + "value": 100, + "unit": "Hz" + }, + "window_size_samples": 10, + "quality_window_size_samples": 10, + "units": "mV", + "gain": 2.0, + "adc_resolution": 16, + "number_of_sensors": 3, + "sensor_placements": "Mattress", + "sensing_direction": "Dorso Ventral", + "sensing_modality": "Piezoelectric Film", + "measurement_system": "Starr" + } + }, + "body": { + "session_id": "bcg-session-20250704-001", + "sample_size": 10, + "bcg": [ + 0.023, 0.045, 0.030, 0.025, 0.050, + 0.055, 0.048, 0.052, 0.049, 0.051 + ], + "signal_quality": [ + 0.95, 0.96, 0.93, 0.94, 0.97, + 0.96, 0.92, 0.94, 0.95, 0.96 + ], + "effective_time_frame": { + "time_interval": { + "start_date_time": "2025-07-04T12:00:00Z", + "end_date_time": "2025-07-04T12:00:01Z" + } + } + } +} diff --git a/test-data/ros4hc/full-sample-data/ecg-full-sample-data.json b/test-data/ros4hc/full-sample-data/ecg-full-sample-data.json index be2d6d2c..f051cc9d 100644 --- a/test-data/ros4hc/full-sample-data/ecg-full-sample-data.json +++ b/test-data/ros4hc/full-sample-data/ecg-full-sample-data.json @@ -1,24 +1,28 @@ { "header": { - "uuid": "123e4567-e89b-12d3-a456-426614174000-LLMGenerated", - "schema_id": "ecg-lead-1.x", - "source_creation_date_time": "2025-06-21T14:30:00Z", + "uuid": "123e4567-e89b-12d3-a456-426614174000", + "schema_id": { + "namespace": "org.example.ecg", + "name": "ecg-lead", + "version": "1.0" + }, + "source_creation_date_time": "2025-07-04T13:45:00Z", "modality": "sensed", "acquisition_rate": { "value": 250, "unit": "Hz" }, "external_datasheets": [ - { - "datasheet_type": "hardware", - "datasheet_reference": "https://example.com/devices/ecg-sensor-3000" - } + { + "datasheet_type": "hardware", + "datasheet_reference": "https://example.org/device/datasheet" + } ], "device_identity": { - "device_manufacturer": "HealthTech Inc.", - "device_name": "ECG Sensor 3000", + "device_manufacturer": "CardioTech Inc.", + "device_name": "ECG-SensorX", "device_type": "wearable", - "device_serial_number": "HTI-ECG-987654" + "device_serial_number": "CT-ECG-00123" }, "environmental_requirements": { "battery_level": { @@ -34,7 +38,7 @@ "unit": "°C" }, "maximal_relative_humidity": { - "value": 95, + "value": 90, "unit": "%" }, "minimal_atmospheric_pressure": { @@ -49,29 +53,44 @@ "measurement_specs": { "measuring_unit": "µV", "sampling_frequency_hz": 250, - "resolution": 0.1, + "resolution": 0.5, "accuracy": 0.98, "max_range": 5000, "min_range": -5000 }, "ecg_info": { - "lead_number": 1, - "location_lead": "II" + "sampling_frequency": { + "value": 250, + "unit": "Hz" + }, + "window_size_samples": 1000, + "quality_window_size_samples": 100, + "units": "µV", + "gain": 0.01, + "adc_resolution": 16, + "electrode_placement": [ + "Chest", + "Left Arm", + "Right Arm" + ], + "lead_type": "II" } }, - "body": { - "ecg_lead_data": [ - 120.4, 118.9, 119.7, 122.1, 121.0, 120.8 - ], + "session_id": "session-ecg-20250704-001", + "channel_size": 1, + "sample_size": 1000, + "ecg": [ + 0.5, 0.7, 0.6, 0.4, 0.2, -0.1, -0.4, -0.6, -0.7, -0.5, + 0.1, 0.6, 0.8, 0.9, 1.0, 0.8, 0.5, 0.2, 0.0, -0.2 + ], "signal_quality": [ - 1.0, 0.99, 0.98, 1.0, 0.97, 1.0 - ], - "unit": "µV", + 0.98, 0.98, 0.97, 0.96, 0.95, 0.95, 0.94, 0.94, 0.93, 0.93 + ], "effective_time_frame": { "time_interval": { - "start_date_time": "2025-06-21T14:30:00Z", - "end_date_time": "2025-06-21T14:30:02Z" + "start_date_time": "2025-07-04T13:45:00Z", + "end_date_time": "2025-07-04T13:45:04Z" } } } diff --git a/test-data/ros4hc/full-sample-data/eda-full-sample-data.json b/test-data/ros4hc/full-sample-data/eda-full-sample-data.json new file mode 100644 index 00000000..982ab4c3 --- /dev/null +++ b/test-data/ros4hc/full-sample-data/eda-full-sample-data.json @@ -0,0 +1,99 @@ +{ + "header": { + "uuid": "8fbc23da-6a9f-4d9d-b9ad-fb3410f7a8cb", + "schema_id": { + "namespace": "org.example.eda", + "name": "eda-lead", + "version": "1.0" + }, + "source_creation_date_time": "2025-07-04T13:50:00Z", + "modality": "sensed", + "acquisition_rate": { + "value": 4, + "unit": "Hz" + }, + "device_identity": { + "device_manufacturer": "BioSense Ltd.", + "device_name": "GSR-WristBand-X", + "device_type": "wearable", + "device_serial_number": "BS-EDA-00042" + }, + "environmental_requirements": { + "battery_level": { + "value": 78, + "unit": "%" + }, + "minimal_operation_temperature": { + "value": -10, + "unit": "°C" + }, + "maximal_operation_temperature": { + "value": 50, + "unit": "°C" + }, + "maximal_relative_humidity": { + "value": 95, + "unit": "%" + }, + "minimal_atmospheric_pressure": { + "value": 0.8, + "unit": "atm" + }, + "maximal_atmospheric_pressure": { + "value": 1.2, + "unit": "atm" + } + }, + "measurement_specs": { + "measuring_unit": "Micro Siemens", + "sampling_frequency_hz": 4, + "resolution": 0.1, + "accuracy": 0.95, + "max_range": 100, + "min_range": 0 + }, + "ecg_info": { + "sampling_frequency": { + "value": 4, + "unit": "Hz" + }, + "window_size_samples": 60, + "quality_window_size_samples": 15, + "units": "Micro Siemens", + "gain": 1.0, + "adc_resolution": 12, + "electrode_placement": [ + "Wrist" + ], + "electrode_type": "Surface", + "measuring_technique": "Exosomatic", + "current_form": "DC" + } + }, + "body": { + "session_id": "session-eda-20250704-001", + "sample_size": 60, + "scl": [ + 2.1, 2.2, 2.25, 2.3, 2.35, 2.4, 2.45, 2.5, 2.55, 2.6, + 2.62, 2.63, 2.65, 2.68, 2.7, 2.73, 2.76, 2.78, 2.8, 2.82 + ], + "scr": [ + 0.2, 0.18, 0.22, 0.15, 0.1, 0.08, 0.05, 0.03, 0.01, 0.0, + 0.01, 0.02, 0.04, 0.05, 0.07, 0.1, 0.12, 0.13, 0.14, 0.15 + ], + "eda": [ + 2.3, 2.38, 2.47, 2.45, 2.45, 2.48, 2.5, 2.53, 2.56, 2.6, + 2.63, 2.65, 2.69, 2.73, 2.77, 2.83, 2.88, 2.91, 2.94, 2.97 + ], + "signal_quality": [ + 1, 0.98, 0.97, 0.99, 0.96, 0.95, 0.94, 0.93, 0.92, 0.91, + 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.98, 0.99, 1.0 + ], + "effective_time_frame": { + "time_interval": { + "start_date_time": "2025-07-04T13:50:00Z", + "end_date_time": "2025-07-04T13:50:15Z" + } + } + } +} diff --git a/test-data/ros4hc/full-sample-data/eeg-full-sample-data.json b/test-data/ros4hc/full-sample-data/eeg-full-sample-data.json new file mode 100644 index 00000000..6ef82478 --- /dev/null +++ b/test-data/ros4hc/full-sample-data/eeg-full-sample-data.json @@ -0,0 +1,68 @@ +{ + "header": { + "uuid": "123e4567-e89b-12d3-a456-426614174000", + "schema_id": { + "namespace": "org.example.eeg", + "name": "eeg-data", + "version": "1.0" + }, + "source_creation_date_time": "2025-07-04T12:00:00Z", + "modality": "sensed", + "acquisition_rate": { + "value": 256, + "unit": "Hz" + }, + "device_identity": { + "device_manufacturer": "NeuroScan Inc.", + "device_name": "EEGCap Pro X", + "device_type": "wearable", + "device_serial_number": "NS-EEG-20250704-001" + }, + "eeg_info": { + "sampling_frequency": { + "value": 256, + "unit": "Hz" + }, + "window_size_samples": 64, + "quality_window_size_samples": 64, + "units": "uV", + "gain": 1.0, + "adc_resolution": 16, + "electrode_placement": ["Method 1020"], + "electrode_site": "C3", + "electrode_physical_type": "AgCl", + "signal_mode": "Surface" + } + }, + "body": { + "session_id": "session-20250704-abc123", + "channel_size": 1, + "sample_size": 64, + "eeg": [ + 10.2, 10.1, 10.3, 10.0, 10.2, 10.5, 10.6, 10.4, + 10.7, 10.8, 10.9, 11.0, 11.1, 11.3, 11.2, 11.0, + 10.9, 10.7, 10.5, 10.3, 10.2, 10.0, 9.8, 9.7, + 9.6, 9.5, 9.4, 9.2, 9.1, 9.0, 8.9, 8.8, + 8.9, 9.0, 9.1, 9.3, 9.5, 9.6, 9.7, 9.9, + 10.0, 10.1, 10.2, 10.3, 10.5, 10.6, 10.7, 10.8, + 10.9, 11.0, 11.1, 11.2, 11.3, 11.4, 11.5, 11.6, + 11.7, 11.6, 11.5, 11.3, 11.1, 11.0, 10.8, 10.6 + ], + "signal_quality": [ + 1.0, 0.98, 0.97, 0.96, 0.94, 0.92, 0.90, 0.88, + 0.87, 0.85, 0.84, 0.83, 0.82, 0.81, 0.80, 0.79, + 0.78, 0.77, 0.76, 0.75, 0.76, 0.77, 0.78, 0.79, + 0.80, 0.81, 0.82, 0.83, 0.84, 0.85, 0.86, 0.87, + 0.88, 0.89, 0.90, 0.91, 0.92, 0.93, 0.94, 0.95, + 0.96, 0.97, 0.98, 0.99, 1.0, 1.0, 0.99, 0.98, + 0.97, 0.96, 0.95, 0.94, 0.93, 0.92, 0.91, 0.90, + 0.89, 0.88, 0.87, 0.86, 0.85, 0.84, 0.83, 0.82 + ], + "effective_time_frame": { + "time_interval": { + "start_date_time": "2025-07-04T12:00:00Z", + "end_date_time": "2025-07-04T12:00:00.250Z" + } + } + } +} diff --git a/test-data/ros4hc/full-sample-data/emg-full-sample-data.json b/test-data/ros4hc/full-sample-data/emg-full-sample-data.json new file mode 100644 index 00000000..8a128f38 --- /dev/null +++ b/test-data/ros4hc/full-sample-data/emg-full-sample-data.json @@ -0,0 +1,90 @@ +{ + "header": { + "uuid": "456e7890-babc-45d1-89ef-987654321abc", + "schema_id": { + "namespace": "org.example.emg", + "name": "emg-data", + "version": "1.0" + }, + "source_creation_date_time": "2025-07-04T14:00:00Z", + "modality": "sensed", + "acquisition_rate": { + "value": 1000, + "unit": "Hz" + }, + "device_identity": { + "device_manufacturer": "BioMotion Tech", + "device_name": "EMGTrack Pro", + "device_type": "wearable", + "device_serial_number": "BM-EMG-000987" + }, + "emg_info": { + "sampling_frequency": { + "value": 1000, + "unit": "Hz" + }, + "window_size_samples": 200, + "quality_window_size_samples": 200, + "units": "uV", + "gain": 1.0, + "adc_resolution": 16, + "electrode_placement": ["Biceps"], + "electrode_type": "Surface", + "external_device": "Unknown", + "signal_mode": "Surface" + } + }, + "body": { + "session_id": "emg-session-20250704-xyz987", + "channel_size": 1, + "sample_size": 200, + "emg": [ + 2.1, 2.0, 2.3, 2.2, 2.5, 2.7, 3.0, 3.3, 3.6, 4.0, + 4.2, 4.5, 4.8, 5.1, 5.4, 5.8, 6.0, 6.2, 6.5, 6.8, + 7.0, 7.1, 7.3, 7.5, 7.7, 7.8, 8.0, 8.2, 8.5, 8.7, + 9.0, 9.2, 9.1, 9.0, 8.8, 8.6, 8.4, 8.1, 7.9, 7.6, + 7.3, 7.0, 6.8, 6.5, 6.2, 5.9, 5.6, 5.3, 5.0, 4.7, + 4.5, 4.2, 4.0, 3.7, 3.5, 3.2, 3.0, 2.8, 2.6, 2.4, + 2.2, 2.0, 1.8, 1.7, 1.6, 1.5, 1.3, 1.2, 1.1, 1.0, + 0.9, 0.8, 0.7, 0.6, 0.6, 0.5, 0.4, 0.3, 0.2, 0.2, + 0.1, 0.1, 0.0, 0.0, 0.1, 0.2, 0.4, 0.6, 0.9, 1.2, + 1.6, 2.0, 2.4, 2.8, 3.3, 3.7, 4.2, 4.7, 5.1, 5.6, + 6.1, 6.6, 7.0, 7.5, 7.9, 8.3, 8.6, 9.0, 9.2, 9.4, + 9.5, 9.4, 9.2, 8.9, 8.5, 8.1, 7.7, 7.2, 6.8, 6.3, + 5.8, 5.4, 4.9, 4.5, 4.0, 3.6, 3.2, 2.8, 2.5, 2.2, + 1.9, 1.7, 1.5, 1.3, 1.1, 1.0, 0.9, 0.8, 0.7, 0.6, + 0.6, 0.5, 0.4, 0.3, 0.2, 0.2, 0.1, 0.1, 0.0, 0.0, + 0.1, 0.2, 0.4, 0.6, 1.0, 1.5, 2.1, 2.8, 3.6, 4.5, + 5.5, 6.6, 7.8, 9.0, 9.9, 9.5, 8.4, 6.6, 4.3, 2.2, + 1.0, 0.4, 0.1, 0.0, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, + 0.6, 0.6, 0.5, 0.4, 0.2, 0.1, 0.0, 0.0, 0.1, 0.3, + 0.6, 1.0, 1.6, 2.4, 3.2, 4.1, 5.1, 6.2, 7.4, 8.6, + 9.5, 9.2, 8.0, 6.2, 3.8, 1.7, 0.5, 0.1, 0.0, 0.0 + ], + "signal_quality": [ + 1.0, 0.99, 0.99, 0.98, 0.98, 0.98, 0.97, 0.97, 0.97, 0.96, + 0.96, 0.96, 0.96, 0.95, 0.95, 0.95, 0.95, 0.94, 0.94, 0.94, + 0.94, 0.93, 0.93, 0.93, 0.93, 0.93, 0.93, 0.92, 0.92, 0.92, + 0.92, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, + 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, + 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, + 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, + 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, + 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, + 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, + 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, + 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, + 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, + 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, + 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, + 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, + 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91, 0.91 + ], + "effective_time_frame": { + "time_interval": { + "start_time": "2025-07-04T14:00:00Z", + "end_time": "2025-07-04T14:00:00.200Z" + } + } + } +} diff --git a/test-data/ros4hc/full-sample-data/eog-full-sample-data.json b/test-data/ros4hc/full-sample-data/eog-full-sample-data.json new file mode 100644 index 00000000..d631093d --- /dev/null +++ b/test-data/ros4hc/full-sample-data/eog-full-sample-data.json @@ -0,0 +1,108 @@ +{ + "header": { + "uuid": "f47ac10b-58cc-4372-a567-0e02b2c3d479", + "schema_id": { + "name": "eog-data-series", + "version": "1.0.0" + }, + "source_creation_date_time": "2025-07-03T14:20:00Z", + "modality": "sensed", + "acquisition_rate": { + "value": 1000, + "unit": "Hz" + }, + "external_datasheets": [ + { + "datasheet_type": "hardware", + "datasheet_reference": "https://example.com/datasheets/eog-prox" + }, + { + "datasheet_type": "study", + "datasheet_reference": "https://example.com/protocols/eog-blink-detection" + } + ], + "device_identity": { + "device_manufacturer": "BioNeuroTech", + "device_name": "EOG-ProX", + "device_type": "Electrooculography", + "device_serial_number": "EOGX-8459392" + }, + "environmental_requirements": { + "battery_level": { + "value": 88, + "unit": "%" + }, + "minimal_operation_temperature": { + "value": 0, + "unit": "°C" + }, + "maximal_operation_temperature": { + "value": 45, + "unit": "°C" + }, + "maximal_relative_humidity": { + "value": 85, + "unit": "%" + }, + "minimal_atmospheric_pressure": { + "value": 0.8, + "unit": "atm" + }, + "maximal_atmospheric_pressure": { + "value": 1.2, + "unit": "atm" + } + }, + "measurement_specs": { + "measuring_unit": "uV", + "sampling_frequency_hz": 1000, + "resolution": 0.001, + "accuracy": 0.98, + "max_range": 100, + "min_range": -100 + }, + "eog_info": { + "sampling_frequency": { + "value": 1000, + "unit": "Hz" + }, + "window_size_samples": 500, + "quality_window_size_samples": 50, + "units": "uV", + "gain": 0.5, + "adc_resolution": 16, + "electrode_placement": [ + "Left Eye", + "Right Eye", + "Above Eye", + "Below Eye" + ], + "lead_type": "Bipolar Horizontal", + "signal_mode": "Surface", + "lightsource": "LED", + "gazefield_background_light_brightness": { + "value": 250, + "unit": "cd/m^2" + }, + "length_light_dark_phase": [2.5, 2.5] + } + }, + "body": { + "session_id": "EOG-Session-042", + "channel_size": 2, + "sample_size": 500, + "eog": [ + 0.03, 0.07, 0.11, 0.15, 0.13, 0.09, 0.02, -0.01, -0.04, -0.08, + -0.1, -0.05, 0.0, 0.05, 0.1, 0.12, 0.09, 0.06, 0.01, -0.02 + ], + "signal_quality": [ + 0.95, 0.96, 0.94, 0.93, 0.92, 0.91, 0.89, 0.88, 0.9, 0.92 + ], + "effective_time_frame": { + "time_interval": { + "start_time": "2025-07-03T14:20:00Z", + "end_time": "2025-07-03T14:20:05Z" + } + } + } +} diff --git a/test-data/ros4hc/full-sample-data/icg-full-sample-data.json b/test-data/ros4hc/full-sample-data/icg-full-sample-data.json new file mode 100644 index 00000000..708471b2 --- /dev/null +++ b/test-data/ros4hc/full-sample-data/icg-full-sample-data.json @@ -0,0 +1,101 @@ +{ + "header": { + "uuid": "3f2504e0-4f89-11d3-9a0c-0305e82c3301", + "schema_id": { + "name": "icg-data-series", + "version": "1.0.0" + }, + "source_creation_date_time": "2025-07-04T09:30:00Z", + "modality": "sensed", + "acquisition_rate": { + "value": 1000, + "unit": "Hz" + }, + "external_datasheets": [ + { + "datasheet_type": "hardware", + "datasheet_reference": "https://example.com/datasheets/icg-analyzer-x2" + }, + { + "datasheet_type": "software", + "datasheet_reference": "https://example.com/software/icg-v5.4.0" + } + ], + "device_identity": { + "device_manufacturer": "CardioWaveTech", + "device_name": "ICG-Analyzer-X2", + "device_type": "Impedance Cardiography", + "device_serial_number": "CWX2-4871201" + }, + "environmental_requirements": { + "battery_level": { + "value": 80, + "unit": "%" + }, + "minimal_operation_temperature": { + "value": 5, + "unit": "°C" + }, + "maximal_operation_temperature": { + "value": 40, + "unit": "°C" + }, + "maximal_relative_humidity": { + "value": 90, + "unit": "%" + }, + "minimal_atmospheric_pressure": { + "value": 0.85, + "unit": "atm" + }, + "maximal_atmospheric_pressure": { + "value": 1.15, + "unit": "atm" + } + }, + "measurement_specs": { + "measuring_unit": "Ohms", + "sampling_frequency_hz": 1000, + "resolution": 0.001, + "accuracy": 0.97, + "max_range": 10, + "min_range": -10 + }, + "icg_info": { + "sampling_frequency": { + "value": 1000, + "unit": "Hz" + }, + "window_size_samples": 600, + "quality_window_size_samples": 60, + "units": "Ohms", + "gain": 0.01, + "adc_resolution": 16, + "electrode_placement": [ + "Chest", + "Neck", + "Left Arm" + ], + "lead_type": "Four Electrode", + "technique": "Tetrapolar" + } + }, + "body": { + "session_id": "ICG-Session-005", + "sample_size": 600, + "icg": [ + 0.1, 0.12, 0.15, 0.18, 0.21, 0.24, 0.22, 0.2, 0.18, 0.15, + 0.12, 0.1, 0.08, 0.06, 0.05, 0.03, 0.02, 0.01, 0.0, -0.01, + -0.02, -0.03, -0.04, -0.05, -0.06, -0.05, -0.04, -0.02, 0.0, 0.02 + ], + "signal_quality": [ + 0.95, 0.94, 0.92, 0.90, 0.89, 0.87, 0.86, 0.88, 0.90, 0.91 + ], + "effective_time_frame": { + "time_interval": { + "start_time": "2025-07-04T09:30:00Z", + "end_time": "2025-07-04T09:30:05Z" + } + } + } +} diff --git a/test-data/ros4hc/full-sample-data/ppg-full-sample-data.json b/test-data/ros4hc/full-sample-data/ppg-full-sample-data.json new file mode 100644 index 00000000..66c18787 --- /dev/null +++ b/test-data/ros4hc/full-sample-data/ppg-full-sample-data.json @@ -0,0 +1,57 @@ +{ + "header": { + "uuid": "8c1a3d6e-0f3d-4b62-b2c3-8c7a39eae5d7", + "schema_id": { + "name": "ppg-data-series", + "version": "1.0.0" + }, + "source_creation_date_time": "2025-07-04T08:45:00Z", + "modality": "sensed", + "acquisition_rate": { + "value": 250, + "unit": "Hz" + }, + "device_identity": { + "device_manufacturer": "PulseTech", + "device_name": "PT-3000", + "device_type": "Photoplethysmography", + "device_serial_number": "PT3K-9928374" + }, + "measurement_specs": { + "measuring_unit": "Counts", + "sampling_frequency_hz": 250, + "resolution": 0.01, + "accuracy": 0.98 + }, + "ppg_info": { + "window_size_samples": 250, + "quality_window_size_samples": 25, + "units": "Counts", + "gain": 1.0, + "wavelengths_mm": 940, + "sensor_placement": "Finger", + "measuring_mode": "Transmissive Absorption" + } + }, + "body": { + "session_id": "PPG-Session-2025-07-04-A", + "sample_size": 250, + "wavelength_size": 1, + "ac_component": 0.42, + "dc_component": 1.87, + "ppg": [ + 1.90, 1.92, 1.94, 1.95, 1.96, 1.94, 1.91, 1.88, 1.85, 1.83, + 1.82, 1.84, 1.87, 1.89, 1.91, 1.93, 1.95, 1.96, 1.95, 1.94, + 1.93, 1.91, 1.88, 1.85, 1.82, 1.81, 1.83, 1.86, 1.89, 1.92 + ], + "signal_quality": [ + 0.98, 0.97, 0.96, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, 1.0 + ], + "effective_time_frame": { + "time_interval": { + "start_time": "2025-07-04T08:45:00Z", + "end_time": "2025-07-04T08:45:01Z" + } + } + } +} From 5fead3b5a81eff5a1bf312b15c42f6922ddff1cf Mon Sep 17 00:00:00 2001 From: Elisa Du <79795653+Alizzie@users.noreply.github.com> Date: Mon, 28 Jul 2025 12:37:18 +0200 Subject: [PATCH 02/15] refactored schemas --- schema/ros4hc/bcg-info-1.x.json | 86 ++----- schema/ros4hc/ecg-info-1.x.json | 69 +---- schema/ros4hc/eda-info-1-x.json | 67 +---- schema/ros4hc/eeg-info-1.x.json | 64 +---- schema/ros4hc/emg-info-1.x.json | 64 +---- schema/ros4hc/eog-info-1.x.json | 77 ++---- schema/ros4hc/icg-info-1.x.json | 65 +---- .../ros4hc/metadata/device-identity-1.x.json | 23 ++ schema/ros4hc/metadata/device-info-1.x.json | 47 ++++ .../measurement-specification-1.x.json | 31 +++ .../metadata/operating-environment-1.x.json | 59 +++++ .../metadata/ord-default-header-1.x.json | 77 ++++++ .../metadata/sensor-device-header-1.x.json | 24 ++ schema/ros4hc/min-max-unit-value-1.x.json | 36 +++ schema/ros4hc/pcg-info-1.x.json | 83 +++--- schema/ros4hc/sensor-device-header-1.x.json | 240 ------------------ 16 files changed, 422 insertions(+), 690 deletions(-) create mode 100644 schema/ros4hc/metadata/device-identity-1.x.json create mode 100644 schema/ros4hc/metadata/device-info-1.x.json create mode 100644 schema/ros4hc/metadata/measurement-specification-1.x.json create mode 100644 schema/ros4hc/metadata/operating-environment-1.x.json create mode 100644 schema/ros4hc/metadata/ord-default-header-1.x.json create mode 100644 schema/ros4hc/metadata/sensor-device-header-1.x.json create mode 100644 schema/ros4hc/min-max-unit-value-1.x.json delete mode 100644 schema/ros4hc/sensor-device-header-1.x.json diff --git a/schema/ros4hc/bcg-info-1.x.json b/schema/ros4hc/bcg-info-1.x.json index 533ac560..38b1792b 100644 --- a/schema/ros4hc/bcg-info-1.x.json +++ b/schema/ros4hc/bcg-info-1.x.json @@ -6,16 +6,17 @@ "description": "This schema represents a bcg data series, i.e., an array of measures that share the same header.", "definitions": { - "header": { - "$ref": "sensor-device-header-1.x.json" + "device-info": { + "$ref": "device-info-1.x.json" }, - - "bcg_body": { - "$ref": "bcg-1.x.json" + "default-header": { + "$ref": "ord-default-header-1.x.json" }, - "filter": { "$ref": "healthcare-filterbase-1.x.json" + }, + "bcg_body": { + "$ref": "bcg-1.x.json" } }, @@ -25,76 +26,22 @@ "description": "The header of the data point.", "type":"object", "allOf": [ - {"$ref": "#/definitions/header"}, - - + {"$ref": "#/definitions/default-header"}, + {"$ref": "#/definitions/device-info"}, {"$ref": "#/definitions/filter"}, { "type": "object", "properties": { - "bcg_info": { + "sensor_configuration": { "type": "object", "properties": { - "session_id": { - "type": "string" - }, - - "sampling_frequency": { - "allOf": [ - { - "$ref": "#/definitions/unit_value" - }, - { - "type": "object", - "properties": { - "unit": { - "enum": [ - "Hz" - ] - } - } - } - ] - }, - - "window_size_samples": { - "description": "Number of samples per BCG.msg", - "type": "integer" - }, - - "quality_window_size_samples": { - "description": "Number of samples per quality value", - "type": "integer" - }, - - "units": { - "type": "string", - "enum": ["Unknown", "mV", "uV", "Counts", "M/s2", "Newton"] - }, - - "gain": { - "type": "number", - "description": "Multiplicative factor (e.g., µV/count); set to 1.0 if signal is already scaled" - }, - - "adc_resolution": { - "description": "Bits (e.g. 12, 16)", - "type": "integer" - }, - - "number_of_sensors": { - "description": "Number of sensors used for measurement", - "type": "integer" - }, - - - "sensor_placements": { + "sensor_placement": { "description": "Sensor Placements", "type": "string", "enum": [ - "Chest", "Back", "Mattress", "Chair", "Feet", "Wrist", "Arm", "Desk", "Clothing", "Custom" + "Unknown", "Chest", "Back", "Mattress", "Chair", "Feet", "Wrist", "Arm", "Desk", "Clothing", "Custom" ] }, @@ -102,7 +49,7 @@ "description": "Axis along which BCG is measured", "type": "string", "enum": [ - "Dorso Ventral", "Longitudinal", "Medio Lateral", "Unkown" + "Dorso Ventral", "Longitudinal", "Medio Lateral", "Unknown" ] }, @@ -110,7 +57,7 @@ "description": "Type of Sensor used", "type": "string", "enum": [ - "Piezoelectric Film", "Forceplate", "Accelerometer", "Piezoelectric crystal", "Unkown" + "Piezoelectric Film", "Forceplate", "Accelerometer", "Piezoelectric crystal", "Unknown" ] }, @@ -121,7 +68,10 @@ "Starr", "Nickerson", "Dock", "Other", "Unknown" ] } - } + }, + "required": [ + "sensor_placement" + ] } } } diff --git a/schema/ros4hc/ecg-info-1.x.json b/schema/ros4hc/ecg-info-1.x.json index e9dd45a0..ee17c64d 100644 --- a/schema/ros4hc/ecg-info-1.x.json +++ b/schema/ros4hc/ecg-info-1.x.json @@ -6,20 +6,20 @@ "description": "This schema represents a ecg data series, i.e., an array of measures that share the same header.", "definitions": { - "header": { - "$ref": "sensor-device-header-1.x.json" + "device-info": { + "$ref": "device-info-1.x.json" }, - - "ecg_body": { - "$ref": "ecg-1.x.json" + "default-header": { + "$ref": "ord-default-header-1.x.json" + }, + "filter": { + "$ref": "healthcare-filterbase-1.x.json" }, - "lead_location_enum": { "$ref": "lead-location-1.x.json" }, - - "filter": { - "$ref": "healthcare-filterbase-1.x.json" + "ecg_body":{ + "$ref": "ecg-1.x.json" } }, @@ -29,60 +29,17 @@ "description": "The header of the data point.", "type":"object", "allOf": [ - {"$ref": "#/definitions/header"}, - + {"$ref": "#/definitions/default-header"}, + {"$ref": "#/definitions/device-info"}, {"$ref": "#/definitions/filter"}, { "type": "object", "properties": { - "ecg_info": { + "electrode_configuration": { "type": "object", "properties": { - "sampling_frequency": { - "allOf": [ - { - "$ref": "#/definitions/unit_value" - }, - { - "type": "object", - "properties": { - "unit": { - "enum": [ - "Hz" - ] - } - } - } - ] - }, - - "window_size_samples": { - "description": "Number of samples per ECG.msg", - "type": "integer" - }, - - "quality_window_size_samples": { - "description": "Number of samples per quality value", - "type": "integer" - }, - - "units": { - "type": "string", - "enum": ["Unknown", "mV", "uV", "Counts"] - }, - - "gain": { - "type": "number", - "description": "Multiplicative factor (e.g., µV/count); set to 1.0 if signal is already scaled" - }, - - "adc_resolution": { - "description": "Bits (e.g. 12, 16)", - "type": "integer" - }, - "electrode_placement": { "description": "Support multiple electrode placements", "type": "array", @@ -100,7 +57,7 @@ }, "required": [ - "sampling_frequency", "units" + "electrode_placement" ] } } diff --git a/schema/ros4hc/eda-info-1-x.json b/schema/ros4hc/eda-info-1-x.json index 46988307..0d9e4ff1 100644 --- a/schema/ros4hc/eda-info-1-x.json +++ b/schema/ros4hc/eda-info-1-x.json @@ -6,16 +6,17 @@ "description": "This schema represents a eda data series, i.e., an array of measures that share the same header.", "definitions": { - "header": { - "$ref": "sensor-device-header-1.x.json" + "device-info": { + "$ref": "device-info-1.x.json" }, - - "eda_body": { - "$ref": "eda-1.x.json" + "default-header": { + "$ref": "ord-default-header-1.x.json" }, - "filter": { "$ref": "healthcare-filterbase-1.x.json" + }, + "eda_body": { + "$ref": "eda-1.x.json" } }, @@ -25,60 +26,16 @@ "description": "The header of the data point.", "type":"object", "allOf": [ - {"$ref": "#/definitions/header"}, - + {"$ref": "#/definitions/default-header"}, + {"$ref": "#/definitions/device-info"}, {"$ref": "#/definitions/filter"}, { "type": "object", "properties": { - "eda_info": { + "electrode_configuration": { "type": "object", "properties": { - - "sampling_frequency": { - "allOf": [ - { - "$ref": "#/definitions/unit_value" - }, - { - "type": "object", - "properties": { - "unit": { - "enum": [ - "Hz" - ] - } - } - } - ] - }, - - "window_size_samples": { - "description": "Number of samples per EDA.msg", - "type": "integer" - }, - - "quality_window_size_samples": { - "description": "Number of samples per quality value", - "type": "integer" - }, - - "units": { - "type": "string", - "enum": ["Unknown", "Micro Siemens", "Counts"] - }, - - "gain": { - "type": "number", - "description": "Multiplicative factor (e.g., µV/count); set to 1.0 if signal is already scaled" - }, - - "adc_resolution": { - "description": "Bits (e.g. 12, 16)", - "type": "integer" - }, - "electrode_placement": { "description": "Support multiple electrode placements", "type": "array", @@ -90,7 +47,7 @@ } }, - "signal_mode": { + "electrode_type": { "type": "string", "enum": ["Unknown", "Surface", "Intracutaneous", "Custom"] }, @@ -107,7 +64,7 @@ }, "required": [ - "sampling_frequency", "units" + "electrode_placement" ] } } diff --git a/schema/ros4hc/eeg-info-1.x.json b/schema/ros4hc/eeg-info-1.x.json index fc588309..f637e971 100644 --- a/schema/ros4hc/eeg-info-1.x.json +++ b/schema/ros4hc/eeg-info-1.x.json @@ -6,16 +6,17 @@ "description": "This schema represents a eeg data series, i.e., an array of measures that share the same header.", "definitions": { - "header": { - "$ref": "sensor-device-header-1.x.json" + "device-info": { + "$ref": "device-info-1.x.json" }, - - "eeg_body": { - "$ref": "eeg-1.x.json" + "default-header": { + "$ref": "ord-default-header-1.x.json" }, - "filter": { "$ref": "healthcare-filterbase-1.x.json" + }, + "eeg_body": { + "$ref": "eeg-1.x.json" } }, @@ -25,60 +26,17 @@ "description": "The header of the data point.", "type":"object", "allOf": [ - {"$ref": "#/definitions/header"}, - + {"$ref": "#/definitions/default-header"}, + {"$ref": "#/definitions/device-info"}, {"$ref": "#/definitions/filter"}, { "type": "object", "properties": { - "eeg_info": { + "electrode_configuration": { "type": "object", "properties": { - "sampling_frequency": { - "allOf": [ - { - "$ref": "#/definitions/unit_value" - }, - { - "type": "object", - "properties": { - "unit": { - "enum": [ - "Hz" - ] - } - } - } - ] - }, - - "window_size_samples": { - "description": "Number of samples per EEG.msg", - "type": "integer" - }, - - "quality_window_size_samples": { - "description": "Number of samples per quality value", - "type": "integer" - }, - - "units": { - "type": "string", - "enum": ["Unknown", "uV", "mV", "Counts"] - }, - - "gain": { - "type": "number", - "description": "Multiplicative factor (e.g., µV/count); set to 1.0 if signal is already scaled" - }, - - "adc_resolution": { - "description": "Bits (e.g. 12, 16)", - "type": "integer" - }, - "electrode_placement": { "description": "Support multiple electrode placements", "type": "array", @@ -107,7 +65,7 @@ }, "required": [ - "sampling_frequency", "units" + "electrode_placement" ] } } diff --git a/schema/ros4hc/emg-info-1.x.json b/schema/ros4hc/emg-info-1.x.json index 770d13dc..9ac8e055 100644 --- a/schema/ros4hc/emg-info-1.x.json +++ b/schema/ros4hc/emg-info-1.x.json @@ -6,16 +6,17 @@ "description": "This schema represents a emg data series, i.e., an array of measures that share the same header.", "definitions": { - "header": { - "$ref": "sensor-device-header-1.x.json" + "device-info": { + "$ref": "device-info-1.x.json" }, - - "emg_body": { - "$ref": "emg-1.x.json" + "default-header": { + "$ref": "ord-default-header-1.x.json" }, - "filter": { "$ref": "healthcare-filterbase-1.x.json" + }, + "emg_body": { + "$ref": "emg-1.x.json" } }, @@ -25,60 +26,17 @@ "description": "The header of the data point.", "type":"object", "allOf": [ - {"$ref": "#/definitions/header"}, - + {"$ref": "#/definitions/default-header"}, + {"$ref": "#/definitions/device-info"}, {"$ref": "#/definitions/filter"}, { "type": "object", "properties": { - "emg_info": { + "electrode_configuration": { "type": "object", "properties": { - "sampling_frequency": { - "allOf": [ - { - "$ref": "#/definitions/unit_value" - }, - { - "type": "object", - "properties": { - "unit": { - "enum": [ - "Hz" - ] - } - } - } - ] - }, - - "window_size_samples": { - "description": "Number of samples per EMG.msg", - "type": "integer" - }, - - "quality_window_size_samples": { - "description": "Number of samples per quality value", - "type": "integer" - }, - - "units": { - "type": "string", - "enum": ["Unknown", "uV", "mV", "Counts"] - }, - - "gain": { - "type": "number", - "description": "Multiplicative factor (e.g., µV/count); set to 1.0 if signal is already scaled" - }, - - "adc_resolution": { - "description": "Bits (e.g. 12, 16)", - "type": "integer" - }, - "electrode_placement": { "description": "Support multiple electrode placements", "type": "array", @@ -105,7 +63,7 @@ }, "required": [ - "sampling_frequency", "units" + "electrode_placement" ] } } diff --git a/schema/ros4hc/eog-info-1.x.json b/schema/ros4hc/eog-info-1.x.json index f1046910..f7924a43 100644 --- a/schema/ros4hc/eog-info-1.x.json +++ b/schema/ros4hc/eog-info-1.x.json @@ -6,18 +6,18 @@ "description": "This schema represents a eog data series, i.e., an array of measures that share the same header.", "definitions": { - "header": { - "$ref": "sensor-device-header-1.x.json" + "device-info": { + "$ref": "device-info-1.x.json" }, - - "eog_body": { - "$ref": "eog-1.x.json" + "default-header": { + "$ref": "ord-default-header-1.x.json" }, - "filter": { "$ref": "healthcare-filterbase-1.x.json" }, - + "eog_body": { + "$ref": "eog-1.x.json" + }, "unit_value": { "$ref": "unit-value-1.0.json" } @@ -29,60 +29,17 @@ "description": "The header of the data point.", "type":"object", "allOf": [ - {"$ref": "#/definitions/header"}, - + {"$ref": "#/definitions/default-header"}, + {"$ref": "#/definitions/device-info"}, {"$ref": "#/definitions/filter"}, { "type": "object", "properties": { - "eog_info": { + "electrode_configuration": { "type": "object", "properties": { - "sampling_frequency": { - "allOf": [ - { - "$ref": "#/definitions/unit_value" - }, - { - "type": "object", - "properties": { - "unit": { - "enum": [ - "Hz" - ] - } - } - } - ] - }, - - "window_size_samples": { - "description": "Number of samples per EOG.msg", - "type": "integer" - }, - - "quality_window_size_samples": { - "description": "Number of samples per quality value", - "type": "integer" - }, - - "units": { - "type": "string", - "enum": ["Unknown", "uV", "mV", "Counts"] - }, - - "gain": { - "type": "number", - "description": "Multiplicative factor (e.g., µV/count); set to 1.0 if signal is already scaled" - }, - - "adc_resolution": { - "description": "Bits (e.g. 12, 16)", - "type": "integer" - }, - "electrode_placement": { "description": "Support multiple electrode placements", "type": "array", @@ -100,8 +57,15 @@ "signal_mode": { "type": "string", "enum": ["Unknown", "Surface", "Bipolar", "Unipolar", "Corneal Retinal", "Intracular", "Derived", "Custom"] - }, - + } + }, + "required": [ + "electrode_placement" + ] + }, + "lightning_condition":{ + "type": "object", + "properties": { "lightsource": { "type": "string", "enum": ["Unknown", "Tungsten", "Halogen", "LED", "Fluorescent", "Sunlight", "Custom"] @@ -132,9 +96,8 @@ } } }, - "required": [ - "sampling_frequency", "units" + "lightsource" ] } } diff --git a/schema/ros4hc/icg-info-1.x.json b/schema/ros4hc/icg-info-1.x.json index bfd77fc4..8df1c9da 100644 --- a/schema/ros4hc/icg-info-1.x.json +++ b/schema/ros4hc/icg-info-1.x.json @@ -6,18 +6,18 @@ "description": "This schema represents a icg data series, i.e., an array of measures that share the same header.", "definitions": { - "header": { - "$ref": "sensor-device-header-1.x.json" + "device-info": { + "$ref": "device-info-1.x.json" }, - - "icg_body": { - "$ref": "icg-1.x.json" + "default-header": { + "$ref": "ord-default-header-1.x.json" }, - "filter": { "$ref": "healthcare-filterbase-1.x.json" }, - + "icg_body": { + "$ref": "icg-1.x.json" + }, "unit_value": { "$ref": "unit-value-1.0.json" } @@ -29,60 +29,17 @@ "description": "The header of the data point.", "type":"object", "allOf": [ - {"$ref": "#/definitions/header"}, - + {"$ref": "#/definitions/default-header"}, + {"$ref": "#/definitions/device-info"}, {"$ref": "#/definitions/filter"}, { "type": "object", "properties": { - "icg_info": { + "electrode_configuration": { "type": "object", "properties": { - "sampling_frequency": { - "allOf": [ - { - "$ref": "#/definitions/unit_value" - }, - { - "type": "object", - "properties": { - "unit": { - "enum": [ - "Hz" - ] - } - } - } - ] - }, - - "window_size_samples": { - "description": "Number of samples per ICG.msg", - "type": "integer" - }, - - "quality_window_size_samples": { - "description": "Number of samples per quality value", - "type": "integer" - }, - - "units": { - "type": "string", - "enum": ["Unknown", "Ohms", "MOhms", "Counts"] - }, - - "gain": { - "type": "number", - "description": "Multiplicative factor (e.g., µV/count); set to 1.0 if signal is already scaled" - }, - - "adc_resolution": { - "description": "Bits (e.g. 12, 16)", - "type": "integer" - }, - "electrode_placement": { "description": "Support multiple electrode placements", "type": "array", @@ -104,7 +61,7 @@ }, "required": [ - "sampling_frequency", "units" + "electrode_placement" ] } } diff --git a/schema/ros4hc/metadata/device-identity-1.x.json b/schema/ros4hc/metadata/device-identity-1.x.json new file mode 100644 index 00000000..8aa86492 --- /dev/null +++ b/schema/ros4hc/metadata/device-identity-1.x.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://w3id.org/ieee/ros4hc-schema/device_identity.json", + "title": "Device Identity Metadata", + "description": "This schema represents the metadata of an device", + "type": "object", + "properties": { + "device_manufacturer": { + "type": "string" + }, + "device_name": { + "type": "string" + }, + "device_type": { + "type": "string" + }, + "device_serial_number": { + "type": "string" + } + }, + "required": [ + ] +} diff --git a/schema/ros4hc/metadata/device-info-1.x.json b/schema/ros4hc/metadata/device-info-1.x.json new file mode 100644 index 00000000..bbc61ac9 --- /dev/null +++ b/schema/ros4hc/metadata/device-info-1.x.json @@ -0,0 +1,47 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://w3id.org/ieee/ros4hc-schema/operating_environment.json", + "title": "Operating environment of an device Metadata", + "description": "This schema represents the metadata of an device and its operating environment", + "type": "object", + "definitions": { + "device_identity": { + "$ref": "device_identity-1.x.json" + }, + "operating_environment": { + "$ref": "operating_environment-1.x.json" + }, + "measurement_specification": { + "$ref": "measurement_specification-1.x.json" + } + }, + "properties": { + "device_identity": { + "$ref": "#/definitions/device_identity" + }, + "operating_environment":{ + "$ref": "#/definitions/operating_environment" + }, + "measurement_specification": { + "$ref": "#/definitions/measurement_specification" + }, + "session_id": { + "type": "string" + }, + "data_size": { + "type": "object", + "properties": { + "window_size_samples": { + "type": "number" + }, + "quality_window_size_samples": { + "type": "number" + } + } + } + }, + "required": [ + "session_id", + "data_size" + ] +} diff --git a/schema/ros4hc/metadata/measurement-specification-1.x.json b/schema/ros4hc/metadata/measurement-specification-1.x.json new file mode 100644 index 00000000..dbd7556a --- /dev/null +++ b/schema/ros4hc/metadata/measurement-specification-1.x.json @@ -0,0 +1,31 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://w3id.org/ieee/ros4hc-schema/measurement_specification.json", + "title": "Metadata of a specific measurement from an device", + "description": "This schema represents the metadata of an device and its specific measurement", + "type": "object", + "definitions": { + "min_max_value": { + "$ref": "min-max-unit-value-1.x.json" + } + }, + "properties": { + "accuracy": { + "type": "number" + }, + "measuring_value_range":{ + "$ref": "#/definitions/min_max_value" + }, + "gain": { + "type": "number" + }, + "adc_resolution": { + "type": "integer" + }, + "resolution": { + "type": "number" + } + }, + "required": [ + ] +} diff --git a/schema/ros4hc/metadata/operating-environment-1.x.json b/schema/ros4hc/metadata/operating-environment-1.x.json new file mode 100644 index 00000000..e3b890db --- /dev/null +++ b/schema/ros4hc/metadata/operating-environment-1.x.json @@ -0,0 +1,59 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://w3id.org/ieee/ros4hc-schema/operating_environment.json", + "title": "Operating environment of an device Metadata", + "description": "This schema represents the metadata of an device and its operating environment", + "type": "object", + "definitions": { + "unit_value": { + "$ref": "unit-value-1.x.json" + }, + "min_max_value": { + "$ref": "min-max-unit-value-1.x.json" + } + }, + "properties": { + "battery_level": { + "allOf": [ + { + "$ref": "#/definitions/unit_value" + }, + { + "type": "object", + "properties": { + "unit": { + "enum": [ + "%" + ] + } + } + } + ] + }, + "operation_temperature": { + "$ref": "#/definitions/min_max_value" + }, + "minimal_atmospheric_pressure": { + "allOf": [ + { + "$ref": "#/definitions/unit_value" + }, + { + "type": "object", + "properties": { + "unit": { + "enum": [ + "atm" + ] + } + } + } + ] + }, + "atmospheric_pressure": { + "$ref": "#/definitions/min_max_value" + } + }, + "required": [ + ] +} diff --git a/schema/ros4hc/metadata/ord-default-header-1.x.json b/schema/ros4hc/metadata/ord-default-header-1.x.json new file mode 100644 index 00000000..bb3f03a5 --- /dev/null +++ b/schema/ros4hc/metadata/ord-default-header-1.x.json @@ -0,0 +1,77 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://w3id.org/ieee/ieee-1752-schema/header.json", + "title": "Header", + "description": "This schema represents the header of a data point or data series.", + "type": "object", + "definitions": { + "date_time": { + "$ref": "date-time-1.0.json" + }, + "schema_id": { + "$ref": "schema-id-1.0.json" + }, + "frequency_unit_value": { + "$ref": "frequency-unit-value-1.0.json" + } + }, + "properties": { + "uuid": { + "description": "The identifier of this data point: a globally unique value, generated using RFC 4122 approach.", + "references": [ + { + "description": "A Universally Unique IDentifier (UUID) URN Namespace", + "url": "https://tools.ietf.org/html/rfc4122" + } + ], + "type": "string", + "format": "uuid" + }, + "schema_id": { + "description": "The schema identifier of the body of the data point or data series.", + "$ref": "#/definitions/schema_id" + }, + "source_creation_date_time": { + "description": "The date time (timestamp) when this datapoint or data series was created at the original source. If the datapoint or data series is aggregated later, the date does not change. If the datapoint or data series is recalculated later (e.g., using a different algorithm), a new datapoint or data series is created with a different id and creation date.", + "$ref": "#/definitions/date_time" + }, + "modality": { + "description": "The modality whereby the measure is obtained, e.g., sensed or self-reported", + "type": "string", + "enum": [ + "sensed", + "self-reported" + ] + }, + "acquisition_rate": { + "description": "The rate at which measures are acquired.", + "$ref": "#/definitions/frequency_unit_value" + }, + "external_datasheets": { + "description": "Reference(s) to external documentation regarding the component(s) relevant to describe the collection, computation, use, etc. of this datapoint or data series, e.g., software, algorithm, study protocol, etc.", + "type": "array", + "items": { + "type": "object", + "properties": { + "datasheet_type": { + "description": "The type of component described or documented by the referenced datasheet, e.g., software, hardware, study.", + "type": "string" + }, + "datasheet_reference": { + "description": "International Resource Identifier (IRI) of applicable datasheet(s). The expectation is that the IRI will convey resolvable location and access information for the resource identified resource.", + "type": "string", + "format": "iri" + } + }, + "required": [ + "datasheet_reference" + ] + } + } + }, + "required": [ + "uuid", + "schema_id", + "source_creation_date_time" + ] +} diff --git a/schema/ros4hc/metadata/sensor-device-header-1.x.json b/schema/ros4hc/metadata/sensor-device-header-1.x.json new file mode 100644 index 00000000..dcbbfd56 --- /dev/null +++ b/schema/ros4hc/metadata/sensor-device-header-1.x.json @@ -0,0 +1,24 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "description": "Sensor device header with metadata about the device and environmental requirements.", + "type": "object", + "title": "Sensor Device Metadata", + + "definitions": { + "device-info": { + "$ref": "device-info-1.x.json" + }, + "default-header": { + "$ref": "ord-default-header-1.x.json" + } + }, + + "allOf": [ + {"$ref": "#/definitions/default-header"}, + {"$ref": "#/definitions/device-info"} + ], + + "required": [ + + ] +} diff --git a/schema/ros4hc/min-max-unit-value-1.x.json b/schema/ros4hc/min-max-unit-value-1.x.json new file mode 100644 index 00000000..ebed72bf --- /dev/null +++ b/schema/ros4hc/min-max-unit-value-1.x.json @@ -0,0 +1,36 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://w3id.org/ieee/ieee-1752-schema/min-max-unit-value.json", + "title": "The maximum and minimum value of an specific unit", + "description": "This schema represents the minimum and the maximum value for a given unit.", + "type": "object", + "properties": { + "min_value": { + "description": "The minimum value.", + "type": "number" + }, + "max_value": { + "description": "The maximum value.", + "type": "number" + }, + "unit": { + "description": "The unit of measure of the element. Allowed values are drawn from the Common synonyms (non-UCUM) column of [subset of] UCUM, SI and English units. ", + "references": [ + { + "description": "The Common synonyms (non-UCUM) column of [subset of] UCUM.", + "url": "http://download.hl7.de/documents/ucum/ucumdata.html" + }, + { + "description": "The Unified Code for Units of Measure (UCUM).", + "url": "http://unitsofmeasure.org/ucum.html" + } + ], + "type": "string" + } + }, + "required": [ + "min_value", + "max_value", + "unit" + ] +} diff --git a/schema/ros4hc/pcg-info-1.x.json b/schema/ros4hc/pcg-info-1.x.json index cfc0f1ad..a2655ec9 100644 --- a/schema/ros4hc/pcg-info-1.x.json +++ b/schema/ros4hc/pcg-info-1.x.json @@ -6,18 +6,18 @@ "description": "This schema represents a ppg data series, i.e., an array of measures that share the same header.", "definitions": { - "header": { - "$ref": "sensor-device-header-1.x.json" + "device-info": { + "$ref": "device-info-1.x.json" }, - - "ppg_body": { - "$ref": "ppg-1.x.json" + "default-header": { + "$ref": "ord-default-header-1.x.json" }, - "filter": { "$ref": "healthcare-filterbase-1.x.json" }, - + "ppg_body": { + "$ref": "ppg-1.x.json" + }, "unit_value": { "$ref": "unit-value-1.0.json" } @@ -29,60 +29,17 @@ "description": "The header of the data point.", "type":"object", "allOf": [ - {"$ref": "#/definitions/header"}, - + {"$ref": "#/definitions/default-header"}, + {"$ref": "#/definitions/device-info"}, {"$ref": "#/definitions/filter"}, { "type": "object", "properties": { - "ppg_info": { + "sensor_configuration": { "type": "object", "properties": { - "sampling_frequency": { - "allOf": [ - { - "$ref": "#/definitions/unit_value" - }, - { - "type": "object", - "properties": { - "unit": { - "enum": [ - "Hz" - ] - } - } - } - ] - }, - - "window_size_samples": { - "description": "Number of samples per ICG.msg", - "type": "integer" - }, - - "quality_window_size_samples": { - "description": "Number of samples per quality value", - "type": "integer" - }, - - "units": { - "type": "string", - "enum": ["Unknown", "mV", "uV", "RLU", "Counts"] - }, - - "gain": { - "type": "number", - "description": "Multiplicative factor (e.g., µV/count); set to 1.0 if signal is already scaled" - }, - - "wavelengths_mm": { - "description": "One entry per PPG channel; may be [660, 880, 940]", - "type": "integer" - }, - "sensor_placement": { "type": "string", "enum": ["Unknown", "Finger", "Wrist", "Earlobe", "Forehead", "Toe", "Arm", "Chest", "Ankle", "Nose", "Palm", "Sole", "Custom"] @@ -95,7 +52,25 @@ }, "required": [ - "sampling_frequency", "units" + "sensor_placement" + ] + }, + + "signal_waveform_specifications":{ + "type": "object", + "properties": { + "wavelengths_mm": { + "description": "Nanometer value for each channel, may be [660, 880, 940]", + "type": "integer" + }, + "wavelengths_labels": { + "description": "Wavelength Label for each channel (optional)", + "type": "string", + "enum": ["Unknown", "Green", "Red", "IR", "Blue", "Yellow", "Custom"] + } + }, + "required": [ + "wavelengths_mm" ] } } diff --git a/schema/ros4hc/sensor-device-header-1.x.json b/schema/ros4hc/sensor-device-header-1.x.json deleted file mode 100644 index 4f5a36e1..00000000 --- a/schema/ros4hc/sensor-device-header-1.x.json +++ /dev/null @@ -1,240 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "description": "Senso device header with metadata about the device and environmental requirements.", - "type": "object", - "title": "Sensor Device Metadata", - - "definitions": { - "date_time": { - "$ref": "date-time-1.0.json" - }, - "schema_id": { - "$ref": "schema-id-1.0.json" - }, - "frequency_unit_value": { - "$ref": "frequency-unit-value-1.0.json" - }, - "unit_value": { - "$ref": "unit-value-1.0.json" - } - }, - - "properties": { - "uuid": { - "description": "The identifier of this data point: a globally unique value, generated using RFC 4122 approach.", - "references": [ - { - "description": "A Universally Unique IDentifier (UUID) URN Namespace", - "url": "https://tools.ietf.org/html/rfc4122" - } - ], - "type": "string", - "format": "uuid" - }, - "schema_id": { - "description": "The schema identifier of the body of the data point or data series.", - "$ref": "#/definitions/schema_id" - }, - "source_creation_date_time": { - "description": "The date time (timestamp) when this datapoint or data series was created at the original source. If the datapoint or data series is aggregated later, the date does not change. If the datapoint or data series is recalculated later (e.g., using a different algorithm), a new datapoint or data series is created with a different id and creation date.", - "$ref": "#/definitions/date_time" - }, - - "modality": { - "description": "The modality whereby the measure is obtained, e.g., sensed or self-reported", - "type": "string", - "enum": [ - "sensed", - "self-reported" - ] - }, - - "acquisition_rate": { - "description": "The rate at which measures are acquired.", - "$ref": "#/definitions/frequency_unit_value" - }, - - "external_datasheets": { - "description": "Reference(s) to external documentation regarding the component(s) relevant to describe the collection, computation, use, etc. of this datapoint or data series, e.g., software, algorithm, study protocol, etc.", - "type": "array", - "items": { - "type": "object", - "properties": { - "datasheet_type": { - "description": "The type of component described or documented by the referenced datasheet, e.g., software, hardware, study.", - "type": "string" - }, - "datasheet_reference": { - "description": "International Resource Identifier (IRI) of applicable datasheet(s). The expectation is that the IRI will convey resolvable location and access information for the resource identified resource.", - "type": "string", - "format": "iri" - } - }, - "required": [ - "datasheet_reference" - ] - } - }, - - "device_identity": { - "type": "object", - "properties": { - "device_manufacturer": { - "type": "string" - }, - - "device_name": { - "type": "string" - }, - - "device_type": { - "type": "string" - }, - "device_serial_number": { - "type": "string" - } - } - }, - - "environmental_requirements": { - "type": "object", - "properties": { - "battery_level": { - "allOf": [ - { - "$ref": "#/definitions/unit_value" - }, - { - "type": "object", - "properties": { - "unit": { - "enum": [ - "%" - ] - } - } - } - ] - }, - "minimal_operation_temperature": { - "allOf": [ - { - "$ref": "#/definitions/unit_value" - }, - { - "type": "object", - "properties": { - "unit": { - "enum": [ - "°C" - ] - } - } - } - ] - }, - "maximal_operation_temperature": { - "allOf": [ - { - "$ref": "#/definitions/unit_value" - }, - { - "type": "object", - "properties": { - "unit": { - "enum": [ - "°C" - ] - } - } - } - ] - }, - "maximal_relative_humidity": { - "allOf": [ - { - "$ref": "#/definitions/unit_value" - }, - { - "type": "object", - "properties": { - "unit": { - "enum": [ - "%" - ] - } - } - } - ] - }, - "minimal_atmospheric_pressure": { - "allOf": [ - { - "$ref": "#/definitions/unit_value" - }, - { - "type": "object", - "properties": { - "unit": { - "enum": [ - "atm" - ] - } - } - } - ] - }, - "maximal_atmospheric_pressure": { - "allOf": [ - { - "$ref": "#/definitions/unit_value" - }, - { - "type": "object", - "properties": { - "unit": { - "enum": [ - "atm" - ] - } - } - } - ] - } - } - }, - - "measurement_specs": { - "type": "object", - "properties": { - "measuring_unit": { - "type": "string" - }, - "sampling_frequency_hz": { - "type": "integer" - }, - "resolution": { - "type": "number" - }, - "accuracy": { - "type": "number", - "minimum": 0, - "maximum": 1 - }, - "max_range": { - "type": "number" - }, - "min_range": { - "type": "number" - } - } - } - }, - - "required": [ - "uuid", - "schema_id", - "source_creation_date_time" - - ] -} From f52fa39e6861c74f71f323e9f61c0f1ee178b4cc Mon Sep 17 00:00:00 2001 From: Elisa Du <79795653+Alizzie@users.noreply.github.com> Date: Sat, 2 Aug 2025 16:15:03 +0200 Subject: [PATCH 03/15] loose up effective time frame --- .../configuration/JacksonConfiguration.kt | 38 +++++++++++++ .../schema/domain/SchemaEnumValue.kt | 22 +++++++ .../org/openmhealth/schema/domain/SchemaId.kt | 49 ++++++++++++++++ .../openmhealth/schema/domain/SchemaName.kt | 33 +++++++++++ .../schema/domain/SchemaNamespace.kt | 36 ++++++++++++ .../schema/domain/SchemaSupport.kt | 17 ++++++ .../schema/domain/SchemaVersion.kt | 55 ++++++++++++++++++ .../schema/domain/TypedUnitValue.kt | 11 ++++ .../org/openmhealth/schema/domain/Unit.kt | 10 ++++ .../schema/domain/ieee/DateTime.kt | 12 ++++ .../domain/ieee/DescriptiveStatistic.kt | 45 +++++++++++++++ .../schema/domain/ieee/DurationUnit.kt | 29 ++++++++++ .../schema/domain/ieee/TimeFrame.kt | 30 ++++++++++ .../schema/domain/ieee/TimeInterval.kt | 40 +++++++++++++ .../schema/domain/ieee/UnitValue.kt | 30 ++++++++++ .../openmhealth/schema/domain/omh/AreaUnit.kt | 24 ++++++++ .../schema/domain/omh/AreaUnitValue.kt | 24 ++++++++ .../schema/domain/omh/HeartRate.kt | 26 +++++++++ .../schema/domain/omh/HeartRateUnit.kt | 22 +++++++ .../TemporalRelationshipToPhysicalActivity.kt | 31 ++++++++++ .../domain/omh/TemporalRelationshipToSleep.kt | 27 +++++++++ .../schema/domain/omh/UnitValue.kt | 30 ++++++++++ .../schema/domain/ieee/TimeFrameTests.kt | 37 ++++++++++++ .../schema/domain/ieee/TimeIntervalTests.kt | 48 ++++++++++++++++ .../schema/domain/omh/AreaUnitValueTests.kt | 27 +++++++++ .../schema/domain/omh/HeartRateTests.kt | 44 ++++++++++++++ .../schema/domain/omh/MappingTests.kt | 26 +++++++++ .../schema/support/DataFileSource.kt | 57 +++++++++++++++++++ schema/ros4hc/Notes.txt | 9 +-- schema/ros4hc/bcg-1.x.json | 13 +---- schema/ros4hc/ecg-1.x.json | 10 +--- schema/ros4hc/eda-1.x.json | 11 +--- schema/ros4hc/eeg-1.x.json | 10 +--- schema/ros4hc/emg-1.x.json | 10 +--- schema/ros4hc/eog-1.x.json | 10 +--- schema/ros4hc/eog-info-1.x.json | 4 +- schema/ros4hc/icg-1.x.json | 11 +--- .../ros4hc/metadata/device-identity-1.x.json | 1 + schema/ros4hc/metadata/device-info-1.x.json | 3 +- .../metadata/operating-environment-1.x.json | 20 ++++++- schema/ros4hc/pcg-1.x.json | 11 +--- schema/ros4hc/pcg-info-1.x.json | 7 ++- 42 files changed, 923 insertions(+), 87 deletions(-) create mode 100644 kotlin-schema-sdk/bin/main/org/openmhealth/schema/configuration/JacksonConfiguration.kt create mode 100644 kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/SchemaEnumValue.kt create mode 100644 kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/SchemaId.kt create mode 100644 kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/SchemaName.kt create mode 100644 kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/SchemaNamespace.kt create mode 100644 kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/SchemaSupport.kt create mode 100644 kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/SchemaVersion.kt create mode 100644 kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/TypedUnitValue.kt create mode 100644 kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/Unit.kt create mode 100644 kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/ieee/DateTime.kt create mode 100644 kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/ieee/DescriptiveStatistic.kt create mode 100644 kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/ieee/DurationUnit.kt create mode 100644 kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/ieee/TimeFrame.kt create mode 100644 kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/ieee/TimeInterval.kt create mode 100644 kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/ieee/UnitValue.kt create mode 100644 kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/omh/AreaUnit.kt create mode 100644 kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/omh/AreaUnitValue.kt create mode 100644 kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/omh/HeartRate.kt create mode 100644 kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/omh/HeartRateUnit.kt create mode 100644 kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/omh/TemporalRelationshipToPhysicalActivity.kt create mode 100644 kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/omh/TemporalRelationshipToSleep.kt create mode 100644 kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/omh/UnitValue.kt create mode 100644 kotlin-schema-sdk/bin/test/org/openmhealth/schema/domain/ieee/TimeFrameTests.kt create mode 100644 kotlin-schema-sdk/bin/test/org/openmhealth/schema/domain/ieee/TimeIntervalTests.kt create mode 100644 kotlin-schema-sdk/bin/test/org/openmhealth/schema/domain/omh/AreaUnitValueTests.kt create mode 100644 kotlin-schema-sdk/bin/test/org/openmhealth/schema/domain/omh/HeartRateTests.kt create mode 100644 kotlin-schema-sdk/bin/test/org/openmhealth/schema/domain/omh/MappingTests.kt create mode 100644 kotlin-schema-sdk/bin/test/org/openmhealth/schema/support/DataFileSource.kt diff --git a/kotlin-schema-sdk/bin/main/org/openmhealth/schema/configuration/JacksonConfiguration.kt b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/configuration/JacksonConfiguration.kt new file mode 100644 index 00000000..78edd4e3 --- /dev/null +++ b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/configuration/JacksonConfiguration.kt @@ -0,0 +1,38 @@ +package org.openmhealth.schema.configuration + +import com.fasterxml.jackson.annotation.JsonInclude.Include +import com.fasterxml.jackson.databind.DeserializationFeature +import com.fasterxml.jackson.databind.ObjectMapper +import com.fasterxml.jackson.databind.PropertyNamingStrategies +import com.fasterxml.jackson.databind.SerializationFeature +import com.fasterxml.jackson.databind.node.JsonNodeFactory +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule +import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper + +object JacksonConfiguration { + + val objectMapper: ObjectMapper by lazy { + val objectMapper = jacksonObjectMapper() + + // use snake case for names + objectMapper.propertyNamingStrategy = PropertyNamingStrategies.SNAKE_CASE + + // serialize dates, date times, and times as strings, not numbers + objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) + + // don't serialize nulls + objectMapper.setSerializationInclusion(Include.NON_NULL) + + // deserialize JSON numbers to Java BigDecimals + objectMapper.nodeFactory = JsonNodeFactory.withExactBigDecimals(true); + objectMapper.enable(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS) + + // preserve time zone offsets when deserializing + objectMapper.disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE) + + // we default to the ISO8601 format for JSR-310 + objectMapper.registerModule(JavaTimeModule()) + + objectMapper + } +} diff --git a/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/SchemaEnumValue.kt b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/SchemaEnumValue.kt new file mode 100644 index 00000000..1d85753a --- /dev/null +++ b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/SchemaEnumValue.kt @@ -0,0 +1,22 @@ +package org.openmhealth.schema.domain + +import com.fasterxml.jackson.annotation.JsonValue + +/** + * An interface implemented by Kotlin enumerations that represent schema enumerations. + * + * @author Emerson Farrugia + */ +interface SchemaEnumValue { + /** + * The schema enumeration value. + */ + @get:JsonValue + val schemaValue: String +} + +inline fun findBySchemaValue(schemaValue: String): E? + where E : SchemaEnumValue, + E : Enum = + enumValues() + .firstOrNull { it.schemaValue == schemaValue } diff --git a/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/SchemaId.kt b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/SchemaId.kt new file mode 100644 index 00000000..65fbd755 --- /dev/null +++ b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/SchemaId.kt @@ -0,0 +1,49 @@ +package org.openmhealth.schema.domain + +import java.util.regex.Pattern + +/** + * A schema identifier. It consists of a namespace, a name, and a version. A schema identifier unambiguously identifies + * a single, immutable schema. The namespace is used to avoid naming collisions in schemas written by different groups + * or organisations. + * + * @author Emerson Farrugia + * @version 1.0 + * @see [schema-id](https://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_schema-id) + */ +data class SchemaId( + val namespace: SchemaNamespace = OMH_NAMESPACE, + val name: SchemaName, + val version: SchemaVersion +) : Comparable { + + constructor(namespace: String, name: String, version: String) : this( + namespace = SchemaNamespace(namespace), + name = SchemaName(name), + version = SchemaVersion.fromString(version) + ) + + companion object { + val PATTERN: Pattern = Pattern.compile("([^:]+):([^:]+):([^:]+)") + + fun fromString(id: String): SchemaId { + val matcher = PATTERN.matcher(id) + require(matcher.matches()) { "A malformed schema ID has been specified." } + + return SchemaId( + namespace = matcher.group(1), + name = matcher.group(2), + version = matcher.group(3) + ) + } + + private val comparator = compareBy { it.namespace } + .thenBy { it.name } + .thenBy { it.version } + } + + override fun toString(): String = "$namespace:$name:$version" + + override fun compareTo(other: SchemaId): Int = + comparator.compare(this, other) +} diff --git a/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/SchemaName.kt b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/SchemaName.kt new file mode 100644 index 00000000..2f338f2c --- /dev/null +++ b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/SchemaName.kt @@ -0,0 +1,33 @@ +package org.openmhealth.schema.domain + +import java.util.regex.Pattern + +/** + * A schema name, which uniquely [identifies][SchemaId] a schema when combined with a [SchemaNamespace] and [SchemaVersion]. + * + * @author Emerson Farrugia + */ +@JvmInline +value class SchemaName( + val value: String +) : Comparable { + + init { + require(isValid(value)) { "A malformed name has been specified." } + } + + companion object { + private const val PATTERN_STRING = "[a-zA-Z0-9-]+" + private val PATTERN: Pattern = Pattern.compile(PATTERN_STRING) + + fun isValid(string: String?): Boolean = + string + ?.let { PATTERN.matcher(it).matches() } + ?: true + } + + override fun toString(): String = value + + override fun compareTo(other: SchemaName): Int = + value.compareTo(other.value) +} diff --git a/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/SchemaNamespace.kt b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/SchemaNamespace.kt new file mode 100644 index 00000000..3c167588 --- /dev/null +++ b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/SchemaNamespace.kt @@ -0,0 +1,36 @@ +package org.openmhealth.schema.domain + +import java.util.regex.Pattern + +val IEEE_NAMESPACE = SchemaNamespace("ieee") +val OMH_NAMESPACE = SchemaNamespace("omh") + +/** + * A schema namespace, denoting a group or organisation that creates schemas. + * + * @author Emerson Farrugia + */ +@JvmInline +value class SchemaNamespace( + val value: String +) : Comparable { + + init { + require(isValid(value)) { "A malformed namespace has been specified." } + } + + companion object { + private const val PATTERN_STRING = "[a-zA-Z0-9.-]+" + private val PATTERN: Pattern = Pattern.compile(PATTERN_STRING) + + fun isValid(string: String?): Boolean = + string + ?.let { PATTERN.matcher(it).matches() } + ?: true + } + + override fun toString(): String = value + + override fun compareTo(other: SchemaNamespace): Int = + value.compareTo(other.value) +} diff --git a/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/SchemaSupport.kt b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/SchemaSupport.kt new file mode 100644 index 00000000..b5a4ade9 --- /dev/null +++ b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/SchemaSupport.kt @@ -0,0 +1,17 @@ +package org.openmhealth.schema.domain + +import com.fasterxml.jackson.annotation.JsonIgnore + +/** + * An interface for schema classes. + * + * @author Emerson Farrugia + */ +interface SchemaSupport { + + /** + * @return the schema this class corresponds to + */ + @get:JsonIgnore + val schemaId: SchemaId +} diff --git a/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/SchemaVersion.kt b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/SchemaVersion.kt new file mode 100644 index 00000000..0c97e9fb --- /dev/null +++ b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/SchemaVersion.kt @@ -0,0 +1,55 @@ +package org.openmhealth.schema.domain + +import java.util.regex.Pattern + +/** + * A semantic schema version, consisting of a major number, minor number, and an optional qualifier. + * + * @author Emerson Farrugia + */ +data class SchemaVersion( + val major: Int = 1, + val minor: Int = 0, + val qualifier: String? = null +) : Comparable { + + init { + require(major >= 0) { "A negative major version has been specified." } + require(minor >= 0) { "A negative minor version has been specified." } + require(qualifier == null || QUALIFIER_PATTERN.matcher(qualifier).matches()) { + "A malformed qualifier has been specified." + } + } + + companion object { + private const val QUALIFIER_PATTERN_STRING = "[a-zA-Z0-9]+" + private const val PATTERN_STRING = "(\\d+)\\.(\\d+)(?:\\.($QUALIFIER_PATTERN_STRING))?" + + val QUALIFIER_PATTERN: Pattern = Pattern.compile(QUALIFIER_PATTERN_STRING) + private val PATTERN: Pattern = Pattern.compile(PATTERN_STRING) + + fun fromString(version: String): SchemaVersion { + val matcher = PATTERN.matcher(version) + require(matcher.matches()) { "A malformed version has been specified." } + + return SchemaVersion( + major = Integer.valueOf(matcher.group(1)), + minor = Integer.valueOf(matcher.group(2)), + qualifier = matcher.group(3) + ) + } + + val comparator = compareBy { it.major } + .thenBy { it.minor } + .thenBy { it.qualifier } + } + + override fun toString(): String = + "$major.$minor" + + (qualifier + ?.let { ".$it" } + ?: "") + + override fun compareTo(other: SchemaVersion): Int = + comparator.compare(this, other) +} diff --git a/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/TypedUnitValue.kt b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/TypedUnitValue.kt new file mode 100644 index 00000000..cb99b33e --- /dev/null +++ b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/TypedUnitValue.kt @@ -0,0 +1,11 @@ +package org.openmhealth.schema.domain + +import java.math.BigDecimal + +data class TypedUnitValue( + val unit: T, + val value: BigDecimal +) { + constructor(unit: T, value: Double) : this(unit, BigDecimal.valueOf(value)) + constructor(unit: T, value: Long) : this(unit, BigDecimal.valueOf(value)) +} diff --git a/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/Unit.kt b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/Unit.kt new file mode 100644 index 00000000..841015e3 --- /dev/null +++ b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/Unit.kt @@ -0,0 +1,10 @@ +package org.openmhealth.schema.domain + +import org.openmhealth.schema.domain.SchemaEnumValue + +/** + * A marker interface for units of measure. + * + * @author Emerson Farrugia + */ +interface Unit : SchemaEnumValue diff --git a/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/ieee/DateTime.kt b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/ieee/DateTime.kt new file mode 100644 index 00000000..7589fe3d --- /dev/null +++ b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/ieee/DateTime.kt @@ -0,0 +1,12 @@ +package org.openmhealth.schema.domain.ieee + +import java.time.OffsetDateTime + +/** + * A point in time. + * + * @author Emerson Farrugia + * @version 1.0 + * @see [date-time][https://w3id.org/ieee/ieee-1752-schema/date-time.json] + */ +typealias DateTime = OffsetDateTime diff --git a/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/ieee/DescriptiveStatistic.kt b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/ieee/DescriptiveStatistic.kt new file mode 100644 index 00000000..271311d9 --- /dev/null +++ b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/ieee/DescriptiveStatistic.kt @@ -0,0 +1,45 @@ +package org.openmhealth.schema.domain.ieee + +import org.openmhealth.schema.domain.IEEE_NAMESPACE +import org.openmhealth.schema.domain.SchemaEnumValue +import org.openmhealth.schema.domain.SchemaId +import org.openmhealth.schema.domain.SchemaSupport + +/** + * The descriptive statistic of a set of measurements. A measurement value can be the result of combining + * various measurements and calculating descriptive statistics like average, maximum, minimum, etc. Additional + * descriptive statistics will be added as the need arises. A measurement value without a descriptive statistic + * is interpreted as being the result of an individual measurement. + * + * @author Emerson Farrugia + * @version 1.0 + * @see [descriptive-statistic][https://w3id.org/ieee/ieee-1752-schema/descriptive-statistic.json] + */ +enum class DescriptiveStatistic( + private val customSchemaValue: String? = null +) : SchemaEnumValue, SchemaSupport { + + AVERAGE, + COUNT, + MAXIMUM, + MEDIAN, + MINIMUM, + STANDARD_DEVIATION, + SUM, + VARIANCE, + TWENTIETH_PERCENTILE("20th percentile"), + EIGHTIETH_PERCENTILE("80th percentile"), + LOWER_QUARTILE, + UPPER_QUARTILE, + QUARTILE_DEVIATION, + FIRST_QUINTILE("1st quintile"), + SECOND_QUINTILE("2nd quintile"), + THIRD_QUINTILE("3rd quintile"), + FOURTH_QUINTILE("4th quintile"); + + override val schemaValue: String + get() = customSchemaValue ?: name.lowercase().replace("_", " ") + + override val schemaId: SchemaId + get() = SchemaId(IEEE_NAMESPACE.value, "descriptive-statistic", "1.0") +} diff --git a/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/ieee/DurationUnit.kt b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/ieee/DurationUnit.kt new file mode 100644 index 00000000..fea36830 --- /dev/null +++ b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/ieee/DurationUnit.kt @@ -0,0 +1,29 @@ +package org.openmhealth.schema.domain.ieee + +import org.openmhealth.schema.domain.TypedUnitValue +import org.openmhealth.schema.domain.Unit + +/** + * A unit of duration or length of time. + * + * @author Emerson Farrugia + * @version 1.0 + * @see [duration-unit][https://w3id.org/ieee/ieee-1752-schema/duration-unit-value.json] + */ +enum class DurationUnit( + override val schemaValue: String +) : Unit { + PICOSECOND("ps"), + NANOSECOND("ns"), + MICROSECOND("us"), + MILLISECOND("ms"), + SECOND("sec"), + MINUTE("min"), + HOUR("h"), + DAY("d"), + WEEK("wk"), + MONTH("Mo"), + YEAR("yr"); +} + +typealias DurationUnitValue = TypedUnitValue diff --git a/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/ieee/TimeFrame.kt b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/ieee/TimeFrame.kt new file mode 100644 index 00000000..4db74227 --- /dev/null +++ b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/ieee/TimeFrame.kt @@ -0,0 +1,30 @@ +package org.openmhealth.schema.domain.ieee + +import com.fasterxml.jackson.annotation.JsonTypeInfo +import com.fasterxml.jackson.annotation.JsonTypeInfo.Id + +/** + * A time frame, which is either a point in time or a time interval. + * + * @author Emerson Farrugia + * @version 1.0 + * @see [time-frame][https://w3id.org/ieee/ieee-1752-schema/time-frame.json] + */ +@JsonTypeInfo(use = Id.DEDUCTION) +sealed class TimeFrame + +data class DateTimeTimeFrame( + val dateTime: DateTime +) : TimeFrame() { + companion object { + + fun parse(text: String) = + DateTimeTimeFrame(DateTime.parse(text)) + } +} + +data class TimeIntervalTimeFrame( + val timeInterval: TimeInterval +) : TimeFrame() + + diff --git a/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/ieee/TimeInterval.kt b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/ieee/TimeInterval.kt new file mode 100644 index 00000000..1a43ecfb --- /dev/null +++ b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/ieee/TimeInterval.kt @@ -0,0 +1,40 @@ +package org.openmhealth.schema.domain.ieee + +import com.fasterxml.jackson.annotation.JsonTypeInfo +import com.fasterxml.jackson.annotation.JsonTypeInfo.Id +import org.openmhealth.schema.domain.IEEE_NAMESPACE +import org.openmhealth.schema.domain.SchemaId +import org.openmhealth.schema.domain.SchemaSupport + +/** + * A time interval. No commitments are made 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). + * + * @author Emerson Farrugia + * @version 1.0 + * @see [time-interval][https://w3id.org/ieee/ieee-1752-schema/time-interval.json] + */ +@JsonTypeInfo(use = Id.DEDUCTION) +sealed class TimeInterval : SchemaSupport { + override val schemaId: SchemaId + get() = SchemaId(IEEE_NAMESPACE.value, "time-interval", "1.0") +} + +data class StartEndTimeInterval( + val startDateTime: DateTime, + val endDateTime: DateTime, +) : TimeInterval() { + init { + require(!startDateTime.isAfter(endDateTime)) { "The specified start and end date times are reversed." } + } +} + +data class StartDurationTimeInterval( + val startDateTime: DateTime, + val duration: DurationUnitValue +) : TimeInterval() + +data class EndDurationTimeInterval( + val endDateTime: DateTime, + val duration: DurationUnitValue +) : TimeInterval() diff --git a/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/ieee/UnitValue.kt b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/ieee/UnitValue.kt new file mode 100644 index 00000000..bf35ba2d --- /dev/null +++ b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/ieee/UnitValue.kt @@ -0,0 +1,30 @@ +package org.openmhealth.schema.domain.ieee + +import org.openmhealth.schema.domain.IEEE_NAMESPACE +import org.openmhealth.schema.domain.SchemaId +import org.openmhealth.schema.domain.SchemaSupport +import java.math.BigDecimal + + +/** + * A numerical value with a unit of measure. + * + * @author Emerson Farrugia + * @version 1.0 + * @see [unit-value][https://w3id.org/ieee/ieee-1752-schema/unit-value.json] + */ +data class UnitValue( + val unit: String, + val value: BigDecimal, +) : SchemaSupport { + + constructor(unit: String, value: Double) : this(unit, BigDecimal.valueOf(value)) + constructor(unit: String, value: Long) : this(unit, BigDecimal.valueOf(value)) + + init { + require(unit.isNotEmpty()) { "An empty unit has been specified." } + } + + override val schemaId: SchemaId + get() = SchemaId(IEEE_NAMESPACE.value, "unit-value", "1.0") +} diff --git a/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/omh/AreaUnit.kt b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/omh/AreaUnit.kt new file mode 100644 index 00000000..a826dc3b --- /dev/null +++ b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/omh/AreaUnit.kt @@ -0,0 +1,24 @@ +package org.openmhealth.schema.domain.omh + +import org.openmhealth.schema.domain.Unit + + +/** + * A unit of area, or a measure of a surface. + * + * @author Emerson Farrugia + * @version 1.0 + * @see [area-unit-value](http://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_area-unit-value) + */ +enum class AreaUnit( + override val schemaValue: String +) : Unit { + SQUARE_MILLIMETER("mm^2"), + SQUARE_CENTIMETER("cm^2"), + SQUARE_METER("m^2"), + SQUARE_KILOMETER("km^2"), + SQUARE_INCH("in^2"), + SQUARE_FOOT("ft^2"), + SQUARE_YARD("yd^2"), + SQUARE_MILE("mi^2"); +} diff --git a/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/omh/AreaUnitValue.kt b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/omh/AreaUnitValue.kt new file mode 100644 index 00000000..5f2b6bf0 --- /dev/null +++ b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/omh/AreaUnitValue.kt @@ -0,0 +1,24 @@ +package org.openmhealth.schema.domain.omh + +import org.openmhealth.schema.domain.OMH_NAMESPACE +import org.openmhealth.schema.domain.SchemaId +import org.openmhealth.schema.domain.SchemaSupport +import java.math.BigDecimal + +/** + * An area. + * + * @author Emerson Farrugia + * @version 1.0 + * @see [area-unit-value](http://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_area-unit-value) + */ +data class AreaUnitValue( + val unit: AreaUnit, + val value: BigDecimal +) : SchemaSupport { + + constructor(unit: AreaUnit, value: Double) : this(unit, BigDecimal.valueOf(value)) + + override val schemaId: SchemaId + get() = SchemaId(OMH_NAMESPACE.value, "area-unit-value", "1.0") +} diff --git a/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/omh/HeartRate.kt b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/omh/HeartRate.kt new file mode 100644 index 00000000..f0e3eb32 --- /dev/null +++ b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/omh/HeartRate.kt @@ -0,0 +1,26 @@ +package org.openmhealth.schema.domain.omh + +import org.openmhealth.schema.domain.OMH_NAMESPACE +import org.openmhealth.schema.domain.SchemaId +import org.openmhealth.schema.domain.SchemaSupport +import org.openmhealth.schema.domain.ieee.DescriptiveStatistic +import org.openmhealth.schema.domain.ieee.TimeFrame + +/** + * A person's heart rate. + * + * @author Emerson Farrugia + * @version 1.0 + * @see [heart-rate](http://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_heart-rate) + */ +data class HeartRate( + val heartRate: HeartRateUnitValue, + val effectiveTimeFrame: TimeFrame, + val temporalRelationshipToPhysicalActivity: TemporalRelationshipToPhysicalActivity? = null, + val temporalRelationshipToSleep: TemporalRelationshipToSleep? = null, + val descriptiveStatistic: DescriptiveStatistic? = null +) : SchemaSupport { + + override val schemaId: SchemaId + get() = SchemaId(OMH_NAMESPACE.value, "heart-rate", "2.0") +} diff --git a/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/omh/HeartRateUnit.kt b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/omh/HeartRateUnit.kt new file mode 100644 index 00000000..0cad3c78 --- /dev/null +++ b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/omh/HeartRateUnit.kt @@ -0,0 +1,22 @@ +package org.openmhealth.schema.domain.omh + +import org.openmhealth.schema.domain.TypedUnitValue +import org.openmhealth.schema.domain.Unit + + +/** + * A unit of heart rate. + * + * @author Emerson Farrugia + * @version 1.0 + * @see [heart-rate](http://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_heart-rate) + */ +enum class HeartRateUnit( + override val schemaValue: String +) : Unit { + BEATS_PER_MINUTE("beats/min"); +} + +typealias HeartRateUnitValue = TypedUnitValue + +fun HeartRateUnit.toUnitValue(value: Double) = HeartRateUnitValue(this, value) diff --git a/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/omh/TemporalRelationshipToPhysicalActivity.kt b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/omh/TemporalRelationshipToPhysicalActivity.kt new file mode 100644 index 00000000..61b9d068 --- /dev/null +++ b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/omh/TemporalRelationshipToPhysicalActivity.kt @@ -0,0 +1,31 @@ +package org.openmhealth.schema.domain.omh + +import org.openmhealth.schema.domain.OMH_NAMESPACE +import org.openmhealth.schema.domain.SchemaEnumValue +import org.openmhealth.schema.domain.SchemaId +import org.openmhealth.schema.domain.SchemaSupport + +/** + * The temporal relationship of a clinical measure or assessment to physical activity. + * + * @author Emerson Farrugia + * @version 1.0 + * @see [temporal + * -relationship-to-physical-activity](https://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_temporal-relationship-to-physical-activity) + */ +enum class TemporalRelationshipToPhysicalActivity : SchemaEnumValue, SchemaSupport { + + AT_REST, + ACTIVE, + BEFORE_EXERCISE, + AFTER_EXERCISE, + DURING_EXERCISE; + + override val schemaValue: String + get() = name.lowercase().replace("_", " ") + + override val schemaId: SchemaId + get() = SchemaId(OMH_NAMESPACE.value, "temporal-relationship-to-physical-activity", "1.0") +} + + diff --git a/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/omh/TemporalRelationshipToSleep.kt b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/omh/TemporalRelationshipToSleep.kt new file mode 100644 index 00000000..fe098020 --- /dev/null +++ b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/omh/TemporalRelationshipToSleep.kt @@ -0,0 +1,27 @@ +package org.openmhealth.schema.domain.omh + +import org.openmhealth.schema.domain.OMH_NAMESPACE +import org.openmhealth.schema.domain.SchemaEnumValue +import org.openmhealth.schema.domain.SchemaId +import org.openmhealth.schema.domain.SchemaSupport + +/** + * The temporal relationship of a clinical measure or assessment to sleep. + * + * @author Emerson Farrugia + * @version 1.0 + * @see [temporal-relationship + * -to-sleep](http://www.openmhealth.org/documentation/./schema-docs/schema-library/schemas/omh_temporal-relationship-to-sleep) + */ +enum class TemporalRelationshipToSleep : SchemaEnumValue, SchemaSupport { + + BEFORE_SLEEPING, + DURING_SLEEP, + ON_WAKING; + + override val schemaValue: String + get() = name.lowercase().replace("_", " ") + + override val schemaId: SchemaId + get() = SchemaId(OMH_NAMESPACE.value, "temporal-relationship-to-sleep", "1.0") +} diff --git a/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/omh/UnitValue.kt b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/omh/UnitValue.kt new file mode 100644 index 00000000..a8c3efa4 --- /dev/null +++ b/kotlin-schema-sdk/bin/main/org/openmhealth/schema/domain/omh/UnitValue.kt @@ -0,0 +1,30 @@ +package org.openmhealth.schema.domain.omh + +import org.openmhealth.schema.domain.OMH_NAMESPACE +import org.openmhealth.schema.domain.SchemaId +import org.openmhealth.schema.domain.SchemaSupport +import java.math.BigDecimal + + +/** + * A numerical value with a unit of measure. + * + * @author Emerson Farrugia + * @version 1.0 + * @see [unit-value](https://www.openmhealth.org/documentation/#/schema-docs/schema-library/schemas/omh_unit-value) + */ +data class UnitValue( + val unit: String, + val value: BigDecimal, +) : SchemaSupport { + + constructor(unit: String, value: Double) : this(unit, BigDecimal.valueOf(value)) + constructor(unit: String, value: Long) : this(unit, BigDecimal.valueOf(value)) + + init { + require(unit.isNotEmpty()) { "An empty unit has been specified." } + } + + override val schemaId: SchemaId + get() = SchemaId(OMH_NAMESPACE.value, "unit-value", "1.0") +} diff --git a/kotlin-schema-sdk/bin/test/org/openmhealth/schema/domain/ieee/TimeFrameTests.kt b/kotlin-schema-sdk/bin/test/org/openmhealth/schema/domain/ieee/TimeFrameTests.kt new file mode 100644 index 00000000..766d1f3b --- /dev/null +++ b/kotlin-schema-sdk/bin/test/org/openmhealth/schema/domain/ieee/TimeFrameTests.kt @@ -0,0 +1,37 @@ +package org.openmhealth.schema.domain.omh + +import com.fasterxml.jackson.databind.JsonNode +import org.junit.jupiter.params.ParameterizedTest +import org.openmhealth.schema.domain.ieee.* +import org.openmhealth.schema.domain.ieee.DurationUnit.DAY +import org.openmhealth.schema.support.DataFileSource +import java.time.OffsetDateTime + + +class TimeFrameTests : MappingTests() { + + @ParameterizedTest + @DataFileSource(schemaId = "ieee:time-frame:1.0", filename = "date-time.json") + fun `date-time`(json: JsonNode) { + + val value = DateTimeTimeFrame( + dateTime = DateTime.parse("2013-02-05T07:25:00.123Z"), + ) + + assertThatMappingWorks(value, json) + } + + @ParameterizedTest + @DataFileSource(schemaId = "ieee:time-frame:1.0", filename = "time-interval.json") + fun `time-interval`(json: JsonNode) { + + val value = TimeIntervalTimeFrame( + timeInterval = EndDurationTimeInterval( + endDateTime = OffsetDateTime.parse("2013-02-05T07:35:00Z"), + duration = DurationUnitValue(DAY, 7.6) + ) + ) + + assertThatMappingWorks(value, json) + } +} diff --git a/kotlin-schema-sdk/bin/test/org/openmhealth/schema/domain/ieee/TimeIntervalTests.kt b/kotlin-schema-sdk/bin/test/org/openmhealth/schema/domain/ieee/TimeIntervalTests.kt new file mode 100644 index 00000000..1b50c72f --- /dev/null +++ b/kotlin-schema-sdk/bin/test/org/openmhealth/schema/domain/ieee/TimeIntervalTests.kt @@ -0,0 +1,48 @@ +package org.openmhealth.schema.domain.omh + +import com.fasterxml.jackson.databind.JsonNode +import org.junit.jupiter.params.ParameterizedTest +import org.openmhealth.schema.domain.ieee.* +import org.openmhealth.schema.domain.ieee.DurationUnit.DAY +import org.openmhealth.schema.support.DataFileSource +import java.time.OffsetDateTime + + +class TimeIntervalTests : MappingTests() { + + @ParameterizedTest + @DataFileSource(schemaId = "ieee:time-interval:1.0", filename = "start-time-end-time.json") + fun `start-time-end-time`(json: JsonNode) { + + val value = StartEndTimeInterval( + startDateTime = DateTime.parse("2013-02-05T07:25:00Z"), + endDateTime = DateTime.parse("2013-02-05T07:35:00Z") + ) + + assertThatMappingWorks(value, json) + } + + @ParameterizedTest + @DataFileSource(schemaId = "ieee:time-interval:1.0", filename = "start-time-duration.json") + fun `start-time-duration`(json: JsonNode) { + + val value = StartDurationTimeInterval( + startDateTime = DateTime.parse("2013-02-05T07:25:00Z"), + duration = DurationUnitValue(DAY, 10.2) + ) + + assertThatMappingWorks(value, json) + } + + @ParameterizedTest + @DataFileSource(schemaId = "ieee:time-interval:1.0", filename = "end-time-duration.json") + fun `end-time-duration`(json: JsonNode) { + + val value = EndDurationTimeInterval( + endDateTime = DateTime.parse("2013-02-05T07:35:00Z"), + duration = DurationUnitValue(DAY, 10.9) + ) + + assertThatMappingWorks(value, json) + } +} diff --git a/kotlin-schema-sdk/bin/test/org/openmhealth/schema/domain/omh/AreaUnitValueTests.kt b/kotlin-schema-sdk/bin/test/org/openmhealth/schema/domain/omh/AreaUnitValueTests.kt new file mode 100644 index 00000000..34fba553 --- /dev/null +++ b/kotlin-schema-sdk/bin/test/org/openmhealth/schema/domain/omh/AreaUnitValueTests.kt @@ -0,0 +1,27 @@ +package org.openmhealth.schema.domain.omh + +import com.fasterxml.jackson.databind.JsonNode +import org.junit.jupiter.params.ParameterizedTest +import org.openmhealth.schema.domain.omh.AreaUnit.SQUARE_INCH +import org.openmhealth.schema.domain.omh.AreaUnit.SQUARE_METER +import org.openmhealth.schema.support.DataFileSource + + +class AreaUnitValueTests : MappingTests() { + + @ParameterizedTest + @DataFileSource(schemaId = "omh:area-unit-value:1.0", filename = "positive-value.json") + fun `positive-value`(json: JsonNode) { + val value = AreaUnitValue(SQUARE_METER, 7.6) + + assertThatMappingWorks(value, json) + } + + @ParameterizedTest + @DataFileSource(schemaId = "omh:area-unit-value:1.0", filename = "zero-value.json") + fun `zero-value`(json: JsonNode) { + val value = AreaUnitValue(SQUARE_INCH, 0.0) + + assertThatMappingWorks(value, json) + } +} diff --git a/kotlin-schema-sdk/bin/test/org/openmhealth/schema/domain/omh/HeartRateTests.kt b/kotlin-schema-sdk/bin/test/org/openmhealth/schema/domain/omh/HeartRateTests.kt new file mode 100644 index 00000000..97d61ad9 --- /dev/null +++ b/kotlin-schema-sdk/bin/test/org/openmhealth/schema/domain/omh/HeartRateTests.kt @@ -0,0 +1,44 @@ +package org.openmhealth.schema.domain.omh + +import com.fasterxml.jackson.databind.JsonNode +import org.junit.jupiter.params.ParameterizedTest +import org.openmhealth.schema.domain.ieee.* +import org.openmhealth.schema.domain.ieee.DescriptiveStatistic.MINIMUM +import org.openmhealth.schema.domain.omh.HeartRateUnit.BEATS_PER_MINUTE +import org.openmhealth.schema.domain.omh.TemporalRelationshipToSleep.ON_WAKING +import org.openmhealth.schema.support.DataFileSource + + +class HeartRateTests : MappingTests() { + + @ParameterizedTest + @DataFileSource(schemaId = "omh:heart-rate:2.0", filename = "with-temporal-relationship-to-sleep.json") + fun `with-temporal-relationship-to-sleep`(json: JsonNode) { + + val value = HeartRate( + heartRate = BEATS_PER_MINUTE.toUnitValue(67.5), + effectiveTimeFrame = DateTimeTimeFrame.parse("2020-02-05T07:25:00-08:00"), + temporalRelationshipToSleep = ON_WAKING + ) + + assertThatMappingWorks(value, json) + } + + @ParameterizedTest + @DataFileSource(schemaId = "omh:heart-rate:2.0", filename = "with-descriptive-statistic.json") + fun `with-descriptive-statistic`(json: JsonNode) { + + val value = HeartRate( + heartRate = BEATS_PER_MINUTE.toUnitValue(50.0), + effectiveTimeFrame = TimeIntervalTimeFrame( + StartEndTimeInterval( + startDateTime = DateTime.parse("2020-02-05T06:00:00+01:00"), + endDateTime = DateTime.parse("2020-02-06T06:00:00+01:00") + ) + ), + descriptiveStatistic = MINIMUM + ) + + assertThatMappingWorks(value, json) + } +} diff --git a/kotlin-schema-sdk/bin/test/org/openmhealth/schema/domain/omh/MappingTests.kt b/kotlin-schema-sdk/bin/test/org/openmhealth/schema/domain/omh/MappingTests.kt new file mode 100644 index 00000000..32132fcd --- /dev/null +++ b/kotlin-schema-sdk/bin/test/org/openmhealth/schema/domain/omh/MappingTests.kt @@ -0,0 +1,26 @@ +package org.openmhealth.schema.domain.omh + +import com.fasterxml.jackson.databind.JsonNode +import org.assertj.core.api.Assertions.assertThat +import org.openmhealth.schema.configuration.JacksonConfiguration.objectMapper +import com.fasterxml.jackson.module.kotlin.readValue + +open class MappingTests { + + inline fun assertThatMappingWorks(value: T, json: JsonNode) { + assertThatSerializationWorks(actualValue = value, expectedJson = json) + assertThatDeserializationWorks(actualJson = json, expectedValue = value) + } + + fun assertThatSerializationWorks(actualValue: T, expectedJson: JsonNode) { + val actualValueAsJsonNode: JsonNode = objectMapper.valueToTree(actualValue) + + assertThat(actualValueAsJsonNode).isEqualTo(expectedJson) + } + + inline fun assertThatDeserializationWorks(actualJson: JsonNode, expectedValue: T) { + val actualValue: T = objectMapper.treeToValue(actualJson, T::class.java) + + assertThat(actualValue).isEqualTo(expectedValue) + } +} diff --git a/kotlin-schema-sdk/bin/test/org/openmhealth/schema/support/DataFileSource.kt b/kotlin-schema-sdk/bin/test/org/openmhealth/schema/support/DataFileSource.kt new file mode 100644 index 00000000..bd511d46 --- /dev/null +++ b/kotlin-schema-sdk/bin/test/org/openmhealth/schema/support/DataFileSource.kt @@ -0,0 +1,57 @@ +package org.openmhealth.schema.support + +import org.junit.jupiter.api.extension.ExtensionContext +import org.junit.jupiter.params.provider.Arguments +import org.junit.jupiter.params.provider.ArgumentsProvider +import org.junit.jupiter.params.provider.ArgumentsSource +import org.junit.jupiter.params.support.AnnotationConsumer +import org.junit.platform.commons.JUnitException +import org.openmhealth.schema.configuration.JacksonConfiguration.objectMapper +import org.openmhealth.schema.domain.SchemaId +import java.io.IOException +import java.util.stream.Stream +import kotlin.annotation.AnnotationRetention.RUNTIME +import kotlin.annotation.AnnotationTarget.FUNCTION +import kotlin.io.path.Path + + +@Target(FUNCTION) +@Retention(RUNTIME) +@ArgumentsSource(DataFileArgumentsProvider::class) +annotation class DataFileSource( + val baseDirectory: String = "../test-data", + val schemaId: String, + val filename: String, +) + +class DataFileArgumentsProvider : ArgumentsProvider, AnnotationConsumer { + + private lateinit var path: String + + override fun accept(annotation: DataFileSource) { + val schemaId = SchemaId.fromString(annotation.schemaId) + + path = listOf( + schemaId.namespace, + schemaId.name, + schemaId.version, + "shouldPass", + annotation.filename + ) + .joinToString(separator = "/", prefix = annotation.baseDirectory + "/") + } + + override fun provideArguments(context: ExtensionContext): Stream { + + val file = Path(path).toFile() + val jsonNode = try { + objectMapper.readTree(file) + } catch (e: IOException) { + throw JUnitException("File [$path] could not be read", e) + } + + return listOf(jsonNode) + .stream() + .map { Arguments.of(it) } + } +} diff --git a/schema/ros4hc/Notes.txt b/schema/ros4hc/Notes.txt index f45f0db3..7aa4398b 100644 --- a/schema/ros4hc/Notes.txt +++ b/schema/ros4hc/Notes.txt @@ -1,7 +1,4 @@ -There are some inconsistencies in the Ros4HC messages as well for the headers. +What is required in signal Info? e.g. Sensor configuration, lightning configuration etc. +How to know from ros messages which signal is coming from? Is there something like a tag? -- EEGInfo.msg uses "Signal mode" which is the same as "Electrode Type" referred in EDAInfo. Hence, we use the first one for all schemas. - -- There are multiple sampling frequencies, and units in both deviceInfo and specific signal info message. A better distinguishing between both is needed, or remove one duplicate. - -- Some parts of the signal's header is the same for all signals, we can summarize them in one specific section, e.g. sampling_info. \ No newline at end of file +EOG_Info.msg stilll has Units as field -> should be in deviceInfo \ No newline at end of file diff --git a/schema/ros4hc/bcg-1.x.json b/schema/ros4hc/bcg-1.x.json index 8cc30e5f..42ec11d6 100644 --- a/schema/ros4hc/bcg-1.x.json +++ b/schema/ros4hc/bcg-1.x.json @@ -43,21 +43,12 @@ "effective_time_frame": { "description": "The time interval at which, or time interval during which the measurement is asserted as being valid.", - "allOf": [ - { - "$ref": "#/definitions/time_frame" - }, - { - "required": [ - "time_interval" - ] - } - ] + "$ref": "#/definitions/time_frame" } }, "required": [ + "session_id", "bcg", - "signal_quality", "effective_time_frame" ] } \ No newline at end of file diff --git a/schema/ros4hc/ecg-1.x.json b/schema/ros4hc/ecg-1.x.json index d0e61b4a..ce2891b5 100644 --- a/schema/ros4hc/ecg-1.x.json +++ b/schema/ros4hc/ecg-1.x.json @@ -46,14 +46,8 @@ }, "effective_time_frame": { - "allOf": [ - { - "$ref": "#/definitions/time_frame" - }, - { - "required": ["time_interval"] - } - ] + "description": "The time interval at which, or time interval during which the measurement is asserted as being valid.", + "$ref": "#/definitions/time_frame" } }, diff --git a/schema/ros4hc/eda-1.x.json b/schema/ros4hc/eda-1.x.json index b748401d..39ca532b 100644 --- a/schema/ros4hc/eda-1.x.json +++ b/schema/ros4hc/eda-1.x.json @@ -59,16 +59,7 @@ "effective_time_frame": { "description": "The time interval at which, or time interval during which the measurement is asserted as being valid.", - "allOf": [ - { - "$ref": "#/definitions/time_frame" - }, - { - "required": [ - "time_interval" - ] - } - ] + "$ref": "#/definitions/time_frame" } }, "required": [ diff --git a/schema/ros4hc/eeg-1.x.json b/schema/ros4hc/eeg-1.x.json index a9509955..5885a0a2 100644 --- a/schema/ros4hc/eeg-1.x.json +++ b/schema/ros4hc/eeg-1.x.json @@ -46,14 +46,8 @@ }, "effective_time_frame": { - "allOf": [ - { - "$ref": "#/definitions/time_frame" - }, - { - "required": ["time_interval"] - } - ] + "description": "The time interval at which, or time interval during which the measurement is asserted as being valid.", + "$ref": "#/definitions/time_frame" } }, diff --git a/schema/ros4hc/emg-1.x.json b/schema/ros4hc/emg-1.x.json index bf580776..0309328e 100644 --- a/schema/ros4hc/emg-1.x.json +++ b/schema/ros4hc/emg-1.x.json @@ -46,14 +46,8 @@ }, "effective_time_frame": { - "allOf": [ - { - "$ref": "#/definitions/time_frame" - }, - { - "required": ["time_interval"] - } - ] + "description": "The time interval at which, or time interval during which the measurement is asserted as being valid.", + "$ref": "#/definitions/time_frame" } }, diff --git a/schema/ros4hc/eog-1.x.json b/schema/ros4hc/eog-1.x.json index 1689a0d5..d5c643fa 100644 --- a/schema/ros4hc/eog-1.x.json +++ b/schema/ros4hc/eog-1.x.json @@ -46,14 +46,8 @@ }, "effective_time_frame": { - "allOf": [ - { - "$ref": "#/definitions/time_frame" - }, - { - "required": ["time_interval"] - } - ] + "description": "The time interval at which, or time interval during which the measurement is asserted as being valid.", + "$ref": "#/definitions/time_frame" } }, diff --git a/schema/ros4hc/eog-info-1.x.json b/schema/ros4hc/eog-info-1.x.json index f7924a43..67956381 100644 --- a/schema/ros4hc/eog-info-1.x.json +++ b/schema/ros4hc/eog-info-1.x.json @@ -71,7 +71,7 @@ "enum": ["Unknown", "Tungsten", "Halogen", "LED", "Fluorescent", "Sunlight", "Custom"] }, - "gazefield_background_light_brightness": { + "gazefield": { "allOf": [ { "$ref": "#/definitions/unit_value" @@ -89,7 +89,7 @@ ] }, - "length_light_dark_phase" : { + "light_dark_phase" : { "type": "array", "items": { "type": "number" diff --git a/schema/ros4hc/icg-1.x.json b/schema/ros4hc/icg-1.x.json index 4a4865eb..245035f8 100644 --- a/schema/ros4hc/icg-1.x.json +++ b/schema/ros4hc/icg-1.x.json @@ -43,16 +43,7 @@ "effective_time_frame": { "description": "The time interval at which, or time interval during which the measurement is asserted as being valid.", - "allOf": [ - { - "$ref": "#/definitions/time_frame" - }, - { - "required": [ - "time_interval" - ] - } - ] + "$ref": "#/definitions/time_frame" } }, "required": [ diff --git a/schema/ros4hc/metadata/device-identity-1.x.json b/schema/ros4hc/metadata/device-identity-1.x.json index 8aa86492..097f0a6e 100644 --- a/schema/ros4hc/metadata/device-identity-1.x.json +++ b/schema/ros4hc/metadata/device-identity-1.x.json @@ -19,5 +19,6 @@ } }, "required": [ + "device_serial_number" ] } diff --git a/schema/ros4hc/metadata/device-info-1.x.json b/schema/ros4hc/metadata/device-info-1.x.json index bbc61ac9..45fc9d1a 100644 --- a/schema/ros4hc/metadata/device-info-1.x.json +++ b/schema/ros4hc/metadata/device-info-1.x.json @@ -37,7 +37,8 @@ "quality_window_size_samples": { "type": "number" } - } + }, + "required": ["window_size_samples"] } }, "required": [ diff --git a/schema/ros4hc/metadata/operating-environment-1.x.json b/schema/ros4hc/metadata/operating-environment-1.x.json index e3b890db..66c6e379 100644 --- a/schema/ros4hc/metadata/operating-environment-1.x.json +++ b/schema/ros4hc/metadata/operating-environment-1.x.json @@ -33,7 +33,7 @@ "operation_temperature": { "$ref": "#/definitions/min_max_value" }, - "minimal_atmospheric_pressure": { + "maximal_relative_humidity": { "allOf": [ { "$ref": "#/definitions/unit_value" @@ -43,7 +43,7 @@ "properties": { "unit": { "enum": [ - "atm" + "%" ] } } @@ -51,7 +51,21 @@ ] }, "atmospheric_pressure": { - "$ref": "#/definitions/min_max_value" + "allOf": [ + { + "$ref": "#/definitions/min_max_value" + }, + { + "type": "object", + "properties": { + "unit": { + "enum": [ + "atm" + ] + } + } + } + ] } }, "required": [ diff --git a/schema/ros4hc/pcg-1.x.json b/schema/ros4hc/pcg-1.x.json index 46aa9467..363df8d5 100644 --- a/schema/ros4hc/pcg-1.x.json +++ b/schema/ros4hc/pcg-1.x.json @@ -55,16 +55,7 @@ "effective_time_frame": { "description": "The time interval at which, or time interval during which the measurement is asserted as being valid.", - "allOf": [ - { - "$ref": "#/definitions/time_frame" - }, - { - "required": [ - "time_interval" - ] - } - ] + "$ref": "#/definitions/time_frame" } }, "required": [ diff --git a/schema/ros4hc/pcg-info-1.x.json b/schema/ros4hc/pcg-info-1.x.json index a2655ec9..a54d0f16 100644 --- a/schema/ros4hc/pcg-info-1.x.json +++ b/schema/ros4hc/pcg-info-1.x.json @@ -56,12 +56,15 @@ ] }, - "signal_waveform_specifications":{ + "waveform_configuration":{ "type": "object", "properties": { "wavelengths_mm": { "description": "Nanometer value for each channel, may be [660, 880, 940]", - "type": "integer" + "type": "array", + "items": { + "type": "integer" + } }, "wavelengths_labels": { "description": "Wavelength Label for each channel (optional)", From be5b52ece3f13955031ec0d3451a6f758822dd71 Mon Sep 17 00:00:00 2001 From: Elisa Du <79795653+Alizzie@users.noreply.github.com> Date: Sat, 2 Aug 2025 18:16:30 +0200 Subject: [PATCH 04/15] change body type to array --- schema/ros4hc/bcg-info-1.x.json | 5 ++++- schema/ros4hc/ecg-info-1.x.json | 5 ++++- schema/ros4hc/eda-info-1-x.json | 5 ++++- schema/ros4hc/eeg-info-1.x.json | 5 ++++- schema/ros4hc/emg-info-1.x.json | 5 ++++- schema/ros4hc/eog-info-1.x.json | 5 ++++- schema/ros4hc/icg-info-1.x.json | 5 ++++- schema/ros4hc/{pcg-1.x.json => ppg-1.x.json} | 0 schema/ros4hc/{pcg-info-1.x.json => ppg-info-1.x.json} | 5 ++++- 9 files changed, 32 insertions(+), 8 deletions(-) rename schema/ros4hc/{pcg-1.x.json => ppg-1.x.json} (100%) rename schema/ros4hc/{pcg-info-1.x.json => ppg-info-1.x.json} (96%) diff --git a/schema/ros4hc/bcg-info-1.x.json b/schema/ros4hc/bcg-info-1.x.json index 38b1792b..46d720c5 100644 --- a/schema/ros4hc/bcg-info-1.x.json +++ b/schema/ros4hc/bcg-info-1.x.json @@ -78,7 +78,10 @@ ] }, "body": { - "$ref": "#/definitions/bcg_body" + "type": "array", + "items": { + "$ref": "#/definitions/bcg_body" + } } }, diff --git a/schema/ros4hc/ecg-info-1.x.json b/schema/ros4hc/ecg-info-1.x.json index ee17c64d..487772c7 100644 --- a/schema/ros4hc/ecg-info-1.x.json +++ b/schema/ros4hc/ecg-info-1.x.json @@ -66,7 +66,10 @@ }, "body": { - "$ref": "#/definitions/ecg_body" + "type": "array", + "items": { + "$ref": "#/definitions/ecg_body" + } } }, diff --git a/schema/ros4hc/eda-info-1-x.json b/schema/ros4hc/eda-info-1-x.json index 0d9e4ff1..ee966b1e 100644 --- a/schema/ros4hc/eda-info-1-x.json +++ b/schema/ros4hc/eda-info-1-x.json @@ -73,7 +73,10 @@ }, "body": { - "$ref": "#/definitions/eda_body" + "type": "array", + "items": { + "$ref": "#/definitions/eda_body" + } } }, diff --git a/schema/ros4hc/eeg-info-1.x.json b/schema/ros4hc/eeg-info-1.x.json index f637e971..31c29ffe 100644 --- a/schema/ros4hc/eeg-info-1.x.json +++ b/schema/ros4hc/eeg-info-1.x.json @@ -74,7 +74,10 @@ }, "body": { - "$ref": "#/definitions/eeg_body" + "type": "array", + "items": { + "$ref": "#/definitions/eeg_body" + } } }, diff --git a/schema/ros4hc/emg-info-1.x.json b/schema/ros4hc/emg-info-1.x.json index 9ac8e055..991fe4b3 100644 --- a/schema/ros4hc/emg-info-1.x.json +++ b/schema/ros4hc/emg-info-1.x.json @@ -72,7 +72,10 @@ }, "body": { - "$ref": "#/definitions/emg_body" + "type": "array", + "items": { + "$ref": "#/definitions/emg_body" + } } }, diff --git a/schema/ros4hc/eog-info-1.x.json b/schema/ros4hc/eog-info-1.x.json index 67956381..82a42fa8 100644 --- a/schema/ros4hc/eog-info-1.x.json +++ b/schema/ros4hc/eog-info-1.x.json @@ -106,7 +106,10 @@ }, "body": { - "$ref": "#/definitions/eog_body" + "type": "array", + "items": { + "$ref": "#/definitions/eog_body" + } } }, diff --git a/schema/ros4hc/icg-info-1.x.json b/schema/ros4hc/icg-info-1.x.json index 8df1c9da..87942fe1 100644 --- a/schema/ros4hc/icg-info-1.x.json +++ b/schema/ros4hc/icg-info-1.x.json @@ -70,7 +70,10 @@ }, "body": { - "$ref": "#/definitions/icg_body" + "type": "array", + "items": { + "$ref": "#/definitions/icg_body" + } } }, diff --git a/schema/ros4hc/pcg-1.x.json b/schema/ros4hc/ppg-1.x.json similarity index 100% rename from schema/ros4hc/pcg-1.x.json rename to schema/ros4hc/ppg-1.x.json diff --git a/schema/ros4hc/pcg-info-1.x.json b/schema/ros4hc/ppg-info-1.x.json similarity index 96% rename from schema/ros4hc/pcg-info-1.x.json rename to schema/ros4hc/ppg-info-1.x.json index a54d0f16..f1dcaaac 100644 --- a/schema/ros4hc/pcg-info-1.x.json +++ b/schema/ros4hc/ppg-info-1.x.json @@ -82,7 +82,10 @@ }, "body": { - "$ref": "#/definitions/ppg_body" + "type": "array", + "items": { + "$ref": "#/definitions/ppg_body" + } } }, From 4526c55be476449fe28919420da2672fde85c34b Mon Sep 17 00:00:00 2001 From: Elisa Du <79795653+Alizzie@users.noreply.github.com> Date: Mon, 11 Aug 2025 17:40:18 +0200 Subject: [PATCH 05/15] fix bugs --- schema/ros4hc/Notes.txt | 2 +- schema/ros4hc/eda-1.x.json | 2 +- schema/ros4hc/{eda-info-1-x.json => eda-info-1.x.json} | 0 ...e-filterbase-1-x.json => healthcare-filterbase-1.x.json} | 0 schema/ros4hc/metadata/device-info-1.x.json | 6 +++--- schema/ros4hc/ppg-1.x.json | 2 ++ 6 files changed, 7 insertions(+), 5 deletions(-) rename schema/ros4hc/{eda-info-1-x.json => eda-info-1.x.json} (100%) rename schema/ros4hc/{healthcare-filterbase-1-x.json => healthcare-filterbase-1.x.json} (100%) diff --git a/schema/ros4hc/Notes.txt b/schema/ros4hc/Notes.txt index 7aa4398b..dcb57050 100644 --- a/schema/ros4hc/Notes.txt +++ b/schema/ros4hc/Notes.txt @@ -1,4 +1,4 @@ What is required in signal Info? e.g. Sensor configuration, lightning configuration etc. -How to know from ros messages which signal is coming from? Is there something like a tag? +How to know from ros messages which signal is coming from? Is there something like a tag?v -> Id in ros are message name EOG_Info.msg stilll has Units as field -> should be in deviceInfo \ No newline at end of file diff --git a/schema/ros4hc/eda-1.x.json b/schema/ros4hc/eda-1.x.json index 39ca532b..7c4bc061 100644 --- a/schema/ros4hc/eda-1.x.json +++ b/schema/ros4hc/eda-1.x.json @@ -40,7 +40,7 @@ }, "eda": { - "description": "Sum of signals (scl + scr", + "description": "Sum of signals (scl + scr)", "type": "array", "items": { "type": "number" diff --git a/schema/ros4hc/eda-info-1-x.json b/schema/ros4hc/eda-info-1.x.json similarity index 100% rename from schema/ros4hc/eda-info-1-x.json rename to schema/ros4hc/eda-info-1.x.json diff --git a/schema/ros4hc/healthcare-filterbase-1-x.json b/schema/ros4hc/healthcare-filterbase-1.x.json similarity index 100% rename from schema/ros4hc/healthcare-filterbase-1-x.json rename to schema/ros4hc/healthcare-filterbase-1.x.json diff --git a/schema/ros4hc/metadata/device-info-1.x.json b/schema/ros4hc/metadata/device-info-1.x.json index 45fc9d1a..7d0a704c 100644 --- a/schema/ros4hc/metadata/device-info-1.x.json +++ b/schema/ros4hc/metadata/device-info-1.x.json @@ -6,13 +6,13 @@ "type": "object", "definitions": { "device_identity": { - "$ref": "device_identity-1.x.json" + "$ref": "device-identity-1.x.json" }, "operating_environment": { - "$ref": "operating_environment-1.x.json" + "$ref": "operating-environment-1.x.json" }, "measurement_specification": { - "$ref": "measurement_specification-1.x.json" + "$ref": "measurement-specification-1.x.json" } }, "properties": { diff --git a/schema/ros4hc/ppg-1.x.json b/schema/ros4hc/ppg-1.x.json index 363df8d5..b0d29e72 100644 --- a/schema/ros4hc/ppg-1.x.json +++ b/schema/ros4hc/ppg-1.x.json @@ -28,10 +28,12 @@ }, "ac_component": { + "description": "# [samples]×[wavelengths]", "type": "number" }, "dc_component" : { + "description": "# [samples]×[wavelengths]", "type": "number" }, From 9ee2d0a72c8a9feedc146d11c29e5903c83bd689 Mon Sep 17 00:00:00 2001 From: Elisa Du <79795653+Alizzie@users.noreply.github.com> Date: Mon, 18 Aug 2025 13:29:23 +0200 Subject: [PATCH 06/15] simply signal header removing header/body fields in signalInfo as it is duplicated with the header/bod from data point and data series schema --- schema/ros4hc/bcg-info-1.x.json | 119 ++++++-------- schema/ros4hc/ecg-info-1.x.json | 91 ++++------- schema/ros4hc/eda-info-1.x.json | 105 +++++-------- schema/ros4hc/eeg-info-1.x.json | 103 +++++-------- schema/ros4hc/emg-info-1.x.json | 99 +++++------- schema/ros4hc/eog-info-1.x.json | 145 +++++++----------- schema/ros4hc/icg-info-1.x.json | 92 ++++------- schema/ros4hc/lead-location-1.x.json | 20 --- schema/ros4hc/metadata/device-info-1.x.json | 48 ------ .../metadata/sensor-device-header-1.x.json | 50 +++++- schema/ros4hc/ppg-info-1.x.json | 110 +++++-------- 11 files changed, 359 insertions(+), 623 deletions(-) delete mode 100644 schema/ros4hc/lead-location-1.x.json delete mode 100644 schema/ros4hc/metadata/device-info-1.x.json diff --git a/schema/ros4hc/bcg-info-1.x.json b/schema/ros4hc/bcg-info-1.x.json index 46d720c5..cf47d882 100644 --- a/schema/ros4hc/bcg-info-1.x.json +++ b/schema/ros4hc/bcg-info-1.x.json @@ -6,87 +6,54 @@ "description": "This schema represents a bcg data series, i.e., an array of measures that share the same header.", "definitions": { - "device-info": { - "$ref": "device-info-1.x.json" - }, - "default-header": { - "$ref": "ord-default-header-1.x.json" - }, - "filter": { - "$ref": "healthcare-filterbase-1.x.json" - }, - "bcg_body": { - "$ref": "bcg-1.x.json" + "sensor_device_header": { + "$ref": "sensor-device-header-1.x.json" } }, - - "properties": { - "header": { - "description": "The header of the data point.", - "type":"object", - "allOf": [ - {"$ref": "#/definitions/default-header"}, - {"$ref": "#/definitions/device-info"}, - {"$ref": "#/definitions/filter"}, - - { - "type": "object", - "properties": { - "sensor_configuration": { - "type": "object", - "properties": { - - "sensor_placement": { - "description": "Sensor Placements", - "type": "string", - "enum": [ - "Unknown", "Chest", "Back", "Mattress", "Chair", "Feet", "Wrist", "Arm", "Desk", "Clothing", "Custom" - ] - }, - - "sensing_direction": { - "description": "Axis along which BCG is measured", - "type": "string", - "enum": [ - "Dorso Ventral", "Longitudinal", "Medio Lateral", "Unknown" - ] - }, - - "sensing_modality": { - "description": "Type of Sensor used", - "type": "string", - "enum": [ - "Piezoelectric Film", "Forceplate", "Accelerometer", "Piezoelectric crystal", "Unknown" - ] - }, - - "measurement_system": { - "description": "System Type", - "type": "string", - "enum": [ - "Starr", "Nickerson", "Dock", "Other", "Unknown" - ] - } - }, - "required": [ - "sensor_placement" - ] - } + "allOf": [ + {"$ref": "#/definitions/sensor_device_header"}, + { + "sensor_configuration": { + "type": "object", + "properties": { + + "sensor_placement": { + "description": "Sensor Placements", + "type": "string", + "enum": [ + "Unknown", "Chest", "Back", "Mattress", "Chair", "Feet", "Wrist", "Arm", "Desk", "Clothing", "Custom" + ] + }, + + "sensing_direction": { + "description": "Axis along which BCG is measured", + "type": "string", + "enum": [ + "Dorso Ventral", "Longitudinal", "Medio Lateral", "Unknown" + ] + }, + + "sensing_modality": { + "description": "Type of Sensor used", + "type": "string", + "enum": [ + "Piezoelectric Film", "Forceplate", "Accelerometer", "Piezoelectric crystal", "Unknown" + ] + }, + + "measurement_system": { + "description": "System Type", + "type": "string", + "enum": [ + "Starr", "Nickerson", "Dock", "Other", "Unknown" + ] } - } - ] - }, - "body": { - "type": "array", - "items": { - "$ref": "#/definitions/bcg_body" + }, + "required": [ + "sensor_placement" + ] } } - }, - - "required": [ - "header", - "body" ] } diff --git a/schema/ros4hc/ecg-info-1.x.json b/schema/ros4hc/ecg-info-1.x.json index 487772c7..c17b9c58 100644 --- a/schema/ros4hc/ecg-info-1.x.json +++ b/schema/ros4hc/ecg-info-1.x.json @@ -6,75 +6,50 @@ "description": "This schema represents a ecg data series, i.e., an array of measures that share the same header.", "definitions": { - "device-info": { - "$ref": "device-info-1.x.json" - }, - "default-header": { - "$ref": "ord-default-header-1.x.json" - }, - "filter": { - "$ref": "healthcare-filterbase-1.x.json" - }, - "lead_location_enum": { - "$ref": "lead-location-1.x.json" - }, - "ecg_body":{ - "$ref": "ecg-1.x.json" + "sensor_device_header": { + "$ref": "sensor-device-header-1.x.json" } }, - "properties": { - "header": { - "description": "The header of the data point.", - "type":"object", - "allOf": [ - {"$ref": "#/definitions/default-header"}, - {"$ref": "#/definitions/device-info"}, - {"$ref": "#/definitions/filter"}, - - { + "allOf": [ + {"$ref": "#/definitions/sensor_device_header"}, + { + "type": "object", + "properties": { + "electrode_configuration": { "type": "object", "properties": { - "electrode_configuration": { - "type": "object", - "properties": { - - "electrode_placement": { - "description": "Support multiple electrode placements", - "type": "array", - "items": { - "type": "string", - "enum": [ - "Unknown", "Placement Limb", "Wrist Ankle", "Chest", "Torso", "Abdomen", "Back", "Ear", "Neck", "Left Arm", "Right Arm", "Left Leg", "Right Leg", "Custom" - ] - } - }, - "lead_type": { - "$ref": "#/definitions/lead_location_enum" - } - }, - - "required": [ - "electrode_placement" + "electrode_placement": { + "description": "Support multiple electrode placements", + "type": "array", + "items": { + "type": "string", + "enum": [ + "Unknown", "Placement Limb", "Wrist Ankle", "Chest", "Torso", "Abdomen", "Back", "Ear", "Neck", "Left Arm", "Right Arm", "Left Leg", "Right Leg", "Custom" + ] + } + }, + + "lead_type": { + "description": "Standard ECG lead names according to clinical conventions (12-lead and extended leads).", + "url": "https://en.wikipedia.org/wiki/Electrocardiography#12-lead_ECG", + "type": "string", + "enum": [ + "I", "II", "III", + "aVR", "aVL", "aVF", + "V1", "V2", "V3", "V4", "V5", "V6", + "Unknown", "Custom" ] } - } - } - ] - }, + }, - "body": { - "type": "array", - "items": { - "$ref": "#/definitions/ecg_body" + "required": [ + "electrode_placement" + ] + } } } - }, - - "required": [ - "header", - "body" ] } diff --git a/schema/ros4hc/eda-info-1.x.json b/schema/ros4hc/eda-info-1.x.json index ee966b1e..425aad5d 100644 --- a/schema/ros4hc/eda-info-1.x.json +++ b/schema/ros4hc/eda-info-1.x.json @@ -6,82 +6,53 @@ "description": "This schema represents a eda data series, i.e., an array of measures that share the same header.", "definitions": { - "device-info": { - "$ref": "device-info-1.x.json" - }, - "default-header": { - "$ref": "ord-default-header-1.x.json" - }, - "filter": { - "$ref": "healthcare-filterbase-1.x.json" - }, - "eda_body": { - "$ref": "eda-1.x.json" + "sensor_device_header": { + "$ref": "sensor-device-header-1.x.json" } }, - "properties": { - "header": { - "description": "The header of the data point.", - "type":"object", - "allOf": [ - {"$ref": "#/definitions/default-header"}, - {"$ref": "#/definitions/device-info"}, - {"$ref": "#/definitions/filter"}, - - { + "allOf": [ + {"$ref": "#/definitions/sensor_device_header"}, + { + "type": "object", + "properties": { + "electrode_configuration": { "type": "object", "properties": { - "electrode_configuration": { - "type": "object", - "properties": { - "electrode_placement": { - "description": "Support multiple electrode placements", - "type": "array", - "items": { - "type": "string", - "enum": [ - "Unknown", "Palm", "Fingertip", "Wrist", "Forearm", "Sole", "Shoulder", "Custom" - ] - } - }, - - "electrode_type": { - "type": "string", - "enum": ["Unknown", "Surface", "Intracutaneous", "Custom"] - }, - - "measuring_technique": { - "type": "string", - "enum": ["Unknown", "Endosomatic", "Exosomatic", "Custom"] - }, - - "current_form": { - "type": "string", - "enum": ["Unknown", "DC", "AC"] - } - }, - - "required": [ - "electrode_placement" - ] + "electrode_placement": { + "description": "Support multiple electrode placements", + "type": "array", + "items": { + "type": "string", + "enum": [ + "Unknown", "Palm", "Fingertip", "Wrist", "Forearm", "Sole", "Shoulder", "Custom" + ] + } + }, + + "electrode_type": { + "type": "string", + "enum": ["Unknown", "Surface", "Intracutaneous", "Custom"] + }, + + "measuring_technique": { + "type": "string", + "enum": ["Unknown", "Endosomatic", "Exosomatic", "Custom"] + }, + + "current_form": { + "type": "string", + "enum": ["Unknown", "DC", "AC"] } - } - } - ] - }, + }, - "body": { - "type": "array", - "items": { - "$ref": "#/definitions/eda_body" + "required": [ + "electrode_placement" + ] + } } } - }, - - "required": [ - "header", - "body" ] + } diff --git a/schema/ros4hc/eeg-info-1.x.json b/schema/ros4hc/eeg-info-1.x.json index 31c29ffe..125c8d9e 100644 --- a/schema/ros4hc/eeg-info-1.x.json +++ b/schema/ros4hc/eeg-info-1.x.json @@ -6,83 +6,54 @@ "description": "This schema represents a eeg data series, i.e., an array of measures that share the same header.", "definitions": { - "device-info": { - "$ref": "device-info-1.x.json" - }, - "default-header": { - "$ref": "ord-default-header-1.x.json" - }, - "filter": { - "$ref": "healthcare-filterbase-1.x.json" - }, - "eeg_body": { - "$ref": "eeg-1.x.json" + "sensor_device_header": { + "$ref": "sensor-device-header-1.x.json" } }, - "properties": { - "header": { - "description": "The header of the data point.", - "type":"object", - "allOf": [ - {"$ref": "#/definitions/default-header"}, - {"$ref": "#/definitions/device-info"}, - {"$ref": "#/definitions/filter"}, + "allOf": [ + {"$ref": "#/definitions/sensor_device_header"}, - { + { + "type": "object", + "properties": { + "electrode_configuration": { "type": "object", "properties": { - "electrode_configuration": { - "type": "object", - "properties": { - "electrode_placement": { - "description": "Support multiple electrode placements", - "type": "array", - "items": { - "type": "string", - "enum": [ - "Unknown", "Method 1020", "Method 1010", "Method 105", "Custom" - ] - } - }, - - "electrode_site": { - "type": "string", - "enum": ["Unknown", "FP1", "FP2", "F3", "F4", "C3", "C4", "P3", "P4", "O1", "O2", "F7", "F8", "T3", "T4", "T5", "T6", "FZ", "CZ", "PZ", "OZ", "Custom"] - }, - - "electrode_physical_type": { - "type": "string", - "enum": ["Unknown", "AgCl", "Gold Cup", "Dry", "Wet", "Hydrogel", "Microneedle", "Custom"] - }, - - "signal_mode": { - "type": "string", - "enum": ["Unknown", "Surface", "Intracranial", "Custom"] - } - }, - - "required": [ - "electrode_placement" - ] + "electrode_placement": { + "description": "Support multiple electrode placements", + "type": "array", + "items": { + "type": "string", + "enum": [ + "Unknown", "Method 1020", "Method 1010", "Method 105", "Custom" + ] + } + }, + + "electrode_site": { + "type": "string", + "enum": ["Unknown", "FP1", "FP2", "F3", "F4", "C3", "C4", "P3", "P4", "O1", "O2", "F7", "F8", "T3", "T4", "T5", "T6", "FZ", "CZ", "PZ", "OZ", "Custom"] + }, + + "electrode_physical_type": { + "type": "string", + "enum": ["Unknown", "AgCl", "Gold Cup", "Dry", "Wet", "Hydrogel", "Microneedle", "Custom"] + }, + + "signal_mode": { + "type": "string", + "enum": ["Unknown", "Surface", "Intracranial", "Custom"] } - } - } - ] - }, + }, - "body": { - "type": "array", - "items": { - "$ref": "#/definitions/eeg_body" + "required": [ + "electrode_placement" + ] + } } } - }, - - "required": [ - "header", - "body" ] } diff --git a/schema/ros4hc/emg-info-1.x.json b/schema/ros4hc/emg-info-1.x.json index 991fe4b3..157a92f5 100644 --- a/schema/ros4hc/emg-info-1.x.json +++ b/schema/ros4hc/emg-info-1.x.json @@ -6,81 +6,52 @@ "description": "This schema represents a emg data series, i.e., an array of measures that share the same header.", "definitions": { - "device-info": { - "$ref": "device-info-1.x.json" - }, - "default-header": { - "$ref": "ord-default-header-1.x.json" - }, - "filter": { - "$ref": "healthcare-filterbase-1.x.json" - }, - "emg_body": { - "$ref": "emg-1.x.json" + "sensor_device_header": { + "$ref": "sensor-device-header-1.x.json" } }, - "properties": { - "header": { - "description": "The header of the data point.", - "type":"object", - "allOf": [ - {"$ref": "#/definitions/default-header"}, - {"$ref": "#/definitions/device-info"}, - {"$ref": "#/definitions/filter"}, + "allOf": [ + {"$ref": "#/definitions/sensor_device_header"}, - { + { + "type": "object", + "properties": { + "electrode_configuration": { "type": "object", "properties": { - "electrode_configuration": { - "type": "object", - "properties": { - "electrode_placement": { - "description": "Support multiple electrode placements", - "type": "array", - "items": { - "type": "string", - "enum": ["Unknown", "Biceps", "Triceps", "Forearm", "Calf", "Back", "Abdomen", "Quadriceps", "Hamstring", "Face", "Neck", "Custom"] - } - }, - - "electrode_type": { - "type": "string", - "enum": ["Unknown", "Surface", "Needle", "Wire", "Interferential", "Custom"] - }, - - "external_device": { - "type": "string", - "enum": ["Unknown", "TENS", "FES", "EMG Trigger", "Custom"] - }, - - "signal_mode": { - "type": "string", - "enum": ["Unknown", "Surface", "Intramuscular", "Custom"] - } - }, - - "required": [ - "electrode_placement" - ] + "electrode_placement": { + "description": "Support multiple electrode placements", + "type": "array", + "items": { + "type": "string", + "enum": ["Unknown", "Biceps", "Triceps", "Forearm", "Calf", "Back", "Abdomen", "Quadriceps", "Hamstring", "Face", "Neck", "Custom"] + } + }, + + "electrode_type": { + "type": "string", + "enum": ["Unknown", "Surface", "Needle", "Wire", "Interferential", "Custom"] + }, + + "external_device": { + "type": "string", + "enum": ["Unknown", "TENS", "FES", "EMG Trigger", "Custom"] + }, + + "signal_mode": { + "type": "string", + "enum": ["Unknown", "Surface", "Intramuscular", "Custom"] } - } - } - ] - }, + }, - "body": { - "type": "array", - "items": { - "$ref": "#/definitions/emg_body" + "required": [ + "electrode_placement" + ] + } } } - }, - - "required": [ - "header", - "body" ] } diff --git a/schema/ros4hc/eog-info-1.x.json b/schema/ros4hc/eog-info-1.x.json index 82a42fa8..e4e7ec49 100644 --- a/schema/ros4hc/eog-info-1.x.json +++ b/schema/ros4hc/eog-info-1.x.json @@ -6,17 +6,8 @@ "description": "This schema represents a eog data series, i.e., an array of measures that share the same header.", "definitions": { - "device-info": { - "$ref": "device-info-1.x.json" - }, - "default-header": { - "$ref": "ord-default-header-1.x.json" - }, - "filter": { - "$ref": "healthcare-filterbase-1.x.json" - }, - "eog_body": { - "$ref": "eog-1.x.json" + "sensor_device_header": { + "$ref": "sensor-device-header-1.x.json" }, "unit_value": { "$ref": "unit-value-1.0.json" @@ -24,97 +15,77 @@ }, - "properties": { - "header": { - "description": "The header of the data point.", - "type":"object", - "allOf": [ - {"$ref": "#/definitions/default-header"}, - {"$ref": "#/definitions/device-info"}, - {"$ref": "#/definitions/filter"}, + "allOf": [ + {"$ref": "#/definitions/sensor_device_header"}, - { + { + "type": "object", + "properties": { + "electrode_configuration": { "type": "object", "properties": { - "electrode_configuration": { - "type": "object", - "properties": { - "electrode_placement": { - "description": "Support multiple electrode placements", - "type": "array", - "items": { - "type": "string", - "enum": ["Unknown", "Left Eye", "Right Eye", "Forehead", "Temple Left", "Temple Right", "Above Eye", "Below Eye", "Custom"] - } - }, + "electrode_placement": { + "description": "Support multiple electrode placements", + "type": "array", + "items": { + "type": "string", + "enum": ["Unknown", "Left Eye", "Right Eye", "Forehead", "Temple Left", "Temple Right", "Above Eye", "Below Eye", "Custom"] + } + }, - "lead_type": { - "type": "string", - "enum": ["Unknown", "Bipolar Horizontal", "Bipolar Vertical", "Unipolar", "Corneal Retinal", "Custom"] - }, + "lead_type": { + "type": "string", + "enum": ["Unknown", "Bipolar Horizontal", "Bipolar Vertical", "Unipolar", "Corneal Retinal", "Custom"] + }, - "signal_mode": { - "type": "string", - "enum": ["Unknown", "Surface", "Bipolar", "Unipolar", "Corneal Retinal", "Intracular", "Derived", "Custom"] - } - }, - "required": [ - "electrode_placement" - ] + "signal_mode": { + "type": "string", + "enum": ["Unknown", "Surface", "Bipolar", "Unipolar", "Corneal Retinal", "Intracular", "Derived", "Custom"] + } + }, + "required": [ + "electrode_placement" + ] + }, + "lightning_condition":{ + "type": "object", + "properties": { + "lightsource": { + "type": "string", + "enum": ["Unknown", "Tungsten", "Halogen", "LED", "Fluorescent", "Sunlight", "Custom"] }, - "lightning_condition":{ - "type": "object", - "properties": { - "lightsource": { - "type": "string", - "enum": ["Unknown", "Tungsten", "Halogen", "LED", "Fluorescent", "Sunlight", "Custom"] - }, - "gazefield": { - "allOf": [ - { - "$ref": "#/definitions/unit_value" - }, - { - "type": "object", - "properties": { - "unit": { - "enum": [ - "cd/m^2" - ] - } - } - } - ] + "gazefield": { + "allOf": [ + { + "$ref": "#/definitions/unit_value" }, - - "light_dark_phase" : { - "type": "array", - "items": { - "type": "number" + { + "type": "object", + "properties": { + "unit": { + "enum": [ + "cd/m^2" + ] + } } } - }, - "required": [ - "lightsource" ] + }, + + "light_dark_phase" : { + "type": "array", + "items": { + "type": "number" + } } - } + }, + "required": [ + "lightsource" + ] } - ] - }, - - "body": { - "type": "array", - "items": { - "$ref": "#/definitions/eog_body" } } - }, - - "required": [ - "header", - "body" ] } diff --git a/schema/ros4hc/icg-info-1.x.json b/schema/ros4hc/icg-info-1.x.json index 87942fe1..24ba152a 100644 --- a/schema/ros4hc/icg-info-1.x.json +++ b/schema/ros4hc/icg-info-1.x.json @@ -6,79 +6,47 @@ "description": "This schema represents a icg data series, i.e., an array of measures that share the same header.", "definitions": { - "device-info": { - "$ref": "device-info-1.x.json" - }, - "default-header": { - "$ref": "ord-default-header-1.x.json" - }, - "filter": { - "$ref": "healthcare-filterbase-1.x.json" - }, - "icg_body": { - "$ref": "icg-1.x.json" - }, - "unit_value": { - "$ref": "unit-value-1.0.json" + "sensor_device_header": { + "$ref": "sensor-device-header-1.x.json" } }, - "properties": { - "header": { - "description": "The header of the data point.", - "type":"object", - "allOf": [ - {"$ref": "#/definitions/default-header"}, - {"$ref": "#/definitions/device-info"}, - {"$ref": "#/definitions/filter"}, + "allOf": [ + {"$ref": "#/definitions/sensor_device_header"}, - { + { + "type": "object", + "properties": { + "electrode_configuration": { "type": "object", "properties": { - "electrode_configuration": { - "type": "object", - "properties": { - "electrode_placement": { - "description": "Support multiple electrode placements", - "type": "array", - "items": { - "type": "string", - "enum": ["Unknown", "Chest", "Back", "Left Arm", "Right Arm", "Left Leg", "Right Leg", "Neck", "Abdomen", "Custom"] - } - }, - - "lead_type": { - "type": "string", - "enum": ["Unknown", "Transthoracic", "Four Electrode", "Six Electrode", "Spot", "Custom"] - }, - - "technique": { - "type": "string", - "enum": ["Unknown", "Tetrapolar", "Octapolar", "Custom"] - } - }, - - "required": [ - "electrode_placement" - ] + "electrode_placement": { + "description": "Support multiple electrode placements", + "type": "array", + "items": { + "type": "string", + "enum": ["Unknown", "Chest", "Back", "Left Arm", "Right Arm", "Left Leg", "Right Leg", "Neck", "Abdomen", "Custom"] + } + }, + + "lead_type": { + "type": "string", + "enum": ["Unknown", "Transthoracic", "Four Electrode", "Six Electrode", "Spot", "Custom"] + }, + + "technique": { + "type": "string", + "enum": ["Unknown", "Tetrapolar", "Octapolar", "Custom"] } - } - } - ] - }, + }, - "body": { - "type": "array", - "items": { - "$ref": "#/definitions/icg_body" + "required": [ + "electrode_placement" + ] + } } } - }, - - "required": [ - "header", - "body" ] } diff --git a/schema/ros4hc/lead-location-1.x.json b/schema/ros4hc/lead-location-1.x.json deleted file mode 100644 index 5cf37ccc..00000000 --- a/schema/ros4hc/lead-location-1.x.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - - "description": "This schema represents a standard ECG lead location.", - "type": "string", - - "references": [ - { - "description": "Standard ECG lead names according to clinical conventions (12-lead and extended leads).", - "url": "https://en.wikipedia.org/wiki/Electrocardiography#12-lead_ECG" - } - ], - - "enum": [ - "I", "II", "III", - "aVR", "aVL", "aVF", - "V1", "V2", "V3", "V4", "V5", "V6", - "Unknown", "Custom" - ] -} diff --git a/schema/ros4hc/metadata/device-info-1.x.json b/schema/ros4hc/metadata/device-info-1.x.json deleted file mode 100644 index 7d0a704c..00000000 --- a/schema/ros4hc/metadata/device-info-1.x.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://w3id.org/ieee/ros4hc-schema/operating_environment.json", - "title": "Operating environment of an device Metadata", - "description": "This schema represents the metadata of an device and its operating environment", - "type": "object", - "definitions": { - "device_identity": { - "$ref": "device-identity-1.x.json" - }, - "operating_environment": { - "$ref": "operating-environment-1.x.json" - }, - "measurement_specification": { - "$ref": "measurement-specification-1.x.json" - } - }, - "properties": { - "device_identity": { - "$ref": "#/definitions/device_identity" - }, - "operating_environment":{ - "$ref": "#/definitions/operating_environment" - }, - "measurement_specification": { - "$ref": "#/definitions/measurement_specification" - }, - "session_id": { - "type": "string" - }, - "data_size": { - "type": "object", - "properties": { - "window_size_samples": { - "type": "number" - }, - "quality_window_size_samples": { - "type": "number" - } - }, - "required": ["window_size_samples"] - } - }, - "required": [ - "session_id", - "data_size" - ] -} diff --git a/schema/ros4hc/metadata/sensor-device-header-1.x.json b/schema/ros4hc/metadata/sensor-device-header-1.x.json index dcbbfd56..83b07b70 100644 --- a/schema/ros4hc/metadata/sensor-device-header-1.x.json +++ b/schema/ros4hc/metadata/sensor-device-header-1.x.json @@ -5,17 +5,59 @@ "title": "Sensor Device Metadata", "definitions": { - "device-info": { - "$ref": "device-info-1.x.json" - }, "default-header": { "$ref": "ord-default-header-1.x.json" + }, + "filter": { + "$ref": "healthcare-filterbase-1.x.json" + }, + "device_identity": { + "$ref": "device-identity-1.x.json" + }, + "operating_environment": { + "$ref": "operating-environment-1.x.json" + }, + "measurement_specification": { + "$ref": "measurement-specification-1.x.json" } }, "allOf": [ {"$ref": "#/definitions/default-header"}, - {"$ref": "#/definitions/device-info"} + { + "type": "object", + "properties": { + "device_identity": { + "$ref": "#/definitions/device_identity" + }, + "operating_environment":{ + "$ref": "#/definitions/operating_environment" + }, + "measurement_specification": { + "$ref": "#/definitions/measurement_specification" + }, + "session_id": { + "type": "string" + }, + "data_size": { + "type": "object", + "properties": { + "window_size_samples": { + "type": "number" + }, + "quality_window_size_samples": { + "type": "number" + } + }, + "required": ["window_size_samples"] + } + }, + "required": [ + "session_id", + "data_size" + ] + }, + {"$ref": "#/definitions/filter"} ], "required": [ diff --git a/schema/ros4hc/ppg-info-1.x.json b/schema/ros4hc/ppg-info-1.x.json index f1dcaaac..c964088d 100644 --- a/schema/ros4hc/ppg-info-1.x.json +++ b/schema/ros4hc/ppg-info-1.x.json @@ -6,91 +6,59 @@ "description": "This schema represents a ppg data series, i.e., an array of measures that share the same header.", "definitions": { - "device-info": { - "$ref": "device-info-1.x.json" - }, - "default-header": { - "$ref": "ord-default-header-1.x.json" - }, - "filter": { - "$ref": "healthcare-filterbase-1.x.json" - }, - "ppg_body": { - "$ref": "ppg-1.x.json" - }, - "unit_value": { - "$ref": "unit-value-1.0.json" + "sensor_device_header": { + "$ref": "sensor-device-header-1.x.json" } }, - "properties": { - "header": { - "description": "The header of the data point.", - "type":"object", - "allOf": [ - {"$ref": "#/definitions/default-header"}, - {"$ref": "#/definitions/device-info"}, - {"$ref": "#/definitions/filter"}, + "allOf": [ + {"$ref": "#/definitions/sensor_device_header"}, - { + { + "type": "object", + "properties": { + "sensor_configuration": { "type": "object", "properties": { - "sensor_configuration": { - "type": "object", - "properties": { - "sensor_placement": { - "type": "string", - "enum": ["Unknown", "Finger", "Wrist", "Earlobe", "Forehead", "Toe", "Arm", "Chest", "Ankle", "Nose", "Palm", "Sole", "Custom"] - }, + "sensor_placement": { + "type": "string", + "enum": ["Unknown", "Finger", "Wrist", "Earlobe", "Forehead", "Toe", "Arm", "Chest", "Ankle", "Nose", "Palm", "Sole", "Custom"] + }, - "measuring_mode": { - "type": "string", - "enum": ["Unknown", "Transmissive Absorption", "Reflective", "Custom"] - } - }, + "measuring_mode": { + "type": "string", + "enum": ["Unknown", "Transmissive Absorption", "Reflective", "Custom"] + } + }, - "required": [ - "sensor_placement" - ] - }, + "required": [ + "sensor_placement" + ] + }, - "waveform_configuration":{ - "type": "object", - "properties": { - "wavelengths_mm": { - "description": "Nanometer value for each channel, may be [660, 880, 940]", - "type": "array", - "items": { - "type": "integer" - } - }, - "wavelengths_labels": { - "description": "Wavelength Label for each channel (optional)", - "type": "string", - "enum": ["Unknown", "Green", "Red", "IR", "Blue", "Yellow", "Custom"] - } - }, - "required": [ - "wavelengths_mm" - ] + "waveform_configuration":{ + "type": "object", + "properties": { + "wavelengths_mm": { + "description": "Nanometer value for each channel, may be [660, 880, 940]", + "type": "array", + "items": { + "type": "integer" + } + }, + "wavelengths_labels": { + "description": "Wavelength Label for each channel (optional)", + "type": "string", + "enum": ["Unknown", "Green", "Red", "IR", "Blue", "Yellow", "Custom"] } - } + }, + "required": [ + "wavelengths_mm" + ] } - ] - }, - - "body": { - "type": "array", - "items": { - "$ref": "#/definitions/ppg_body" } } - }, - - "required": [ - "header", - "body" ] } From 361ae749b7f09c1a53e10fe74cd20f4a58916a93 Mon Sep 17 00:00:00 2001 From: Elisa Du <79795653+Alizzie@users.noreply.github.com> Date: Sat, 25 Oct 2025 16:57:36 +0200 Subject: [PATCH 07/15] attempt to build python package --- .../__init__.py | 0 ord_schemas/schema/__init__.py | 25 ++++++++ .../schema}/granola/hk-blood-type-1.0.json | 0 .../schema}/granola/hk-blood-type-1.x.json | 0 .../granola/hk-category-sample-1.0.json | 0 .../granola/hk-category-sample-1.x.json | 0 .../schema}/granola/hk-category-type-1.0.json | 0 .../schema}/granola/hk-category-type-1.1.json | 0 .../schema}/granola/hk-category-type-1.x.json | 0 .../schema}/granola/hk-correlation-1.0.json | 0 .../schema}/granola/hk-correlation-1.x.json | 0 .../granola/hk-correlation-type-1.0.json | 0 .../granola/hk-correlation-type-1.x.json | 0 .../schema}/granola/hk-metadata-1.0.json | 0 .../schema}/granola/hk-metadata-1.x.json | 0 .../granola/hk-quantity-sample-1.0.json | 0 .../granola/hk-quantity-sample-1.x.json | 0 .../schema}/granola/hk-quantity-type-1.0.json | 0 .../schema}/granola/hk-quantity-type-1.1.json | 0 .../schema}/granola/hk-quantity-type-1.x.json | 0 .../schema}/granola/hk-workout-1.0.json | 0 .../schema}/granola/hk-workout-1.x.json | 0 .../schema}/omh/acceleration-1.0.json | 0 .../schema}/omh/acceleration-1.x.json | 0 .../schema}/omh/acceleration-2.0.json | 0 .../schema}/omh/acceleration-2.x.json | 0 .../omh/acceleration-unit-value-1.0.json | 0 .../omh/acceleration-unit-value-1.1.json | 0 .../omh/acceleration-unit-value-1.x.json | 0 .../schema}/omh/activity-name-1.0.json | 0 .../schema}/omh/activity-name-1.x.json | 0 .../schema}/omh/ambient-temperature-1.0.json | 0 .../schema}/omh/ambient-temperature-1.x.json | 0 .../omh/angular-velocity-unit-value-1.0.json | 0 .../omh/angular-velocity-unit-value-1.1.json | 0 .../omh/angular-velocity-unit-value-1.x.json | 0 .../schema}/omh/area-unit-value-1.0.json | 0 .../schema}/omh/area-unit-value-1.1.json | 0 .../schema}/omh/area-unit-value-1.x.json | 0 .../schema}/omh/blood-glucose-1.0.json | 0 .../schema}/omh/blood-glucose-1.x.json | 0 .../schema}/omh/blood-glucose-2.0.json | 0 .../schema}/omh/blood-glucose-2.x.json | 0 .../schema}/omh/blood-glucose-3.0.json | 0 .../schema}/omh/blood-glucose-3.x.json | 0 .../schema}/omh/blood-glucose-4.0.json | 0 .../schema}/omh/blood-glucose-4.x.json | 0 .../schema}/omh/blood-pressure-1.0.json | 0 .../schema}/omh/blood-pressure-1.x.json | 0 .../schema}/omh/blood-pressure-2.0.json | 0 .../schema}/omh/blood-pressure-2.x.json | 0 .../schema}/omh/blood-pressure-3.0.json | 0 .../schema}/omh/blood-pressure-3.1.json | 0 .../schema}/omh/blood-pressure-3.x.json | 0 .../schema}/omh/blood-pressure-4.0.json | 0 .../schema}/omh/blood-pressure-4.x.json | 0 .../schema}/omh/blood-specimen-type-1.0.json | 0 .../schema}/omh/blood-specimen-type-1.x.json | 0 .../schema}/omh/body-fat-percentage-1.0.json | 0 .../schema}/omh/body-fat-percentage-1.x.json | 0 .../schema}/omh/body-fat-percentage-2.0.json | 0 .../schema}/omh/body-fat-percentage-2.x.json | 0 .../schema}/omh/body-height-1.0.json | 0 .../schema}/omh/body-height-1.x.json | 0 .../schema}/omh/body-height-2.0.json | 0 .../schema}/omh/body-height-2.x.json | 0 .../schema}/omh/body-location-1.0.json | 0 .../schema}/omh/body-location-1.1.json | 0 .../schema}/omh/body-location-1.x.json | 0 .../schema}/omh/body-mass-index-1.0.json | 0 .../schema}/omh/body-mass-index-1.x.json | 0 .../schema}/omh/body-mass-index-2.0.json | 0 .../schema}/omh/body-mass-index-2.x.json | 0 .../schema}/omh/body-mass-index-3.0.json | 0 .../schema}/omh/body-mass-index-3.x.json | 0 .../schema}/omh/body-posture-1.0.json | 0 .../schema}/omh/body-posture-1.x.json | 0 .../schema}/omh/body-temperature-1.0.json | 0 .../schema}/omh/body-temperature-1.x.json | 0 .../schema}/omh/body-temperature-2.0.json | 0 .../schema}/omh/body-temperature-2.x.json | 0 .../schema}/omh/body-temperature-3.0.json | 0 .../schema}/omh/body-temperature-3.x.json | 0 .../schema}/omh/body-temperature-4.0.json | 0 .../schema}/omh/body-temperature-4.x.json | 0 .../schema}/omh/body-weight-1.0.json | 0 .../schema}/omh/body-weight-1.x.json | 0 .../schema}/omh/body-weight-2.0.json | 0 .../schema}/omh/body-weight-2.x.json | 0 .../schema}/omh/body-weight-3.0.json | 0 .../schema}/omh/body-weight-3.x.json | 0 .../omh/breath-carbon-monoxide-1.0.json | 0 .../omh/breath-carbon-monoxide-1.x.json | 0 .../schema}/omh/calories-burned-1.0.json | 0 .../schema}/omh/calories-burned-1.x.json | 0 .../schema}/omh/calories-burned-2.0.json | 0 .../schema}/omh/calories-burned-2.x.json | 0 .../schema}/omh/data-point-1.0.json | 0 .../schema}/omh/data-point-1.x.json | 0 .../schema}/omh/date-time-1.0.json | 0 .../schema}/omh/date-time-1.x.json | 0 .../schema}/omh/day-of-week-1.0.json | 0 .../schema}/omh/day-of-week-1.x.json | 0 .../omh/descriptive-statistic-1.0.json | 0 .../omh/descriptive-statistic-1.1.json | 0 .../omh/descriptive-statistic-1.2.json | 0 .../omh/descriptive-statistic-1.x.json | 0 ...descriptive-statistic-denominator-1.0.json | 0 ...descriptive-statistic-denominator-1.1.json | 0 ...descriptive-statistic-denominator-1.x.json | 0 .../omh/diastolic-blood-pressure-1.0.json | 0 .../omh/diastolic-blood-pressure-1.1.json | 0 .../omh/diastolic-blood-pressure-1.x.json | 0 .../schema}/omh/duration-unit-value-1.0.json | 0 .../schema}/omh/duration-unit-value-1.x.json | 0 .../omh/duration-unit-value-range-1.0.json | 0 .../omh/duration-unit-value-range-1.x.json | 0 .../schema}/omh/expiratory-time-1.0.json | 0 .../schema}/omh/expiratory-time-1.x.json | 0 .../schema}/omh/frequency-unit-value-1.0.json | 0 .../schema}/omh/frequency-unit-value-1.x.json | 0 .../schema}/omh/full-date-1.0.json | 0 .../schema}/omh/full-date-1.x.json | 0 .../schema}/omh/geoposition-1.0.json | 0 .../schema}/omh/geoposition-1.x.json | 0 .../schema}/omh/header-1.0.json | 0 .../schema}/omh/header-1.1.json | 0 .../schema}/omh/header-1.2.json | 0 .../schema}/omh/header-1.x.json | 0 .../schema}/omh/heart-rate-1.0.json | 0 .../schema}/omh/heart-rate-1.1.json | 0 .../schema}/omh/heart-rate-1.x.json | 0 .../schema}/omh/heart-rate-2.0.json | 0 .../schema}/omh/heart-rate-2.x.json | 0 .../schema}/omh/inspiratory-time-1.0.json | 0 .../schema}/omh/inspiratory-time-1.x.json | 0 ...intervention-administration-route-1.0.json | 0 ...intervention-administration-route-1.x.json | 0 ...intervention-administration-route-2.0.json | 0 ...intervention-administration-route-2.x.json | 0 .../schema}/omh/kcal-unit-value-1.0.json | 0 .../schema}/omh/kcal-unit-value-1.x.json | 0 .../schema}/omh/length-unit-value-1.0.json | 0 .../schema}/omh/length-unit-value-1.x.json | 0 .../schema}/omh/local-time-1.0.json | 0 .../schema}/omh/local-time-1.x.json | 0 .../magnetic-flux-density-unit-value-1.0.json | 0 .../magnetic-flux-density-unit-value-1.1.json | 0 .../magnetic-flux-density-unit-value-1.x.json | 0 .../schema}/omh/magnetic-force-1.0.json | 0 .../schema}/omh/magnetic-force-1.x.json | 0 .../schema}/omh/mass-unit-value-1.0.json | 0 .../schema}/omh/mass-unit-value-1.1.json | 0 .../schema}/omh/mass-unit-value-1.x.json | 0 .../schema}/omh/medication-1.0.json | 0 .../schema}/omh/medication-1.x.json | 0 .../omh/medication-adherence-percent-1.0.json | 0 .../omh/medication-adherence-percent-1.x.json | 0 .../omh/medication-adherence-percent-2.0.json | 0 .../omh/medication-adherence-percent-2.x.json | 0 .../schema}/omh/medication-dose-unit-1.0.json | 0 .../schema}/omh/medication-dose-unit-1.x.json | 0 .../omh/medication-dose-unit-value-1.0.json | 0 .../omh/medication-dose-unit-value-1.1.json | 0 .../omh/medication-dose-unit-value-1.x.json | 0 .../medication-dose-unit-value-range-1.0.json | 0 .../medication-dose-unit-value-range-1.1.json | 0 .../medication-dose-unit-value-range-1.x.json | 0 .../omh/medication-prescription-1.0.json | 0 .../omh/medication-prescription-1.x.json | 0 .../omh/medication-prescription-2.0.json | 0 .../omh/medication-prescription-2.x.json | 0 .../schema}/omh/minute-volume-1.0.json | 0 .../schema}/omh/minute-volume-1.x.json | 0 .../omh/minutes-moderate-activity-1.0.json | 0 .../omh/minutes-moderate-activity-1.x.json | 0 .../schema}/omh/orientation-1.0.json | 0 .../schema}/omh/orientation-1.x.json | 0 .../schema}/omh/oxygen-saturation-1.0.json | 0 .../schema}/omh/oxygen-saturation-1.x.json | 0 .../schema}/omh/oxygen-saturation-2.0.json | 0 .../schema}/omh/oxygen-saturation-2.x.json | 0 .../schema}/omh/pace-1.0.json | 0 .../schema}/omh/pace-1.x.json | 0 .../schema}/omh/pace-unit-value-1.0.json | 0 .../schema}/omh/pace-unit-value-1.1.json | 0 .../schema}/omh/pace-unit-value-1.x.json | 0 .../schema}/omh/part-of-day-1.0.json | 0 .../schema}/omh/part-of-day-1.x.json | 0 .../omh/patient-medication-schedule-1.0.json | 0 .../omh/patient-medication-schedule-1.x.json | 0 .../omh/patient-medication-schedule-2.0.json | 0 .../omh/patient-medication-schedule-2.x.json | 0 .../pharmacy-medication-dispensing-1.0.json | 0 .../pharmacy-medication-dispensing-1.x.json | 0 .../pharmacy-medication-dispensing-2.0.json | 0 .../pharmacy-medication-dispensing-2.x.json | 0 .../schema}/omh/physical-activity-1.0.json | 0 .../schema}/omh/physical-activity-1.1.json | 0 .../schema}/omh/physical-activity-1.2.json | 0 .../schema}/omh/physical-activity-1.x.json | 0 .../omh/plane-angle-unit-value-1.0.json | 0 .../omh/plane-angle-unit-value-1.1.json | 0 .../omh/plane-angle-unit-value-1.x.json | 0 .../omh/position-during-measurement-1.0.json | 0 .../omh/position-during-measurement-1.x.json | 0 ...-single-medication-dose-not-taken-1.0.json | 0 ...-single-medication-dose-not-taken-1.x.json | 0 .../schema}/omh/respiratory-rate-1.0.json | 0 .../schema}/omh/respiratory-rate-1.x.json | 0 .../schema}/omh/respiratory-rate-2.0.json | 0 .../schema}/omh/respiratory-rate-2.x.json | 0 .../schema}/omh/rr-interval-1.0.json | 0 .../schema}/omh/rr-interval-1.x.json | 0 .../schema}/omh/schema-id-1.0.json | 0 .../schema}/omh/schema-id-1.1.json | 0 .../schema}/omh/schema-id-1.x.json | 0 .../omh/single-medication-dose-taken-1.0.json | 0 .../omh/single-medication-dose-taken-1.x.json | 0 .../schema}/omh/sleep-duration-1.0.json | 0 .../schema}/omh/sleep-duration-1.x.json | 0 .../schema}/omh/sleep-duration-2.0.json | 0 .../schema}/omh/sleep-duration-2.x.json | 0 .../schema}/omh/sleep-episode-1.0.json | 0 .../schema}/omh/sleep-episode-1.1.json | 0 .../schema}/omh/sleep-episode-1.x.json | 0 .../schema}/omh/specimen-source-1.0.json | 0 .../schema}/omh/specimen-source-1.x.json | 0 .../schema}/omh/specimen-source-2.0.json | 0 .../schema}/omh/specimen-source-2.1.json | 0 .../schema}/omh/specimen-source-2.x.json | 0 .../schema}/omh/speed-1.0.json | 0 .../schema}/omh/speed-1.x.json | 0 .../schema}/omh/speed-unit-value-1.0.json | 0 .../schema}/omh/speed-unit-value-1.x.json | 0 .../schema}/omh/step-count-1.0.json | 0 .../schema}/omh/step-count-1.x.json | 0 .../schema}/omh/step-count-2.0.json | 0 .../schema}/omh/step-count-2.x.json | 0 .../schema}/omh/step-count-3.0.json | 0 .../schema}/omh/step-count-3.x.json | 0 .../omh/systolic-blood-pressure-1.0.json | 0 .../omh/systolic-blood-pressure-1.1.json | 0 .../omh/systolic-blood-pressure-1.x.json | 0 .../omh/temperature-unit-value-1.0.json | 0 .../omh/temperature-unit-value-1.x.json | 0 .../temporal-relationship-to-meal-1.0.json | 0 .../temporal-relationship-to-meal-1.1.json | 0 .../temporal-relationship-to-meal-1.2.json | 0 .../temporal-relationship-to-meal-1.x.json | 0 ...relationship-to-physical-activity-1.0.json | 0 ...relationship-to-physical-activity-1.x.json | 0 .../temporal-relationship-to-sleep-1.0.json | 0 .../temporal-relationship-to-sleep-1.x.json | 0 .../schema}/omh/time-frame-1.0.json | 0 .../schema}/omh/time-frame-1.x.json | 0 .../schema}/omh/time-interval-1.0.json | 0 .../schema}/omh/time-interval-1.x.json | 0 .../schema}/omh/total-sleep-time-1.0.json | 0 .../schema}/omh/total-sleep-time-1.x.json | 0 .../schema}/omh/unit-value-1.0.json | 0 .../schema}/omh/unit-value-1.x.json | 0 .../schema}/omh/unit-value-range-1.0.json | 0 .../schema}/omh/unit-value-range-1.x.json | 0 .../omh/ventilation-cycle-time-1.0.json | 0 .../omh/ventilation-cycle-time-1.x.json | 0 .../schema}/omh/volume-unit-value-1.0.json | 0 .../schema}/omh/volume-unit-value-1.1.json | 0 .../schema}/omh/volume-unit-value-1.x.json | 0 .../schema}/ros4hc/Notes.txt | 0 .../schema}/ros4hc/bcg-1.x.json | 0 ord_schemas/schema/ros4hc/bcg-info-1.x.json | 62 +++++++++++++++++++ .../schema}/ros4hc/ecg-1.x.json | 0 .../schema}/ros4hc/ecg-info-1.x.json | 0 .../schema}/ros4hc/eda-1.x.json | 0 .../schema}/ros4hc/eda-info-1.x.json | 0 .../schema}/ros4hc/eeg-1.x.json | 0 .../schema}/ros4hc/eeg-info-1.x.json | 0 .../schema}/ros4hc/emg-1.x.json | 0 .../schema}/ros4hc/emg-info-1.x.json | 0 .../schema}/ros4hc/eog-1.x.json | 0 .../schema}/ros4hc/eog-info-1.x.json | 0 .../ros4hc/healthcare-filterbase-1.x.json | 0 .../schema}/ros4hc/icg-1.x.json | 0 .../schema}/ros4hc/icg-info-1.x.json | 0 .../ros4hc/metadata/device-identity-1.x.json | 0 .../measurement-specification-1.x.json | 0 .../metadata/operating-environment-1.x.json | 0 .../metadata/ord-default-header-1.x.json | 0 .../metadata/sensor-device-header-1.x.json | 0 .../ros4hc/min-max-unit-value-1.x.json | 0 .../schema}/ros4hc/ppg-1.x.json | 0 .../schema}/ros4hc/ppg-info-1.x.json | 0 pyproject.toml | 18 ++++++ schema/ros4hc/bcg-info-1.x.json | 59 ------------------ 295 files changed, 105 insertions(+), 59 deletions(-) rename schema/ros4hc/healthcare-filterbase-1.x.json => ord_schemas/__init__.py (100%) create mode 100644 ord_schemas/schema/__init__.py rename {schema => ord_schemas/schema}/granola/hk-blood-type-1.0.json (100%) rename {schema => ord_schemas/schema}/granola/hk-blood-type-1.x.json (100%) rename {schema => ord_schemas/schema}/granola/hk-category-sample-1.0.json (100%) rename {schema => ord_schemas/schema}/granola/hk-category-sample-1.x.json (100%) rename {schema => ord_schemas/schema}/granola/hk-category-type-1.0.json (100%) rename {schema => ord_schemas/schema}/granola/hk-category-type-1.1.json (100%) rename {schema => ord_schemas/schema}/granola/hk-category-type-1.x.json (100%) rename {schema => ord_schemas/schema}/granola/hk-correlation-1.0.json (100%) rename {schema => ord_schemas/schema}/granola/hk-correlation-1.x.json (100%) rename {schema => ord_schemas/schema}/granola/hk-correlation-type-1.0.json (100%) rename {schema => ord_schemas/schema}/granola/hk-correlation-type-1.x.json (100%) rename {schema => ord_schemas/schema}/granola/hk-metadata-1.0.json (100%) rename {schema => ord_schemas/schema}/granola/hk-metadata-1.x.json (100%) rename {schema => ord_schemas/schema}/granola/hk-quantity-sample-1.0.json (100%) rename {schema => ord_schemas/schema}/granola/hk-quantity-sample-1.x.json (100%) rename {schema => ord_schemas/schema}/granola/hk-quantity-type-1.0.json (100%) rename {schema => ord_schemas/schema}/granola/hk-quantity-type-1.1.json (100%) rename {schema => ord_schemas/schema}/granola/hk-quantity-type-1.x.json (100%) rename {schema => ord_schemas/schema}/granola/hk-workout-1.0.json (100%) rename {schema => ord_schemas/schema}/granola/hk-workout-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/acceleration-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/acceleration-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/acceleration-2.0.json (100%) rename {schema => ord_schemas/schema}/omh/acceleration-2.x.json (100%) rename {schema => ord_schemas/schema}/omh/acceleration-unit-value-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/acceleration-unit-value-1.1.json (100%) rename {schema => ord_schemas/schema}/omh/acceleration-unit-value-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/activity-name-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/activity-name-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/ambient-temperature-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/ambient-temperature-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/angular-velocity-unit-value-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/angular-velocity-unit-value-1.1.json (100%) rename {schema => ord_schemas/schema}/omh/angular-velocity-unit-value-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/area-unit-value-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/area-unit-value-1.1.json (100%) rename {schema => ord_schemas/schema}/omh/area-unit-value-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/blood-glucose-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/blood-glucose-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/blood-glucose-2.0.json (100%) rename {schema => ord_schemas/schema}/omh/blood-glucose-2.x.json (100%) rename {schema => ord_schemas/schema}/omh/blood-glucose-3.0.json (100%) rename {schema => ord_schemas/schema}/omh/blood-glucose-3.x.json (100%) rename {schema => ord_schemas/schema}/omh/blood-glucose-4.0.json (100%) rename {schema => ord_schemas/schema}/omh/blood-glucose-4.x.json (100%) rename {schema => ord_schemas/schema}/omh/blood-pressure-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/blood-pressure-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/blood-pressure-2.0.json (100%) rename {schema => ord_schemas/schema}/omh/blood-pressure-2.x.json (100%) rename {schema => ord_schemas/schema}/omh/blood-pressure-3.0.json (100%) rename {schema => ord_schemas/schema}/omh/blood-pressure-3.1.json (100%) rename {schema => ord_schemas/schema}/omh/blood-pressure-3.x.json (100%) rename {schema => ord_schemas/schema}/omh/blood-pressure-4.0.json (100%) rename {schema => ord_schemas/schema}/omh/blood-pressure-4.x.json (100%) rename {schema => ord_schemas/schema}/omh/blood-specimen-type-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/blood-specimen-type-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/body-fat-percentage-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/body-fat-percentage-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/body-fat-percentage-2.0.json (100%) rename {schema => ord_schemas/schema}/omh/body-fat-percentage-2.x.json (100%) rename {schema => ord_schemas/schema}/omh/body-height-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/body-height-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/body-height-2.0.json (100%) rename {schema => ord_schemas/schema}/omh/body-height-2.x.json (100%) rename {schema => ord_schemas/schema}/omh/body-location-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/body-location-1.1.json (100%) rename {schema => ord_schemas/schema}/omh/body-location-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/body-mass-index-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/body-mass-index-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/body-mass-index-2.0.json (100%) rename {schema => ord_schemas/schema}/omh/body-mass-index-2.x.json (100%) rename {schema => ord_schemas/schema}/omh/body-mass-index-3.0.json (100%) rename {schema => ord_schemas/schema}/omh/body-mass-index-3.x.json (100%) rename {schema => ord_schemas/schema}/omh/body-posture-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/body-posture-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/body-temperature-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/body-temperature-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/body-temperature-2.0.json (100%) rename {schema => ord_schemas/schema}/omh/body-temperature-2.x.json (100%) rename {schema => ord_schemas/schema}/omh/body-temperature-3.0.json (100%) rename {schema => ord_schemas/schema}/omh/body-temperature-3.x.json (100%) rename {schema => ord_schemas/schema}/omh/body-temperature-4.0.json (100%) rename {schema => ord_schemas/schema}/omh/body-temperature-4.x.json (100%) rename {schema => ord_schemas/schema}/omh/body-weight-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/body-weight-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/body-weight-2.0.json (100%) rename {schema => ord_schemas/schema}/omh/body-weight-2.x.json (100%) rename {schema => ord_schemas/schema}/omh/body-weight-3.0.json (100%) rename {schema => ord_schemas/schema}/omh/body-weight-3.x.json (100%) rename {schema => ord_schemas/schema}/omh/breath-carbon-monoxide-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/breath-carbon-monoxide-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/calories-burned-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/calories-burned-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/calories-burned-2.0.json (100%) rename {schema => ord_schemas/schema}/omh/calories-burned-2.x.json (100%) rename {schema => ord_schemas/schema}/omh/data-point-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/data-point-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/date-time-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/date-time-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/day-of-week-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/day-of-week-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/descriptive-statistic-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/descriptive-statistic-1.1.json (100%) rename {schema => ord_schemas/schema}/omh/descriptive-statistic-1.2.json (100%) rename {schema => ord_schemas/schema}/omh/descriptive-statistic-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/descriptive-statistic-denominator-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/descriptive-statistic-denominator-1.1.json (100%) rename {schema => ord_schemas/schema}/omh/descriptive-statistic-denominator-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/diastolic-blood-pressure-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/diastolic-blood-pressure-1.1.json (100%) rename {schema => ord_schemas/schema}/omh/diastolic-blood-pressure-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/duration-unit-value-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/duration-unit-value-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/duration-unit-value-range-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/duration-unit-value-range-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/expiratory-time-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/expiratory-time-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/frequency-unit-value-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/frequency-unit-value-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/full-date-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/full-date-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/geoposition-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/geoposition-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/header-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/header-1.1.json (100%) rename {schema => ord_schemas/schema}/omh/header-1.2.json (100%) rename {schema => ord_schemas/schema}/omh/header-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/heart-rate-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/heart-rate-1.1.json (100%) rename {schema => ord_schemas/schema}/omh/heart-rate-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/heart-rate-2.0.json (100%) rename {schema => ord_schemas/schema}/omh/heart-rate-2.x.json (100%) rename {schema => ord_schemas/schema}/omh/inspiratory-time-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/inspiratory-time-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/intervention-administration-route-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/intervention-administration-route-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/intervention-administration-route-2.0.json (100%) rename {schema => ord_schemas/schema}/omh/intervention-administration-route-2.x.json (100%) rename {schema => ord_schemas/schema}/omh/kcal-unit-value-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/kcal-unit-value-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/length-unit-value-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/length-unit-value-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/local-time-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/local-time-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/magnetic-flux-density-unit-value-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/magnetic-flux-density-unit-value-1.1.json (100%) rename {schema => ord_schemas/schema}/omh/magnetic-flux-density-unit-value-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/magnetic-force-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/magnetic-force-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/mass-unit-value-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/mass-unit-value-1.1.json (100%) rename {schema => ord_schemas/schema}/omh/mass-unit-value-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/medication-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/medication-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/medication-adherence-percent-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/medication-adherence-percent-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/medication-adherence-percent-2.0.json (100%) rename {schema => ord_schemas/schema}/omh/medication-adherence-percent-2.x.json (100%) rename {schema => ord_schemas/schema}/omh/medication-dose-unit-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/medication-dose-unit-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/medication-dose-unit-value-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/medication-dose-unit-value-1.1.json (100%) rename {schema => ord_schemas/schema}/omh/medication-dose-unit-value-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/medication-dose-unit-value-range-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/medication-dose-unit-value-range-1.1.json (100%) rename {schema => ord_schemas/schema}/omh/medication-dose-unit-value-range-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/medication-prescription-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/medication-prescription-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/medication-prescription-2.0.json (100%) rename {schema => ord_schemas/schema}/omh/medication-prescription-2.x.json (100%) rename {schema => ord_schemas/schema}/omh/minute-volume-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/minute-volume-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/minutes-moderate-activity-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/minutes-moderate-activity-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/orientation-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/orientation-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/oxygen-saturation-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/oxygen-saturation-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/oxygen-saturation-2.0.json (100%) rename {schema => ord_schemas/schema}/omh/oxygen-saturation-2.x.json (100%) rename {schema => ord_schemas/schema}/omh/pace-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/pace-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/pace-unit-value-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/pace-unit-value-1.1.json (100%) rename {schema => ord_schemas/schema}/omh/pace-unit-value-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/part-of-day-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/part-of-day-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/patient-medication-schedule-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/patient-medication-schedule-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/patient-medication-schedule-2.0.json (100%) rename {schema => ord_schemas/schema}/omh/patient-medication-schedule-2.x.json (100%) rename {schema => ord_schemas/schema}/omh/pharmacy-medication-dispensing-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/pharmacy-medication-dispensing-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/pharmacy-medication-dispensing-2.0.json (100%) rename {schema => ord_schemas/schema}/omh/pharmacy-medication-dispensing-2.x.json (100%) rename {schema => ord_schemas/schema}/omh/physical-activity-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/physical-activity-1.1.json (100%) rename {schema => ord_schemas/schema}/omh/physical-activity-1.2.json (100%) rename {schema => ord_schemas/schema}/omh/physical-activity-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/plane-angle-unit-value-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/plane-angle-unit-value-1.1.json (100%) rename {schema => ord_schemas/schema}/omh/plane-angle-unit-value-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/position-during-measurement-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/position-during-measurement-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/reason-single-medication-dose-not-taken-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/reason-single-medication-dose-not-taken-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/respiratory-rate-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/respiratory-rate-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/respiratory-rate-2.0.json (100%) rename {schema => ord_schemas/schema}/omh/respiratory-rate-2.x.json (100%) rename {schema => ord_schemas/schema}/omh/rr-interval-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/rr-interval-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/schema-id-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/schema-id-1.1.json (100%) rename {schema => ord_schemas/schema}/omh/schema-id-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/single-medication-dose-taken-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/single-medication-dose-taken-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/sleep-duration-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/sleep-duration-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/sleep-duration-2.0.json (100%) rename {schema => ord_schemas/schema}/omh/sleep-duration-2.x.json (100%) rename {schema => ord_schemas/schema}/omh/sleep-episode-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/sleep-episode-1.1.json (100%) rename {schema => ord_schemas/schema}/omh/sleep-episode-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/specimen-source-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/specimen-source-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/specimen-source-2.0.json (100%) rename {schema => ord_schemas/schema}/omh/specimen-source-2.1.json (100%) rename {schema => ord_schemas/schema}/omh/specimen-source-2.x.json (100%) rename {schema => ord_schemas/schema}/omh/speed-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/speed-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/speed-unit-value-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/speed-unit-value-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/step-count-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/step-count-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/step-count-2.0.json (100%) rename {schema => ord_schemas/schema}/omh/step-count-2.x.json (100%) rename {schema => ord_schemas/schema}/omh/step-count-3.0.json (100%) rename {schema => ord_schemas/schema}/omh/step-count-3.x.json (100%) rename {schema => ord_schemas/schema}/omh/systolic-blood-pressure-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/systolic-blood-pressure-1.1.json (100%) rename {schema => ord_schemas/schema}/omh/systolic-blood-pressure-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/temperature-unit-value-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/temperature-unit-value-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/temporal-relationship-to-meal-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/temporal-relationship-to-meal-1.1.json (100%) rename {schema => ord_schemas/schema}/omh/temporal-relationship-to-meal-1.2.json (100%) rename {schema => ord_schemas/schema}/omh/temporal-relationship-to-meal-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/temporal-relationship-to-physical-activity-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/temporal-relationship-to-physical-activity-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/temporal-relationship-to-sleep-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/temporal-relationship-to-sleep-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/time-frame-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/time-frame-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/time-interval-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/time-interval-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/total-sleep-time-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/total-sleep-time-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/unit-value-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/unit-value-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/unit-value-range-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/unit-value-range-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/ventilation-cycle-time-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/ventilation-cycle-time-1.x.json (100%) rename {schema => ord_schemas/schema}/omh/volume-unit-value-1.0.json (100%) rename {schema => ord_schemas/schema}/omh/volume-unit-value-1.1.json (100%) rename {schema => ord_schemas/schema}/omh/volume-unit-value-1.x.json (100%) rename {schema => ord_schemas/schema}/ros4hc/Notes.txt (100%) rename {schema => ord_schemas/schema}/ros4hc/bcg-1.x.json (100%) create mode 100644 ord_schemas/schema/ros4hc/bcg-info-1.x.json rename {schema => ord_schemas/schema}/ros4hc/ecg-1.x.json (100%) rename {schema => ord_schemas/schema}/ros4hc/ecg-info-1.x.json (100%) rename {schema => ord_schemas/schema}/ros4hc/eda-1.x.json (100%) rename {schema => ord_schemas/schema}/ros4hc/eda-info-1.x.json (100%) rename {schema => ord_schemas/schema}/ros4hc/eeg-1.x.json (100%) rename {schema => ord_schemas/schema}/ros4hc/eeg-info-1.x.json (100%) rename {schema => ord_schemas/schema}/ros4hc/emg-1.x.json (100%) rename {schema => ord_schemas/schema}/ros4hc/emg-info-1.x.json (100%) rename {schema => ord_schemas/schema}/ros4hc/eog-1.x.json (100%) rename {schema => ord_schemas/schema}/ros4hc/eog-info-1.x.json (100%) create mode 100644 ord_schemas/schema/ros4hc/healthcare-filterbase-1.x.json rename {schema => ord_schemas/schema}/ros4hc/icg-1.x.json (100%) rename {schema => ord_schemas/schema}/ros4hc/icg-info-1.x.json (100%) rename {schema => ord_schemas/schema}/ros4hc/metadata/device-identity-1.x.json (100%) rename {schema => ord_schemas/schema}/ros4hc/metadata/measurement-specification-1.x.json (100%) rename {schema => ord_schemas/schema}/ros4hc/metadata/operating-environment-1.x.json (100%) rename {schema => ord_schemas/schema}/ros4hc/metadata/ord-default-header-1.x.json (100%) rename {schema => ord_schemas/schema}/ros4hc/metadata/sensor-device-header-1.x.json (100%) rename {schema => ord_schemas/schema}/ros4hc/min-max-unit-value-1.x.json (100%) rename {schema => ord_schemas/schema}/ros4hc/ppg-1.x.json (100%) rename {schema => ord_schemas/schema}/ros4hc/ppg-info-1.x.json (100%) create mode 100644 pyproject.toml delete mode 100644 schema/ros4hc/bcg-info-1.x.json diff --git a/schema/ros4hc/healthcare-filterbase-1.x.json b/ord_schemas/__init__.py similarity index 100% rename from schema/ros4hc/healthcare-filterbase-1.x.json rename to ord_schemas/__init__.py diff --git a/ord_schemas/schema/__init__.py b/ord_schemas/schema/__init__.py new file mode 100644 index 00000000..0aad429b --- /dev/null +++ b/ord_schemas/schema/__init__.py @@ -0,0 +1,25 @@ +import json +import importlib.resources as pkg_resources + +PACKAGE_NAME = __package__ + +def list_domains(): + """Return top-level schema domains (subfolders in schema/).""" + with pkg_resources.files(PACKAGE_NAME) as package_dir: + return [p.name for p in package_dir.iterdir() if p.is_dir()] + +def list_schemas(domain=None): + """List JSON schema files, optionally filtered by domain.""" + schemas = [] + with pkg_resources.files(PACKAGE_NAME) as package_dir: + for path in package_dir.rglob("*.json"): + relative_path = path.relative_to(package_dir) + if domain is None or relative_path.parts[0] == domain: + schemas.append(str(relative_path)) + return schemas + +def load_schema(domain, schema_name): + """Load a JSON schema by domain and name.""" + schema_file = f"{domain}/{schema_name}.json" + with pkg_resources.files(PACKAGE_NAME).joinpath(schema_file).open("r") as f: + return json.load(f) diff --git a/schema/granola/hk-blood-type-1.0.json b/ord_schemas/schema/granola/hk-blood-type-1.0.json similarity index 100% rename from schema/granola/hk-blood-type-1.0.json rename to ord_schemas/schema/granola/hk-blood-type-1.0.json diff --git a/schema/granola/hk-blood-type-1.x.json b/ord_schemas/schema/granola/hk-blood-type-1.x.json similarity index 100% rename from schema/granola/hk-blood-type-1.x.json rename to ord_schemas/schema/granola/hk-blood-type-1.x.json diff --git a/schema/granola/hk-category-sample-1.0.json b/ord_schemas/schema/granola/hk-category-sample-1.0.json similarity index 100% rename from schema/granola/hk-category-sample-1.0.json rename to ord_schemas/schema/granola/hk-category-sample-1.0.json diff --git a/schema/granola/hk-category-sample-1.x.json b/ord_schemas/schema/granola/hk-category-sample-1.x.json similarity index 100% rename from schema/granola/hk-category-sample-1.x.json rename to ord_schemas/schema/granola/hk-category-sample-1.x.json diff --git a/schema/granola/hk-category-type-1.0.json b/ord_schemas/schema/granola/hk-category-type-1.0.json similarity index 100% rename from schema/granola/hk-category-type-1.0.json rename to ord_schemas/schema/granola/hk-category-type-1.0.json diff --git a/schema/granola/hk-category-type-1.1.json b/ord_schemas/schema/granola/hk-category-type-1.1.json similarity index 100% rename from schema/granola/hk-category-type-1.1.json rename to ord_schemas/schema/granola/hk-category-type-1.1.json diff --git a/schema/granola/hk-category-type-1.x.json b/ord_schemas/schema/granola/hk-category-type-1.x.json similarity index 100% rename from schema/granola/hk-category-type-1.x.json rename to ord_schemas/schema/granola/hk-category-type-1.x.json diff --git a/schema/granola/hk-correlation-1.0.json b/ord_schemas/schema/granola/hk-correlation-1.0.json similarity index 100% rename from schema/granola/hk-correlation-1.0.json rename to ord_schemas/schema/granola/hk-correlation-1.0.json diff --git a/schema/granola/hk-correlation-1.x.json b/ord_schemas/schema/granola/hk-correlation-1.x.json similarity index 100% rename from schema/granola/hk-correlation-1.x.json rename to ord_schemas/schema/granola/hk-correlation-1.x.json diff --git a/schema/granola/hk-correlation-type-1.0.json b/ord_schemas/schema/granola/hk-correlation-type-1.0.json similarity index 100% rename from schema/granola/hk-correlation-type-1.0.json rename to ord_schemas/schema/granola/hk-correlation-type-1.0.json diff --git a/schema/granola/hk-correlation-type-1.x.json b/ord_schemas/schema/granola/hk-correlation-type-1.x.json similarity index 100% rename from schema/granola/hk-correlation-type-1.x.json rename to ord_schemas/schema/granola/hk-correlation-type-1.x.json diff --git a/schema/granola/hk-metadata-1.0.json b/ord_schemas/schema/granola/hk-metadata-1.0.json similarity index 100% rename from schema/granola/hk-metadata-1.0.json rename to ord_schemas/schema/granola/hk-metadata-1.0.json diff --git a/schema/granola/hk-metadata-1.x.json b/ord_schemas/schema/granola/hk-metadata-1.x.json similarity index 100% rename from schema/granola/hk-metadata-1.x.json rename to ord_schemas/schema/granola/hk-metadata-1.x.json diff --git a/schema/granola/hk-quantity-sample-1.0.json b/ord_schemas/schema/granola/hk-quantity-sample-1.0.json similarity index 100% rename from schema/granola/hk-quantity-sample-1.0.json rename to ord_schemas/schema/granola/hk-quantity-sample-1.0.json diff --git a/schema/granola/hk-quantity-sample-1.x.json b/ord_schemas/schema/granola/hk-quantity-sample-1.x.json similarity index 100% rename from schema/granola/hk-quantity-sample-1.x.json rename to ord_schemas/schema/granola/hk-quantity-sample-1.x.json diff --git a/schema/granola/hk-quantity-type-1.0.json b/ord_schemas/schema/granola/hk-quantity-type-1.0.json similarity index 100% rename from schema/granola/hk-quantity-type-1.0.json rename to ord_schemas/schema/granola/hk-quantity-type-1.0.json diff --git a/schema/granola/hk-quantity-type-1.1.json b/ord_schemas/schema/granola/hk-quantity-type-1.1.json similarity index 100% rename from schema/granola/hk-quantity-type-1.1.json rename to ord_schemas/schema/granola/hk-quantity-type-1.1.json diff --git a/schema/granola/hk-quantity-type-1.x.json b/ord_schemas/schema/granola/hk-quantity-type-1.x.json similarity index 100% rename from schema/granola/hk-quantity-type-1.x.json rename to ord_schemas/schema/granola/hk-quantity-type-1.x.json diff --git a/schema/granola/hk-workout-1.0.json b/ord_schemas/schema/granola/hk-workout-1.0.json similarity index 100% rename from schema/granola/hk-workout-1.0.json rename to ord_schemas/schema/granola/hk-workout-1.0.json diff --git a/schema/granola/hk-workout-1.x.json b/ord_schemas/schema/granola/hk-workout-1.x.json similarity index 100% rename from schema/granola/hk-workout-1.x.json rename to ord_schemas/schema/granola/hk-workout-1.x.json diff --git a/schema/omh/acceleration-1.0.json b/ord_schemas/schema/omh/acceleration-1.0.json similarity index 100% rename from schema/omh/acceleration-1.0.json rename to ord_schemas/schema/omh/acceleration-1.0.json diff --git a/schema/omh/acceleration-1.x.json b/ord_schemas/schema/omh/acceleration-1.x.json similarity index 100% rename from schema/omh/acceleration-1.x.json rename to ord_schemas/schema/omh/acceleration-1.x.json diff --git a/schema/omh/acceleration-2.0.json b/ord_schemas/schema/omh/acceleration-2.0.json similarity index 100% rename from schema/omh/acceleration-2.0.json rename to ord_schemas/schema/omh/acceleration-2.0.json diff --git a/schema/omh/acceleration-2.x.json b/ord_schemas/schema/omh/acceleration-2.x.json similarity index 100% rename from schema/omh/acceleration-2.x.json rename to ord_schemas/schema/omh/acceleration-2.x.json diff --git a/schema/omh/acceleration-unit-value-1.0.json b/ord_schemas/schema/omh/acceleration-unit-value-1.0.json similarity index 100% rename from schema/omh/acceleration-unit-value-1.0.json rename to ord_schemas/schema/omh/acceleration-unit-value-1.0.json diff --git a/schema/omh/acceleration-unit-value-1.1.json b/ord_schemas/schema/omh/acceleration-unit-value-1.1.json similarity index 100% rename from schema/omh/acceleration-unit-value-1.1.json rename to ord_schemas/schema/omh/acceleration-unit-value-1.1.json diff --git a/schema/omh/acceleration-unit-value-1.x.json b/ord_schemas/schema/omh/acceleration-unit-value-1.x.json similarity index 100% rename from schema/omh/acceleration-unit-value-1.x.json rename to ord_schemas/schema/omh/acceleration-unit-value-1.x.json diff --git a/schema/omh/activity-name-1.0.json b/ord_schemas/schema/omh/activity-name-1.0.json similarity index 100% rename from schema/omh/activity-name-1.0.json rename to ord_schemas/schema/omh/activity-name-1.0.json diff --git a/schema/omh/activity-name-1.x.json b/ord_schemas/schema/omh/activity-name-1.x.json similarity index 100% rename from schema/omh/activity-name-1.x.json rename to ord_schemas/schema/omh/activity-name-1.x.json diff --git a/schema/omh/ambient-temperature-1.0.json b/ord_schemas/schema/omh/ambient-temperature-1.0.json similarity index 100% rename from schema/omh/ambient-temperature-1.0.json rename to ord_schemas/schema/omh/ambient-temperature-1.0.json diff --git a/schema/omh/ambient-temperature-1.x.json b/ord_schemas/schema/omh/ambient-temperature-1.x.json similarity index 100% rename from schema/omh/ambient-temperature-1.x.json rename to ord_schemas/schema/omh/ambient-temperature-1.x.json diff --git a/schema/omh/angular-velocity-unit-value-1.0.json b/ord_schemas/schema/omh/angular-velocity-unit-value-1.0.json similarity index 100% rename from schema/omh/angular-velocity-unit-value-1.0.json rename to ord_schemas/schema/omh/angular-velocity-unit-value-1.0.json diff --git a/schema/omh/angular-velocity-unit-value-1.1.json b/ord_schemas/schema/omh/angular-velocity-unit-value-1.1.json similarity index 100% rename from schema/omh/angular-velocity-unit-value-1.1.json rename to ord_schemas/schema/omh/angular-velocity-unit-value-1.1.json diff --git a/schema/omh/angular-velocity-unit-value-1.x.json b/ord_schemas/schema/omh/angular-velocity-unit-value-1.x.json similarity index 100% rename from schema/omh/angular-velocity-unit-value-1.x.json rename to ord_schemas/schema/omh/angular-velocity-unit-value-1.x.json diff --git a/schema/omh/area-unit-value-1.0.json b/ord_schemas/schema/omh/area-unit-value-1.0.json similarity index 100% rename from schema/omh/area-unit-value-1.0.json rename to ord_schemas/schema/omh/area-unit-value-1.0.json diff --git a/schema/omh/area-unit-value-1.1.json b/ord_schemas/schema/omh/area-unit-value-1.1.json similarity index 100% rename from schema/omh/area-unit-value-1.1.json rename to ord_schemas/schema/omh/area-unit-value-1.1.json diff --git a/schema/omh/area-unit-value-1.x.json b/ord_schemas/schema/omh/area-unit-value-1.x.json similarity index 100% rename from schema/omh/area-unit-value-1.x.json rename to ord_schemas/schema/omh/area-unit-value-1.x.json diff --git a/schema/omh/blood-glucose-1.0.json b/ord_schemas/schema/omh/blood-glucose-1.0.json similarity index 100% rename from schema/omh/blood-glucose-1.0.json rename to ord_schemas/schema/omh/blood-glucose-1.0.json diff --git a/schema/omh/blood-glucose-1.x.json b/ord_schemas/schema/omh/blood-glucose-1.x.json similarity index 100% rename from schema/omh/blood-glucose-1.x.json rename to ord_schemas/schema/omh/blood-glucose-1.x.json diff --git a/schema/omh/blood-glucose-2.0.json b/ord_schemas/schema/omh/blood-glucose-2.0.json similarity index 100% rename from schema/omh/blood-glucose-2.0.json rename to ord_schemas/schema/omh/blood-glucose-2.0.json diff --git a/schema/omh/blood-glucose-2.x.json b/ord_schemas/schema/omh/blood-glucose-2.x.json similarity index 100% rename from schema/omh/blood-glucose-2.x.json rename to ord_schemas/schema/omh/blood-glucose-2.x.json diff --git a/schema/omh/blood-glucose-3.0.json b/ord_schemas/schema/omh/blood-glucose-3.0.json similarity index 100% rename from schema/omh/blood-glucose-3.0.json rename to ord_schemas/schema/omh/blood-glucose-3.0.json diff --git a/schema/omh/blood-glucose-3.x.json b/ord_schemas/schema/omh/blood-glucose-3.x.json similarity index 100% rename from schema/omh/blood-glucose-3.x.json rename to ord_schemas/schema/omh/blood-glucose-3.x.json diff --git a/schema/omh/blood-glucose-4.0.json b/ord_schemas/schema/omh/blood-glucose-4.0.json similarity index 100% rename from schema/omh/blood-glucose-4.0.json rename to ord_schemas/schema/omh/blood-glucose-4.0.json diff --git a/schema/omh/blood-glucose-4.x.json b/ord_schemas/schema/omh/blood-glucose-4.x.json similarity index 100% rename from schema/omh/blood-glucose-4.x.json rename to ord_schemas/schema/omh/blood-glucose-4.x.json diff --git a/schema/omh/blood-pressure-1.0.json b/ord_schemas/schema/omh/blood-pressure-1.0.json similarity index 100% rename from schema/omh/blood-pressure-1.0.json rename to ord_schemas/schema/omh/blood-pressure-1.0.json diff --git a/schema/omh/blood-pressure-1.x.json b/ord_schemas/schema/omh/blood-pressure-1.x.json similarity index 100% rename from schema/omh/blood-pressure-1.x.json rename to ord_schemas/schema/omh/blood-pressure-1.x.json diff --git a/schema/omh/blood-pressure-2.0.json b/ord_schemas/schema/omh/blood-pressure-2.0.json similarity index 100% rename from schema/omh/blood-pressure-2.0.json rename to ord_schemas/schema/omh/blood-pressure-2.0.json diff --git a/schema/omh/blood-pressure-2.x.json b/ord_schemas/schema/omh/blood-pressure-2.x.json similarity index 100% rename from schema/omh/blood-pressure-2.x.json rename to ord_schemas/schema/omh/blood-pressure-2.x.json diff --git a/schema/omh/blood-pressure-3.0.json b/ord_schemas/schema/omh/blood-pressure-3.0.json similarity index 100% rename from schema/omh/blood-pressure-3.0.json rename to ord_schemas/schema/omh/blood-pressure-3.0.json diff --git a/schema/omh/blood-pressure-3.1.json b/ord_schemas/schema/omh/blood-pressure-3.1.json similarity index 100% rename from schema/omh/blood-pressure-3.1.json rename to ord_schemas/schema/omh/blood-pressure-3.1.json diff --git a/schema/omh/blood-pressure-3.x.json b/ord_schemas/schema/omh/blood-pressure-3.x.json similarity index 100% rename from schema/omh/blood-pressure-3.x.json rename to ord_schemas/schema/omh/blood-pressure-3.x.json diff --git a/schema/omh/blood-pressure-4.0.json b/ord_schemas/schema/omh/blood-pressure-4.0.json similarity index 100% rename from schema/omh/blood-pressure-4.0.json rename to ord_schemas/schema/omh/blood-pressure-4.0.json diff --git a/schema/omh/blood-pressure-4.x.json b/ord_schemas/schema/omh/blood-pressure-4.x.json similarity index 100% rename from schema/omh/blood-pressure-4.x.json rename to ord_schemas/schema/omh/blood-pressure-4.x.json diff --git a/schema/omh/blood-specimen-type-1.0.json b/ord_schemas/schema/omh/blood-specimen-type-1.0.json similarity index 100% rename from schema/omh/blood-specimen-type-1.0.json rename to ord_schemas/schema/omh/blood-specimen-type-1.0.json diff --git a/schema/omh/blood-specimen-type-1.x.json b/ord_schemas/schema/omh/blood-specimen-type-1.x.json similarity index 100% rename from schema/omh/blood-specimen-type-1.x.json rename to ord_schemas/schema/omh/blood-specimen-type-1.x.json diff --git a/schema/omh/body-fat-percentage-1.0.json b/ord_schemas/schema/omh/body-fat-percentage-1.0.json similarity index 100% rename from schema/omh/body-fat-percentage-1.0.json rename to ord_schemas/schema/omh/body-fat-percentage-1.0.json diff --git a/schema/omh/body-fat-percentage-1.x.json b/ord_schemas/schema/omh/body-fat-percentage-1.x.json similarity index 100% rename from schema/omh/body-fat-percentage-1.x.json rename to ord_schemas/schema/omh/body-fat-percentage-1.x.json diff --git a/schema/omh/body-fat-percentage-2.0.json b/ord_schemas/schema/omh/body-fat-percentage-2.0.json similarity index 100% rename from schema/omh/body-fat-percentage-2.0.json rename to ord_schemas/schema/omh/body-fat-percentage-2.0.json diff --git a/schema/omh/body-fat-percentage-2.x.json b/ord_schemas/schema/omh/body-fat-percentage-2.x.json similarity index 100% rename from schema/omh/body-fat-percentage-2.x.json rename to ord_schemas/schema/omh/body-fat-percentage-2.x.json diff --git a/schema/omh/body-height-1.0.json b/ord_schemas/schema/omh/body-height-1.0.json similarity index 100% rename from schema/omh/body-height-1.0.json rename to ord_schemas/schema/omh/body-height-1.0.json diff --git a/schema/omh/body-height-1.x.json b/ord_schemas/schema/omh/body-height-1.x.json similarity index 100% rename from schema/omh/body-height-1.x.json rename to ord_schemas/schema/omh/body-height-1.x.json diff --git a/schema/omh/body-height-2.0.json b/ord_schemas/schema/omh/body-height-2.0.json similarity index 100% rename from schema/omh/body-height-2.0.json rename to ord_schemas/schema/omh/body-height-2.0.json diff --git a/schema/omh/body-height-2.x.json b/ord_schemas/schema/omh/body-height-2.x.json similarity index 100% rename from schema/omh/body-height-2.x.json rename to ord_schemas/schema/omh/body-height-2.x.json diff --git a/schema/omh/body-location-1.0.json b/ord_schemas/schema/omh/body-location-1.0.json similarity index 100% rename from schema/omh/body-location-1.0.json rename to ord_schemas/schema/omh/body-location-1.0.json diff --git a/schema/omh/body-location-1.1.json b/ord_schemas/schema/omh/body-location-1.1.json similarity index 100% rename from schema/omh/body-location-1.1.json rename to ord_schemas/schema/omh/body-location-1.1.json diff --git a/schema/omh/body-location-1.x.json b/ord_schemas/schema/omh/body-location-1.x.json similarity index 100% rename from schema/omh/body-location-1.x.json rename to ord_schemas/schema/omh/body-location-1.x.json diff --git a/schema/omh/body-mass-index-1.0.json b/ord_schemas/schema/omh/body-mass-index-1.0.json similarity index 100% rename from schema/omh/body-mass-index-1.0.json rename to ord_schemas/schema/omh/body-mass-index-1.0.json diff --git a/schema/omh/body-mass-index-1.x.json b/ord_schemas/schema/omh/body-mass-index-1.x.json similarity index 100% rename from schema/omh/body-mass-index-1.x.json rename to ord_schemas/schema/omh/body-mass-index-1.x.json diff --git a/schema/omh/body-mass-index-2.0.json b/ord_schemas/schema/omh/body-mass-index-2.0.json similarity index 100% rename from schema/omh/body-mass-index-2.0.json rename to ord_schemas/schema/omh/body-mass-index-2.0.json diff --git a/schema/omh/body-mass-index-2.x.json b/ord_schemas/schema/omh/body-mass-index-2.x.json similarity index 100% rename from schema/omh/body-mass-index-2.x.json rename to ord_schemas/schema/omh/body-mass-index-2.x.json diff --git a/schema/omh/body-mass-index-3.0.json b/ord_schemas/schema/omh/body-mass-index-3.0.json similarity index 100% rename from schema/omh/body-mass-index-3.0.json rename to ord_schemas/schema/omh/body-mass-index-3.0.json diff --git a/schema/omh/body-mass-index-3.x.json b/ord_schemas/schema/omh/body-mass-index-3.x.json similarity index 100% rename from schema/omh/body-mass-index-3.x.json rename to ord_schemas/schema/omh/body-mass-index-3.x.json diff --git a/schema/omh/body-posture-1.0.json b/ord_schemas/schema/omh/body-posture-1.0.json similarity index 100% rename from schema/omh/body-posture-1.0.json rename to ord_schemas/schema/omh/body-posture-1.0.json diff --git a/schema/omh/body-posture-1.x.json b/ord_schemas/schema/omh/body-posture-1.x.json similarity index 100% rename from schema/omh/body-posture-1.x.json rename to ord_schemas/schema/omh/body-posture-1.x.json diff --git a/schema/omh/body-temperature-1.0.json b/ord_schemas/schema/omh/body-temperature-1.0.json similarity index 100% rename from schema/omh/body-temperature-1.0.json rename to ord_schemas/schema/omh/body-temperature-1.0.json diff --git a/schema/omh/body-temperature-1.x.json b/ord_schemas/schema/omh/body-temperature-1.x.json similarity index 100% rename from schema/omh/body-temperature-1.x.json rename to ord_schemas/schema/omh/body-temperature-1.x.json diff --git a/schema/omh/body-temperature-2.0.json b/ord_schemas/schema/omh/body-temperature-2.0.json similarity index 100% rename from schema/omh/body-temperature-2.0.json rename to ord_schemas/schema/omh/body-temperature-2.0.json diff --git a/schema/omh/body-temperature-2.x.json b/ord_schemas/schema/omh/body-temperature-2.x.json similarity index 100% rename from schema/omh/body-temperature-2.x.json rename to ord_schemas/schema/omh/body-temperature-2.x.json diff --git a/schema/omh/body-temperature-3.0.json b/ord_schemas/schema/omh/body-temperature-3.0.json similarity index 100% rename from schema/omh/body-temperature-3.0.json rename to ord_schemas/schema/omh/body-temperature-3.0.json diff --git a/schema/omh/body-temperature-3.x.json b/ord_schemas/schema/omh/body-temperature-3.x.json similarity index 100% rename from schema/omh/body-temperature-3.x.json rename to ord_schemas/schema/omh/body-temperature-3.x.json diff --git a/schema/omh/body-temperature-4.0.json b/ord_schemas/schema/omh/body-temperature-4.0.json similarity index 100% rename from schema/omh/body-temperature-4.0.json rename to ord_schemas/schema/omh/body-temperature-4.0.json diff --git a/schema/omh/body-temperature-4.x.json b/ord_schemas/schema/omh/body-temperature-4.x.json similarity index 100% rename from schema/omh/body-temperature-4.x.json rename to ord_schemas/schema/omh/body-temperature-4.x.json diff --git a/schema/omh/body-weight-1.0.json b/ord_schemas/schema/omh/body-weight-1.0.json similarity index 100% rename from schema/omh/body-weight-1.0.json rename to ord_schemas/schema/omh/body-weight-1.0.json diff --git a/schema/omh/body-weight-1.x.json b/ord_schemas/schema/omh/body-weight-1.x.json similarity index 100% rename from schema/omh/body-weight-1.x.json rename to ord_schemas/schema/omh/body-weight-1.x.json diff --git a/schema/omh/body-weight-2.0.json b/ord_schemas/schema/omh/body-weight-2.0.json similarity index 100% rename from schema/omh/body-weight-2.0.json rename to ord_schemas/schema/omh/body-weight-2.0.json diff --git a/schema/omh/body-weight-2.x.json b/ord_schemas/schema/omh/body-weight-2.x.json similarity index 100% rename from schema/omh/body-weight-2.x.json rename to ord_schemas/schema/omh/body-weight-2.x.json diff --git a/schema/omh/body-weight-3.0.json b/ord_schemas/schema/omh/body-weight-3.0.json similarity index 100% rename from schema/omh/body-weight-3.0.json rename to ord_schemas/schema/omh/body-weight-3.0.json diff --git a/schema/omh/body-weight-3.x.json b/ord_schemas/schema/omh/body-weight-3.x.json similarity index 100% rename from schema/omh/body-weight-3.x.json rename to ord_schemas/schema/omh/body-weight-3.x.json diff --git a/schema/omh/breath-carbon-monoxide-1.0.json b/ord_schemas/schema/omh/breath-carbon-monoxide-1.0.json similarity index 100% rename from schema/omh/breath-carbon-monoxide-1.0.json rename to ord_schemas/schema/omh/breath-carbon-monoxide-1.0.json diff --git a/schema/omh/breath-carbon-monoxide-1.x.json b/ord_schemas/schema/omh/breath-carbon-monoxide-1.x.json similarity index 100% rename from schema/omh/breath-carbon-monoxide-1.x.json rename to ord_schemas/schema/omh/breath-carbon-monoxide-1.x.json diff --git a/schema/omh/calories-burned-1.0.json b/ord_schemas/schema/omh/calories-burned-1.0.json similarity index 100% rename from schema/omh/calories-burned-1.0.json rename to ord_schemas/schema/omh/calories-burned-1.0.json diff --git a/schema/omh/calories-burned-1.x.json b/ord_schemas/schema/omh/calories-burned-1.x.json similarity index 100% rename from schema/omh/calories-burned-1.x.json rename to ord_schemas/schema/omh/calories-burned-1.x.json diff --git a/schema/omh/calories-burned-2.0.json b/ord_schemas/schema/omh/calories-burned-2.0.json similarity index 100% rename from schema/omh/calories-burned-2.0.json rename to ord_schemas/schema/omh/calories-burned-2.0.json diff --git a/schema/omh/calories-burned-2.x.json b/ord_schemas/schema/omh/calories-burned-2.x.json similarity index 100% rename from schema/omh/calories-burned-2.x.json rename to ord_schemas/schema/omh/calories-burned-2.x.json diff --git a/schema/omh/data-point-1.0.json b/ord_schemas/schema/omh/data-point-1.0.json similarity index 100% rename from schema/omh/data-point-1.0.json rename to ord_schemas/schema/omh/data-point-1.0.json diff --git a/schema/omh/data-point-1.x.json b/ord_schemas/schema/omh/data-point-1.x.json similarity index 100% rename from schema/omh/data-point-1.x.json rename to ord_schemas/schema/omh/data-point-1.x.json diff --git a/schema/omh/date-time-1.0.json b/ord_schemas/schema/omh/date-time-1.0.json similarity index 100% rename from schema/omh/date-time-1.0.json rename to ord_schemas/schema/omh/date-time-1.0.json diff --git a/schema/omh/date-time-1.x.json b/ord_schemas/schema/omh/date-time-1.x.json similarity index 100% rename from schema/omh/date-time-1.x.json rename to ord_schemas/schema/omh/date-time-1.x.json diff --git a/schema/omh/day-of-week-1.0.json b/ord_schemas/schema/omh/day-of-week-1.0.json similarity index 100% rename from schema/omh/day-of-week-1.0.json rename to ord_schemas/schema/omh/day-of-week-1.0.json diff --git a/schema/omh/day-of-week-1.x.json b/ord_schemas/schema/omh/day-of-week-1.x.json similarity index 100% rename from schema/omh/day-of-week-1.x.json rename to ord_schemas/schema/omh/day-of-week-1.x.json diff --git a/schema/omh/descriptive-statistic-1.0.json b/ord_schemas/schema/omh/descriptive-statistic-1.0.json similarity index 100% rename from schema/omh/descriptive-statistic-1.0.json rename to ord_schemas/schema/omh/descriptive-statistic-1.0.json diff --git a/schema/omh/descriptive-statistic-1.1.json b/ord_schemas/schema/omh/descriptive-statistic-1.1.json similarity index 100% rename from schema/omh/descriptive-statistic-1.1.json rename to ord_schemas/schema/omh/descriptive-statistic-1.1.json diff --git a/schema/omh/descriptive-statistic-1.2.json b/ord_schemas/schema/omh/descriptive-statistic-1.2.json similarity index 100% rename from schema/omh/descriptive-statistic-1.2.json rename to ord_schemas/schema/omh/descriptive-statistic-1.2.json diff --git a/schema/omh/descriptive-statistic-1.x.json b/ord_schemas/schema/omh/descriptive-statistic-1.x.json similarity index 100% rename from schema/omh/descriptive-statistic-1.x.json rename to ord_schemas/schema/omh/descriptive-statistic-1.x.json diff --git a/schema/omh/descriptive-statistic-denominator-1.0.json b/ord_schemas/schema/omh/descriptive-statistic-denominator-1.0.json similarity index 100% rename from schema/omh/descriptive-statistic-denominator-1.0.json rename to ord_schemas/schema/omh/descriptive-statistic-denominator-1.0.json diff --git a/schema/omh/descriptive-statistic-denominator-1.1.json b/ord_schemas/schema/omh/descriptive-statistic-denominator-1.1.json similarity index 100% rename from schema/omh/descriptive-statistic-denominator-1.1.json rename to ord_schemas/schema/omh/descriptive-statistic-denominator-1.1.json diff --git a/schema/omh/descriptive-statistic-denominator-1.x.json b/ord_schemas/schema/omh/descriptive-statistic-denominator-1.x.json similarity index 100% rename from schema/omh/descriptive-statistic-denominator-1.x.json rename to ord_schemas/schema/omh/descriptive-statistic-denominator-1.x.json diff --git a/schema/omh/diastolic-blood-pressure-1.0.json b/ord_schemas/schema/omh/diastolic-blood-pressure-1.0.json similarity index 100% rename from schema/omh/diastolic-blood-pressure-1.0.json rename to ord_schemas/schema/omh/diastolic-blood-pressure-1.0.json diff --git a/schema/omh/diastolic-blood-pressure-1.1.json b/ord_schemas/schema/omh/diastolic-blood-pressure-1.1.json similarity index 100% rename from schema/omh/diastolic-blood-pressure-1.1.json rename to ord_schemas/schema/omh/diastolic-blood-pressure-1.1.json diff --git a/schema/omh/diastolic-blood-pressure-1.x.json b/ord_schemas/schema/omh/diastolic-blood-pressure-1.x.json similarity index 100% rename from schema/omh/diastolic-blood-pressure-1.x.json rename to ord_schemas/schema/omh/diastolic-blood-pressure-1.x.json diff --git a/schema/omh/duration-unit-value-1.0.json b/ord_schemas/schema/omh/duration-unit-value-1.0.json similarity index 100% rename from schema/omh/duration-unit-value-1.0.json rename to ord_schemas/schema/omh/duration-unit-value-1.0.json diff --git a/schema/omh/duration-unit-value-1.x.json b/ord_schemas/schema/omh/duration-unit-value-1.x.json similarity index 100% rename from schema/omh/duration-unit-value-1.x.json rename to ord_schemas/schema/omh/duration-unit-value-1.x.json diff --git a/schema/omh/duration-unit-value-range-1.0.json b/ord_schemas/schema/omh/duration-unit-value-range-1.0.json similarity index 100% rename from schema/omh/duration-unit-value-range-1.0.json rename to ord_schemas/schema/omh/duration-unit-value-range-1.0.json diff --git a/schema/omh/duration-unit-value-range-1.x.json b/ord_schemas/schema/omh/duration-unit-value-range-1.x.json similarity index 100% rename from schema/omh/duration-unit-value-range-1.x.json rename to ord_schemas/schema/omh/duration-unit-value-range-1.x.json diff --git a/schema/omh/expiratory-time-1.0.json b/ord_schemas/schema/omh/expiratory-time-1.0.json similarity index 100% rename from schema/omh/expiratory-time-1.0.json rename to ord_schemas/schema/omh/expiratory-time-1.0.json diff --git a/schema/omh/expiratory-time-1.x.json b/ord_schemas/schema/omh/expiratory-time-1.x.json similarity index 100% rename from schema/omh/expiratory-time-1.x.json rename to ord_schemas/schema/omh/expiratory-time-1.x.json diff --git a/schema/omh/frequency-unit-value-1.0.json b/ord_schemas/schema/omh/frequency-unit-value-1.0.json similarity index 100% rename from schema/omh/frequency-unit-value-1.0.json rename to ord_schemas/schema/omh/frequency-unit-value-1.0.json diff --git a/schema/omh/frequency-unit-value-1.x.json b/ord_schemas/schema/omh/frequency-unit-value-1.x.json similarity index 100% rename from schema/omh/frequency-unit-value-1.x.json rename to ord_schemas/schema/omh/frequency-unit-value-1.x.json diff --git a/schema/omh/full-date-1.0.json b/ord_schemas/schema/omh/full-date-1.0.json similarity index 100% rename from schema/omh/full-date-1.0.json rename to ord_schemas/schema/omh/full-date-1.0.json diff --git a/schema/omh/full-date-1.x.json b/ord_schemas/schema/omh/full-date-1.x.json similarity index 100% rename from schema/omh/full-date-1.x.json rename to ord_schemas/schema/omh/full-date-1.x.json diff --git a/schema/omh/geoposition-1.0.json b/ord_schemas/schema/omh/geoposition-1.0.json similarity index 100% rename from schema/omh/geoposition-1.0.json rename to ord_schemas/schema/omh/geoposition-1.0.json diff --git a/schema/omh/geoposition-1.x.json b/ord_schemas/schema/omh/geoposition-1.x.json similarity index 100% rename from schema/omh/geoposition-1.x.json rename to ord_schemas/schema/omh/geoposition-1.x.json diff --git a/schema/omh/header-1.0.json b/ord_schemas/schema/omh/header-1.0.json similarity index 100% rename from schema/omh/header-1.0.json rename to ord_schemas/schema/omh/header-1.0.json diff --git a/schema/omh/header-1.1.json b/ord_schemas/schema/omh/header-1.1.json similarity index 100% rename from schema/omh/header-1.1.json rename to ord_schemas/schema/omh/header-1.1.json diff --git a/schema/omh/header-1.2.json b/ord_schemas/schema/omh/header-1.2.json similarity index 100% rename from schema/omh/header-1.2.json rename to ord_schemas/schema/omh/header-1.2.json diff --git a/schema/omh/header-1.x.json b/ord_schemas/schema/omh/header-1.x.json similarity index 100% rename from schema/omh/header-1.x.json rename to ord_schemas/schema/omh/header-1.x.json diff --git a/schema/omh/heart-rate-1.0.json b/ord_schemas/schema/omh/heart-rate-1.0.json similarity index 100% rename from schema/omh/heart-rate-1.0.json rename to ord_schemas/schema/omh/heart-rate-1.0.json diff --git a/schema/omh/heart-rate-1.1.json b/ord_schemas/schema/omh/heart-rate-1.1.json similarity index 100% rename from schema/omh/heart-rate-1.1.json rename to ord_schemas/schema/omh/heart-rate-1.1.json diff --git a/schema/omh/heart-rate-1.x.json b/ord_schemas/schema/omh/heart-rate-1.x.json similarity index 100% rename from schema/omh/heart-rate-1.x.json rename to ord_schemas/schema/omh/heart-rate-1.x.json diff --git a/schema/omh/heart-rate-2.0.json b/ord_schemas/schema/omh/heart-rate-2.0.json similarity index 100% rename from schema/omh/heart-rate-2.0.json rename to ord_schemas/schema/omh/heart-rate-2.0.json diff --git a/schema/omh/heart-rate-2.x.json b/ord_schemas/schema/omh/heart-rate-2.x.json similarity index 100% rename from schema/omh/heart-rate-2.x.json rename to ord_schemas/schema/omh/heart-rate-2.x.json diff --git a/schema/omh/inspiratory-time-1.0.json b/ord_schemas/schema/omh/inspiratory-time-1.0.json similarity index 100% rename from schema/omh/inspiratory-time-1.0.json rename to ord_schemas/schema/omh/inspiratory-time-1.0.json diff --git a/schema/omh/inspiratory-time-1.x.json b/ord_schemas/schema/omh/inspiratory-time-1.x.json similarity index 100% rename from schema/omh/inspiratory-time-1.x.json rename to ord_schemas/schema/omh/inspiratory-time-1.x.json diff --git a/schema/omh/intervention-administration-route-1.0.json b/ord_schemas/schema/omh/intervention-administration-route-1.0.json similarity index 100% rename from schema/omh/intervention-administration-route-1.0.json rename to ord_schemas/schema/omh/intervention-administration-route-1.0.json diff --git a/schema/omh/intervention-administration-route-1.x.json b/ord_schemas/schema/omh/intervention-administration-route-1.x.json similarity index 100% rename from schema/omh/intervention-administration-route-1.x.json rename to ord_schemas/schema/omh/intervention-administration-route-1.x.json diff --git a/schema/omh/intervention-administration-route-2.0.json b/ord_schemas/schema/omh/intervention-administration-route-2.0.json similarity index 100% rename from schema/omh/intervention-administration-route-2.0.json rename to ord_schemas/schema/omh/intervention-administration-route-2.0.json diff --git a/schema/omh/intervention-administration-route-2.x.json b/ord_schemas/schema/omh/intervention-administration-route-2.x.json similarity index 100% rename from schema/omh/intervention-administration-route-2.x.json rename to ord_schemas/schema/omh/intervention-administration-route-2.x.json diff --git a/schema/omh/kcal-unit-value-1.0.json b/ord_schemas/schema/omh/kcal-unit-value-1.0.json similarity index 100% rename from schema/omh/kcal-unit-value-1.0.json rename to ord_schemas/schema/omh/kcal-unit-value-1.0.json diff --git a/schema/omh/kcal-unit-value-1.x.json b/ord_schemas/schema/omh/kcal-unit-value-1.x.json similarity index 100% rename from schema/omh/kcal-unit-value-1.x.json rename to ord_schemas/schema/omh/kcal-unit-value-1.x.json diff --git a/schema/omh/length-unit-value-1.0.json b/ord_schemas/schema/omh/length-unit-value-1.0.json similarity index 100% rename from schema/omh/length-unit-value-1.0.json rename to ord_schemas/schema/omh/length-unit-value-1.0.json diff --git a/schema/omh/length-unit-value-1.x.json b/ord_schemas/schema/omh/length-unit-value-1.x.json similarity index 100% rename from schema/omh/length-unit-value-1.x.json rename to ord_schemas/schema/omh/length-unit-value-1.x.json diff --git a/schema/omh/local-time-1.0.json b/ord_schemas/schema/omh/local-time-1.0.json similarity index 100% rename from schema/omh/local-time-1.0.json rename to ord_schemas/schema/omh/local-time-1.0.json diff --git a/schema/omh/local-time-1.x.json b/ord_schemas/schema/omh/local-time-1.x.json similarity index 100% rename from schema/omh/local-time-1.x.json rename to ord_schemas/schema/omh/local-time-1.x.json diff --git a/schema/omh/magnetic-flux-density-unit-value-1.0.json b/ord_schemas/schema/omh/magnetic-flux-density-unit-value-1.0.json similarity index 100% rename from schema/omh/magnetic-flux-density-unit-value-1.0.json rename to ord_schemas/schema/omh/magnetic-flux-density-unit-value-1.0.json diff --git a/schema/omh/magnetic-flux-density-unit-value-1.1.json b/ord_schemas/schema/omh/magnetic-flux-density-unit-value-1.1.json similarity index 100% rename from schema/omh/magnetic-flux-density-unit-value-1.1.json rename to ord_schemas/schema/omh/magnetic-flux-density-unit-value-1.1.json diff --git a/schema/omh/magnetic-flux-density-unit-value-1.x.json b/ord_schemas/schema/omh/magnetic-flux-density-unit-value-1.x.json similarity index 100% rename from schema/omh/magnetic-flux-density-unit-value-1.x.json rename to ord_schemas/schema/omh/magnetic-flux-density-unit-value-1.x.json diff --git a/schema/omh/magnetic-force-1.0.json b/ord_schemas/schema/omh/magnetic-force-1.0.json similarity index 100% rename from schema/omh/magnetic-force-1.0.json rename to ord_schemas/schema/omh/magnetic-force-1.0.json diff --git a/schema/omh/magnetic-force-1.x.json b/ord_schemas/schema/omh/magnetic-force-1.x.json similarity index 100% rename from schema/omh/magnetic-force-1.x.json rename to ord_schemas/schema/omh/magnetic-force-1.x.json diff --git a/schema/omh/mass-unit-value-1.0.json b/ord_schemas/schema/omh/mass-unit-value-1.0.json similarity index 100% rename from schema/omh/mass-unit-value-1.0.json rename to ord_schemas/schema/omh/mass-unit-value-1.0.json diff --git a/schema/omh/mass-unit-value-1.1.json b/ord_schemas/schema/omh/mass-unit-value-1.1.json similarity index 100% rename from schema/omh/mass-unit-value-1.1.json rename to ord_schemas/schema/omh/mass-unit-value-1.1.json diff --git a/schema/omh/mass-unit-value-1.x.json b/ord_schemas/schema/omh/mass-unit-value-1.x.json similarity index 100% rename from schema/omh/mass-unit-value-1.x.json rename to ord_schemas/schema/omh/mass-unit-value-1.x.json diff --git a/schema/omh/medication-1.0.json b/ord_schemas/schema/omh/medication-1.0.json similarity index 100% rename from schema/omh/medication-1.0.json rename to ord_schemas/schema/omh/medication-1.0.json diff --git a/schema/omh/medication-1.x.json b/ord_schemas/schema/omh/medication-1.x.json similarity index 100% rename from schema/omh/medication-1.x.json rename to ord_schemas/schema/omh/medication-1.x.json diff --git a/schema/omh/medication-adherence-percent-1.0.json b/ord_schemas/schema/omh/medication-adherence-percent-1.0.json similarity index 100% rename from schema/omh/medication-adherence-percent-1.0.json rename to ord_schemas/schema/omh/medication-adherence-percent-1.0.json diff --git a/schema/omh/medication-adherence-percent-1.x.json b/ord_schemas/schema/omh/medication-adherence-percent-1.x.json similarity index 100% rename from schema/omh/medication-adherence-percent-1.x.json rename to ord_schemas/schema/omh/medication-adherence-percent-1.x.json diff --git a/schema/omh/medication-adherence-percent-2.0.json b/ord_schemas/schema/omh/medication-adherence-percent-2.0.json similarity index 100% rename from schema/omh/medication-adherence-percent-2.0.json rename to ord_schemas/schema/omh/medication-adherence-percent-2.0.json diff --git a/schema/omh/medication-adherence-percent-2.x.json b/ord_schemas/schema/omh/medication-adherence-percent-2.x.json similarity index 100% rename from schema/omh/medication-adherence-percent-2.x.json rename to ord_schemas/schema/omh/medication-adherence-percent-2.x.json diff --git a/schema/omh/medication-dose-unit-1.0.json b/ord_schemas/schema/omh/medication-dose-unit-1.0.json similarity index 100% rename from schema/omh/medication-dose-unit-1.0.json rename to ord_schemas/schema/omh/medication-dose-unit-1.0.json diff --git a/schema/omh/medication-dose-unit-1.x.json b/ord_schemas/schema/omh/medication-dose-unit-1.x.json similarity index 100% rename from schema/omh/medication-dose-unit-1.x.json rename to ord_schemas/schema/omh/medication-dose-unit-1.x.json diff --git a/schema/omh/medication-dose-unit-value-1.0.json b/ord_schemas/schema/omh/medication-dose-unit-value-1.0.json similarity index 100% rename from schema/omh/medication-dose-unit-value-1.0.json rename to ord_schemas/schema/omh/medication-dose-unit-value-1.0.json diff --git a/schema/omh/medication-dose-unit-value-1.1.json b/ord_schemas/schema/omh/medication-dose-unit-value-1.1.json similarity index 100% rename from schema/omh/medication-dose-unit-value-1.1.json rename to ord_schemas/schema/omh/medication-dose-unit-value-1.1.json diff --git a/schema/omh/medication-dose-unit-value-1.x.json b/ord_schemas/schema/omh/medication-dose-unit-value-1.x.json similarity index 100% rename from schema/omh/medication-dose-unit-value-1.x.json rename to ord_schemas/schema/omh/medication-dose-unit-value-1.x.json diff --git a/schema/omh/medication-dose-unit-value-range-1.0.json b/ord_schemas/schema/omh/medication-dose-unit-value-range-1.0.json similarity index 100% rename from schema/omh/medication-dose-unit-value-range-1.0.json rename to ord_schemas/schema/omh/medication-dose-unit-value-range-1.0.json diff --git a/schema/omh/medication-dose-unit-value-range-1.1.json b/ord_schemas/schema/omh/medication-dose-unit-value-range-1.1.json similarity index 100% rename from schema/omh/medication-dose-unit-value-range-1.1.json rename to ord_schemas/schema/omh/medication-dose-unit-value-range-1.1.json diff --git a/schema/omh/medication-dose-unit-value-range-1.x.json b/ord_schemas/schema/omh/medication-dose-unit-value-range-1.x.json similarity index 100% rename from schema/omh/medication-dose-unit-value-range-1.x.json rename to ord_schemas/schema/omh/medication-dose-unit-value-range-1.x.json diff --git a/schema/omh/medication-prescription-1.0.json b/ord_schemas/schema/omh/medication-prescription-1.0.json similarity index 100% rename from schema/omh/medication-prescription-1.0.json rename to ord_schemas/schema/omh/medication-prescription-1.0.json diff --git a/schema/omh/medication-prescription-1.x.json b/ord_schemas/schema/omh/medication-prescription-1.x.json similarity index 100% rename from schema/omh/medication-prescription-1.x.json rename to ord_schemas/schema/omh/medication-prescription-1.x.json diff --git a/schema/omh/medication-prescription-2.0.json b/ord_schemas/schema/omh/medication-prescription-2.0.json similarity index 100% rename from schema/omh/medication-prescription-2.0.json rename to ord_schemas/schema/omh/medication-prescription-2.0.json diff --git a/schema/omh/medication-prescription-2.x.json b/ord_schemas/schema/omh/medication-prescription-2.x.json similarity index 100% rename from schema/omh/medication-prescription-2.x.json rename to ord_schemas/schema/omh/medication-prescription-2.x.json diff --git a/schema/omh/minute-volume-1.0.json b/ord_schemas/schema/omh/minute-volume-1.0.json similarity index 100% rename from schema/omh/minute-volume-1.0.json rename to ord_schemas/schema/omh/minute-volume-1.0.json diff --git a/schema/omh/minute-volume-1.x.json b/ord_schemas/schema/omh/minute-volume-1.x.json similarity index 100% rename from schema/omh/minute-volume-1.x.json rename to ord_schemas/schema/omh/minute-volume-1.x.json diff --git a/schema/omh/minutes-moderate-activity-1.0.json b/ord_schemas/schema/omh/minutes-moderate-activity-1.0.json similarity index 100% rename from schema/omh/minutes-moderate-activity-1.0.json rename to ord_schemas/schema/omh/minutes-moderate-activity-1.0.json diff --git a/schema/omh/minutes-moderate-activity-1.x.json b/ord_schemas/schema/omh/minutes-moderate-activity-1.x.json similarity index 100% rename from schema/omh/minutes-moderate-activity-1.x.json rename to ord_schemas/schema/omh/minutes-moderate-activity-1.x.json diff --git a/schema/omh/orientation-1.0.json b/ord_schemas/schema/omh/orientation-1.0.json similarity index 100% rename from schema/omh/orientation-1.0.json rename to ord_schemas/schema/omh/orientation-1.0.json diff --git a/schema/omh/orientation-1.x.json b/ord_schemas/schema/omh/orientation-1.x.json similarity index 100% rename from schema/omh/orientation-1.x.json rename to ord_schemas/schema/omh/orientation-1.x.json diff --git a/schema/omh/oxygen-saturation-1.0.json b/ord_schemas/schema/omh/oxygen-saturation-1.0.json similarity index 100% rename from schema/omh/oxygen-saturation-1.0.json rename to ord_schemas/schema/omh/oxygen-saturation-1.0.json diff --git a/schema/omh/oxygen-saturation-1.x.json b/ord_schemas/schema/omh/oxygen-saturation-1.x.json similarity index 100% rename from schema/omh/oxygen-saturation-1.x.json rename to ord_schemas/schema/omh/oxygen-saturation-1.x.json diff --git a/schema/omh/oxygen-saturation-2.0.json b/ord_schemas/schema/omh/oxygen-saturation-2.0.json similarity index 100% rename from schema/omh/oxygen-saturation-2.0.json rename to ord_schemas/schema/omh/oxygen-saturation-2.0.json diff --git a/schema/omh/oxygen-saturation-2.x.json b/ord_schemas/schema/omh/oxygen-saturation-2.x.json similarity index 100% rename from schema/omh/oxygen-saturation-2.x.json rename to ord_schemas/schema/omh/oxygen-saturation-2.x.json diff --git a/schema/omh/pace-1.0.json b/ord_schemas/schema/omh/pace-1.0.json similarity index 100% rename from schema/omh/pace-1.0.json rename to ord_schemas/schema/omh/pace-1.0.json diff --git a/schema/omh/pace-1.x.json b/ord_schemas/schema/omh/pace-1.x.json similarity index 100% rename from schema/omh/pace-1.x.json rename to ord_schemas/schema/omh/pace-1.x.json diff --git a/schema/omh/pace-unit-value-1.0.json b/ord_schemas/schema/omh/pace-unit-value-1.0.json similarity index 100% rename from schema/omh/pace-unit-value-1.0.json rename to ord_schemas/schema/omh/pace-unit-value-1.0.json diff --git a/schema/omh/pace-unit-value-1.1.json b/ord_schemas/schema/omh/pace-unit-value-1.1.json similarity index 100% rename from schema/omh/pace-unit-value-1.1.json rename to ord_schemas/schema/omh/pace-unit-value-1.1.json diff --git a/schema/omh/pace-unit-value-1.x.json b/ord_schemas/schema/omh/pace-unit-value-1.x.json similarity index 100% rename from schema/omh/pace-unit-value-1.x.json rename to ord_schemas/schema/omh/pace-unit-value-1.x.json diff --git a/schema/omh/part-of-day-1.0.json b/ord_schemas/schema/omh/part-of-day-1.0.json similarity index 100% rename from schema/omh/part-of-day-1.0.json rename to ord_schemas/schema/omh/part-of-day-1.0.json diff --git a/schema/omh/part-of-day-1.x.json b/ord_schemas/schema/omh/part-of-day-1.x.json similarity index 100% rename from schema/omh/part-of-day-1.x.json rename to ord_schemas/schema/omh/part-of-day-1.x.json diff --git a/schema/omh/patient-medication-schedule-1.0.json b/ord_schemas/schema/omh/patient-medication-schedule-1.0.json similarity index 100% rename from schema/omh/patient-medication-schedule-1.0.json rename to ord_schemas/schema/omh/patient-medication-schedule-1.0.json diff --git a/schema/omh/patient-medication-schedule-1.x.json b/ord_schemas/schema/omh/patient-medication-schedule-1.x.json similarity index 100% rename from schema/omh/patient-medication-schedule-1.x.json rename to ord_schemas/schema/omh/patient-medication-schedule-1.x.json diff --git a/schema/omh/patient-medication-schedule-2.0.json b/ord_schemas/schema/omh/patient-medication-schedule-2.0.json similarity index 100% rename from schema/omh/patient-medication-schedule-2.0.json rename to ord_schemas/schema/omh/patient-medication-schedule-2.0.json diff --git a/schema/omh/patient-medication-schedule-2.x.json b/ord_schemas/schema/omh/patient-medication-schedule-2.x.json similarity index 100% rename from schema/omh/patient-medication-schedule-2.x.json rename to ord_schemas/schema/omh/patient-medication-schedule-2.x.json diff --git a/schema/omh/pharmacy-medication-dispensing-1.0.json b/ord_schemas/schema/omh/pharmacy-medication-dispensing-1.0.json similarity index 100% rename from schema/omh/pharmacy-medication-dispensing-1.0.json rename to ord_schemas/schema/omh/pharmacy-medication-dispensing-1.0.json diff --git a/schema/omh/pharmacy-medication-dispensing-1.x.json b/ord_schemas/schema/omh/pharmacy-medication-dispensing-1.x.json similarity index 100% rename from schema/omh/pharmacy-medication-dispensing-1.x.json rename to ord_schemas/schema/omh/pharmacy-medication-dispensing-1.x.json diff --git a/schema/omh/pharmacy-medication-dispensing-2.0.json b/ord_schemas/schema/omh/pharmacy-medication-dispensing-2.0.json similarity index 100% rename from schema/omh/pharmacy-medication-dispensing-2.0.json rename to ord_schemas/schema/omh/pharmacy-medication-dispensing-2.0.json diff --git a/schema/omh/pharmacy-medication-dispensing-2.x.json b/ord_schemas/schema/omh/pharmacy-medication-dispensing-2.x.json similarity index 100% rename from schema/omh/pharmacy-medication-dispensing-2.x.json rename to ord_schemas/schema/omh/pharmacy-medication-dispensing-2.x.json diff --git a/schema/omh/physical-activity-1.0.json b/ord_schemas/schema/omh/physical-activity-1.0.json similarity index 100% rename from schema/omh/physical-activity-1.0.json rename to ord_schemas/schema/omh/physical-activity-1.0.json diff --git a/schema/omh/physical-activity-1.1.json b/ord_schemas/schema/omh/physical-activity-1.1.json similarity index 100% rename from schema/omh/physical-activity-1.1.json rename to ord_schemas/schema/omh/physical-activity-1.1.json diff --git a/schema/omh/physical-activity-1.2.json b/ord_schemas/schema/omh/physical-activity-1.2.json similarity index 100% rename from schema/omh/physical-activity-1.2.json rename to ord_schemas/schema/omh/physical-activity-1.2.json diff --git a/schema/omh/physical-activity-1.x.json b/ord_schemas/schema/omh/physical-activity-1.x.json similarity index 100% rename from schema/omh/physical-activity-1.x.json rename to ord_schemas/schema/omh/physical-activity-1.x.json diff --git a/schema/omh/plane-angle-unit-value-1.0.json b/ord_schemas/schema/omh/plane-angle-unit-value-1.0.json similarity index 100% rename from schema/omh/plane-angle-unit-value-1.0.json rename to ord_schemas/schema/omh/plane-angle-unit-value-1.0.json diff --git a/schema/omh/plane-angle-unit-value-1.1.json b/ord_schemas/schema/omh/plane-angle-unit-value-1.1.json similarity index 100% rename from schema/omh/plane-angle-unit-value-1.1.json rename to ord_schemas/schema/omh/plane-angle-unit-value-1.1.json diff --git a/schema/omh/plane-angle-unit-value-1.x.json b/ord_schemas/schema/omh/plane-angle-unit-value-1.x.json similarity index 100% rename from schema/omh/plane-angle-unit-value-1.x.json rename to ord_schemas/schema/omh/plane-angle-unit-value-1.x.json diff --git a/schema/omh/position-during-measurement-1.0.json b/ord_schemas/schema/omh/position-during-measurement-1.0.json similarity index 100% rename from schema/omh/position-during-measurement-1.0.json rename to ord_schemas/schema/omh/position-during-measurement-1.0.json diff --git a/schema/omh/position-during-measurement-1.x.json b/ord_schemas/schema/omh/position-during-measurement-1.x.json similarity index 100% rename from schema/omh/position-during-measurement-1.x.json rename to ord_schemas/schema/omh/position-during-measurement-1.x.json diff --git a/schema/omh/reason-single-medication-dose-not-taken-1.0.json b/ord_schemas/schema/omh/reason-single-medication-dose-not-taken-1.0.json similarity index 100% rename from schema/omh/reason-single-medication-dose-not-taken-1.0.json rename to ord_schemas/schema/omh/reason-single-medication-dose-not-taken-1.0.json diff --git a/schema/omh/reason-single-medication-dose-not-taken-1.x.json b/ord_schemas/schema/omh/reason-single-medication-dose-not-taken-1.x.json similarity index 100% rename from schema/omh/reason-single-medication-dose-not-taken-1.x.json rename to ord_schemas/schema/omh/reason-single-medication-dose-not-taken-1.x.json diff --git a/schema/omh/respiratory-rate-1.0.json b/ord_schemas/schema/omh/respiratory-rate-1.0.json similarity index 100% rename from schema/omh/respiratory-rate-1.0.json rename to ord_schemas/schema/omh/respiratory-rate-1.0.json diff --git a/schema/omh/respiratory-rate-1.x.json b/ord_schemas/schema/omh/respiratory-rate-1.x.json similarity index 100% rename from schema/omh/respiratory-rate-1.x.json rename to ord_schemas/schema/omh/respiratory-rate-1.x.json diff --git a/schema/omh/respiratory-rate-2.0.json b/ord_schemas/schema/omh/respiratory-rate-2.0.json similarity index 100% rename from schema/omh/respiratory-rate-2.0.json rename to ord_schemas/schema/omh/respiratory-rate-2.0.json diff --git a/schema/omh/respiratory-rate-2.x.json b/ord_schemas/schema/omh/respiratory-rate-2.x.json similarity index 100% rename from schema/omh/respiratory-rate-2.x.json rename to ord_schemas/schema/omh/respiratory-rate-2.x.json diff --git a/schema/omh/rr-interval-1.0.json b/ord_schemas/schema/omh/rr-interval-1.0.json similarity index 100% rename from schema/omh/rr-interval-1.0.json rename to ord_schemas/schema/omh/rr-interval-1.0.json diff --git a/schema/omh/rr-interval-1.x.json b/ord_schemas/schema/omh/rr-interval-1.x.json similarity index 100% rename from schema/omh/rr-interval-1.x.json rename to ord_schemas/schema/omh/rr-interval-1.x.json diff --git a/schema/omh/schema-id-1.0.json b/ord_schemas/schema/omh/schema-id-1.0.json similarity index 100% rename from schema/omh/schema-id-1.0.json rename to ord_schemas/schema/omh/schema-id-1.0.json diff --git a/schema/omh/schema-id-1.1.json b/ord_schemas/schema/omh/schema-id-1.1.json similarity index 100% rename from schema/omh/schema-id-1.1.json rename to ord_schemas/schema/omh/schema-id-1.1.json diff --git a/schema/omh/schema-id-1.x.json b/ord_schemas/schema/omh/schema-id-1.x.json similarity index 100% rename from schema/omh/schema-id-1.x.json rename to ord_schemas/schema/omh/schema-id-1.x.json diff --git a/schema/omh/single-medication-dose-taken-1.0.json b/ord_schemas/schema/omh/single-medication-dose-taken-1.0.json similarity index 100% rename from schema/omh/single-medication-dose-taken-1.0.json rename to ord_schemas/schema/omh/single-medication-dose-taken-1.0.json diff --git a/schema/omh/single-medication-dose-taken-1.x.json b/ord_schemas/schema/omh/single-medication-dose-taken-1.x.json similarity index 100% rename from schema/omh/single-medication-dose-taken-1.x.json rename to ord_schemas/schema/omh/single-medication-dose-taken-1.x.json diff --git a/schema/omh/sleep-duration-1.0.json b/ord_schemas/schema/omh/sleep-duration-1.0.json similarity index 100% rename from schema/omh/sleep-duration-1.0.json rename to ord_schemas/schema/omh/sleep-duration-1.0.json diff --git a/schema/omh/sleep-duration-1.x.json b/ord_schemas/schema/omh/sleep-duration-1.x.json similarity index 100% rename from schema/omh/sleep-duration-1.x.json rename to ord_schemas/schema/omh/sleep-duration-1.x.json diff --git a/schema/omh/sleep-duration-2.0.json b/ord_schemas/schema/omh/sleep-duration-2.0.json similarity index 100% rename from schema/omh/sleep-duration-2.0.json rename to ord_schemas/schema/omh/sleep-duration-2.0.json diff --git a/schema/omh/sleep-duration-2.x.json b/ord_schemas/schema/omh/sleep-duration-2.x.json similarity index 100% rename from schema/omh/sleep-duration-2.x.json rename to ord_schemas/schema/omh/sleep-duration-2.x.json diff --git a/schema/omh/sleep-episode-1.0.json b/ord_schemas/schema/omh/sleep-episode-1.0.json similarity index 100% rename from schema/omh/sleep-episode-1.0.json rename to ord_schemas/schema/omh/sleep-episode-1.0.json diff --git a/schema/omh/sleep-episode-1.1.json b/ord_schemas/schema/omh/sleep-episode-1.1.json similarity index 100% rename from schema/omh/sleep-episode-1.1.json rename to ord_schemas/schema/omh/sleep-episode-1.1.json diff --git a/schema/omh/sleep-episode-1.x.json b/ord_schemas/schema/omh/sleep-episode-1.x.json similarity index 100% rename from schema/omh/sleep-episode-1.x.json rename to ord_schemas/schema/omh/sleep-episode-1.x.json diff --git a/schema/omh/specimen-source-1.0.json b/ord_schemas/schema/omh/specimen-source-1.0.json similarity index 100% rename from schema/omh/specimen-source-1.0.json rename to ord_schemas/schema/omh/specimen-source-1.0.json diff --git a/schema/omh/specimen-source-1.x.json b/ord_schemas/schema/omh/specimen-source-1.x.json similarity index 100% rename from schema/omh/specimen-source-1.x.json rename to ord_schemas/schema/omh/specimen-source-1.x.json diff --git a/schema/omh/specimen-source-2.0.json b/ord_schemas/schema/omh/specimen-source-2.0.json similarity index 100% rename from schema/omh/specimen-source-2.0.json rename to ord_schemas/schema/omh/specimen-source-2.0.json diff --git a/schema/omh/specimen-source-2.1.json b/ord_schemas/schema/omh/specimen-source-2.1.json similarity index 100% rename from schema/omh/specimen-source-2.1.json rename to ord_schemas/schema/omh/specimen-source-2.1.json diff --git a/schema/omh/specimen-source-2.x.json b/ord_schemas/schema/omh/specimen-source-2.x.json similarity index 100% rename from schema/omh/specimen-source-2.x.json rename to ord_schemas/schema/omh/specimen-source-2.x.json diff --git a/schema/omh/speed-1.0.json b/ord_schemas/schema/omh/speed-1.0.json similarity index 100% rename from schema/omh/speed-1.0.json rename to ord_schemas/schema/omh/speed-1.0.json diff --git a/schema/omh/speed-1.x.json b/ord_schemas/schema/omh/speed-1.x.json similarity index 100% rename from schema/omh/speed-1.x.json rename to ord_schemas/schema/omh/speed-1.x.json diff --git a/schema/omh/speed-unit-value-1.0.json b/ord_schemas/schema/omh/speed-unit-value-1.0.json similarity index 100% rename from schema/omh/speed-unit-value-1.0.json rename to ord_schemas/schema/omh/speed-unit-value-1.0.json diff --git a/schema/omh/speed-unit-value-1.x.json b/ord_schemas/schema/omh/speed-unit-value-1.x.json similarity index 100% rename from schema/omh/speed-unit-value-1.x.json rename to ord_schemas/schema/omh/speed-unit-value-1.x.json diff --git a/schema/omh/step-count-1.0.json b/ord_schemas/schema/omh/step-count-1.0.json similarity index 100% rename from schema/omh/step-count-1.0.json rename to ord_schemas/schema/omh/step-count-1.0.json diff --git a/schema/omh/step-count-1.x.json b/ord_schemas/schema/omh/step-count-1.x.json similarity index 100% rename from schema/omh/step-count-1.x.json rename to ord_schemas/schema/omh/step-count-1.x.json diff --git a/schema/omh/step-count-2.0.json b/ord_schemas/schema/omh/step-count-2.0.json similarity index 100% rename from schema/omh/step-count-2.0.json rename to ord_schemas/schema/omh/step-count-2.0.json diff --git a/schema/omh/step-count-2.x.json b/ord_schemas/schema/omh/step-count-2.x.json similarity index 100% rename from schema/omh/step-count-2.x.json rename to ord_schemas/schema/omh/step-count-2.x.json diff --git a/schema/omh/step-count-3.0.json b/ord_schemas/schema/omh/step-count-3.0.json similarity index 100% rename from schema/omh/step-count-3.0.json rename to ord_schemas/schema/omh/step-count-3.0.json diff --git a/schema/omh/step-count-3.x.json b/ord_schemas/schema/omh/step-count-3.x.json similarity index 100% rename from schema/omh/step-count-3.x.json rename to ord_schemas/schema/omh/step-count-3.x.json diff --git a/schema/omh/systolic-blood-pressure-1.0.json b/ord_schemas/schema/omh/systolic-blood-pressure-1.0.json similarity index 100% rename from schema/omh/systolic-blood-pressure-1.0.json rename to ord_schemas/schema/omh/systolic-blood-pressure-1.0.json diff --git a/schema/omh/systolic-blood-pressure-1.1.json b/ord_schemas/schema/omh/systolic-blood-pressure-1.1.json similarity index 100% rename from schema/omh/systolic-blood-pressure-1.1.json rename to ord_schemas/schema/omh/systolic-blood-pressure-1.1.json diff --git a/schema/omh/systolic-blood-pressure-1.x.json b/ord_schemas/schema/omh/systolic-blood-pressure-1.x.json similarity index 100% rename from schema/omh/systolic-blood-pressure-1.x.json rename to ord_schemas/schema/omh/systolic-blood-pressure-1.x.json diff --git a/schema/omh/temperature-unit-value-1.0.json b/ord_schemas/schema/omh/temperature-unit-value-1.0.json similarity index 100% rename from schema/omh/temperature-unit-value-1.0.json rename to ord_schemas/schema/omh/temperature-unit-value-1.0.json diff --git a/schema/omh/temperature-unit-value-1.x.json b/ord_schemas/schema/omh/temperature-unit-value-1.x.json similarity index 100% rename from schema/omh/temperature-unit-value-1.x.json rename to ord_schemas/schema/omh/temperature-unit-value-1.x.json diff --git a/schema/omh/temporal-relationship-to-meal-1.0.json b/ord_schemas/schema/omh/temporal-relationship-to-meal-1.0.json similarity index 100% rename from schema/omh/temporal-relationship-to-meal-1.0.json rename to ord_schemas/schema/omh/temporal-relationship-to-meal-1.0.json diff --git a/schema/omh/temporal-relationship-to-meal-1.1.json b/ord_schemas/schema/omh/temporal-relationship-to-meal-1.1.json similarity index 100% rename from schema/omh/temporal-relationship-to-meal-1.1.json rename to ord_schemas/schema/omh/temporal-relationship-to-meal-1.1.json diff --git a/schema/omh/temporal-relationship-to-meal-1.2.json b/ord_schemas/schema/omh/temporal-relationship-to-meal-1.2.json similarity index 100% rename from schema/omh/temporal-relationship-to-meal-1.2.json rename to ord_schemas/schema/omh/temporal-relationship-to-meal-1.2.json diff --git a/schema/omh/temporal-relationship-to-meal-1.x.json b/ord_schemas/schema/omh/temporal-relationship-to-meal-1.x.json similarity index 100% rename from schema/omh/temporal-relationship-to-meal-1.x.json rename to ord_schemas/schema/omh/temporal-relationship-to-meal-1.x.json diff --git a/schema/omh/temporal-relationship-to-physical-activity-1.0.json b/ord_schemas/schema/omh/temporal-relationship-to-physical-activity-1.0.json similarity index 100% rename from schema/omh/temporal-relationship-to-physical-activity-1.0.json rename to ord_schemas/schema/omh/temporal-relationship-to-physical-activity-1.0.json diff --git a/schema/omh/temporal-relationship-to-physical-activity-1.x.json b/ord_schemas/schema/omh/temporal-relationship-to-physical-activity-1.x.json similarity index 100% rename from schema/omh/temporal-relationship-to-physical-activity-1.x.json rename to ord_schemas/schema/omh/temporal-relationship-to-physical-activity-1.x.json diff --git a/schema/omh/temporal-relationship-to-sleep-1.0.json b/ord_schemas/schema/omh/temporal-relationship-to-sleep-1.0.json similarity index 100% rename from schema/omh/temporal-relationship-to-sleep-1.0.json rename to ord_schemas/schema/omh/temporal-relationship-to-sleep-1.0.json diff --git a/schema/omh/temporal-relationship-to-sleep-1.x.json b/ord_schemas/schema/omh/temporal-relationship-to-sleep-1.x.json similarity index 100% rename from schema/omh/temporal-relationship-to-sleep-1.x.json rename to ord_schemas/schema/omh/temporal-relationship-to-sleep-1.x.json diff --git a/schema/omh/time-frame-1.0.json b/ord_schemas/schema/omh/time-frame-1.0.json similarity index 100% rename from schema/omh/time-frame-1.0.json rename to ord_schemas/schema/omh/time-frame-1.0.json diff --git a/schema/omh/time-frame-1.x.json b/ord_schemas/schema/omh/time-frame-1.x.json similarity index 100% rename from schema/omh/time-frame-1.x.json rename to ord_schemas/schema/omh/time-frame-1.x.json diff --git a/schema/omh/time-interval-1.0.json b/ord_schemas/schema/omh/time-interval-1.0.json similarity index 100% rename from schema/omh/time-interval-1.0.json rename to ord_schemas/schema/omh/time-interval-1.0.json diff --git a/schema/omh/time-interval-1.x.json b/ord_schemas/schema/omh/time-interval-1.x.json similarity index 100% rename from schema/omh/time-interval-1.x.json rename to ord_schemas/schema/omh/time-interval-1.x.json diff --git a/schema/omh/total-sleep-time-1.0.json b/ord_schemas/schema/omh/total-sleep-time-1.0.json similarity index 100% rename from schema/omh/total-sleep-time-1.0.json rename to ord_schemas/schema/omh/total-sleep-time-1.0.json diff --git a/schema/omh/total-sleep-time-1.x.json b/ord_schemas/schema/omh/total-sleep-time-1.x.json similarity index 100% rename from schema/omh/total-sleep-time-1.x.json rename to ord_schemas/schema/omh/total-sleep-time-1.x.json diff --git a/schema/omh/unit-value-1.0.json b/ord_schemas/schema/omh/unit-value-1.0.json similarity index 100% rename from schema/omh/unit-value-1.0.json rename to ord_schemas/schema/omh/unit-value-1.0.json diff --git a/schema/omh/unit-value-1.x.json b/ord_schemas/schema/omh/unit-value-1.x.json similarity index 100% rename from schema/omh/unit-value-1.x.json rename to ord_schemas/schema/omh/unit-value-1.x.json diff --git a/schema/omh/unit-value-range-1.0.json b/ord_schemas/schema/omh/unit-value-range-1.0.json similarity index 100% rename from schema/omh/unit-value-range-1.0.json rename to ord_schemas/schema/omh/unit-value-range-1.0.json diff --git a/schema/omh/unit-value-range-1.x.json b/ord_schemas/schema/omh/unit-value-range-1.x.json similarity index 100% rename from schema/omh/unit-value-range-1.x.json rename to ord_schemas/schema/omh/unit-value-range-1.x.json diff --git a/schema/omh/ventilation-cycle-time-1.0.json b/ord_schemas/schema/omh/ventilation-cycle-time-1.0.json similarity index 100% rename from schema/omh/ventilation-cycle-time-1.0.json rename to ord_schemas/schema/omh/ventilation-cycle-time-1.0.json diff --git a/schema/omh/ventilation-cycle-time-1.x.json b/ord_schemas/schema/omh/ventilation-cycle-time-1.x.json similarity index 100% rename from schema/omh/ventilation-cycle-time-1.x.json rename to ord_schemas/schema/omh/ventilation-cycle-time-1.x.json diff --git a/schema/omh/volume-unit-value-1.0.json b/ord_schemas/schema/omh/volume-unit-value-1.0.json similarity index 100% rename from schema/omh/volume-unit-value-1.0.json rename to ord_schemas/schema/omh/volume-unit-value-1.0.json diff --git a/schema/omh/volume-unit-value-1.1.json b/ord_schemas/schema/omh/volume-unit-value-1.1.json similarity index 100% rename from schema/omh/volume-unit-value-1.1.json rename to ord_schemas/schema/omh/volume-unit-value-1.1.json diff --git a/schema/omh/volume-unit-value-1.x.json b/ord_schemas/schema/omh/volume-unit-value-1.x.json similarity index 100% rename from schema/omh/volume-unit-value-1.x.json rename to ord_schemas/schema/omh/volume-unit-value-1.x.json diff --git a/schema/ros4hc/Notes.txt b/ord_schemas/schema/ros4hc/Notes.txt similarity index 100% rename from schema/ros4hc/Notes.txt rename to ord_schemas/schema/ros4hc/Notes.txt diff --git a/schema/ros4hc/bcg-1.x.json b/ord_schemas/schema/ros4hc/bcg-1.x.json similarity index 100% rename from schema/ros4hc/bcg-1.x.json rename to ord_schemas/schema/ros4hc/bcg-1.x.json diff --git a/ord_schemas/schema/ros4hc/bcg-info-1.x.json b/ord_schemas/schema/ros4hc/bcg-info-1.x.json new file mode 100644 index 00000000..5182c8e3 --- /dev/null +++ b/ord_schemas/schema/ros4hc/bcg-info-1.x.json @@ -0,0 +1,62 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + + "title": "BCG Data Series", + "type": "object", + "description": "This schema represents a bcg data series, i.e., an array of measures that share the same header.", + + "definitions": { + "sensor_device_header": { + "$ref": "sensor-device-header-1.x.json" + } + }, + + "allOf": [ + {"$ref": "#/definitions/sensor_device_header"}, + { + "type": "object", + "properties": { + "sensor_configuration": { + "type": "object", + "properties": { + + "sensor_placement": { + "description": "Sensor Placements", + "type": "string", + "enum": [ + "Unknown", "Chest", "Back", "Mattress", "Chair", "Feet", "Wrist", "Arm", "Desk", "Clothing", "Custom" + ] + }, + + "sensing_direction": { + "description": "Axis along which BCG is measured", + "type": "string", + "enum": [ + "Dorso Ventral", "Longitudinal", "Medio Lateral", "Unknown" + ] + }, + + "sensing_modality": { + "description": "Type of Sensor used", + "type": "string", + "enum": [ + "Piezoelectric Film", "Forceplate", "Accelerometer", "Piezoelectric crystal", "Unknown" + ] + }, + + "measurement_system": { + "description": "System Type", + "type": "string", + "enum": [ + "Starr", "Nickerson", "Dock", "Other", "Unknown" + ] + } + }, + "required": [ + "sensor_placement" + ] + } + } + } + ] +} diff --git a/schema/ros4hc/ecg-1.x.json b/ord_schemas/schema/ros4hc/ecg-1.x.json similarity index 100% rename from schema/ros4hc/ecg-1.x.json rename to ord_schemas/schema/ros4hc/ecg-1.x.json diff --git a/schema/ros4hc/ecg-info-1.x.json b/ord_schemas/schema/ros4hc/ecg-info-1.x.json similarity index 100% rename from schema/ros4hc/ecg-info-1.x.json rename to ord_schemas/schema/ros4hc/ecg-info-1.x.json diff --git a/schema/ros4hc/eda-1.x.json b/ord_schemas/schema/ros4hc/eda-1.x.json similarity index 100% rename from schema/ros4hc/eda-1.x.json rename to ord_schemas/schema/ros4hc/eda-1.x.json diff --git a/schema/ros4hc/eda-info-1.x.json b/ord_schemas/schema/ros4hc/eda-info-1.x.json similarity index 100% rename from schema/ros4hc/eda-info-1.x.json rename to ord_schemas/schema/ros4hc/eda-info-1.x.json diff --git a/schema/ros4hc/eeg-1.x.json b/ord_schemas/schema/ros4hc/eeg-1.x.json similarity index 100% rename from schema/ros4hc/eeg-1.x.json rename to ord_schemas/schema/ros4hc/eeg-1.x.json diff --git a/schema/ros4hc/eeg-info-1.x.json b/ord_schemas/schema/ros4hc/eeg-info-1.x.json similarity index 100% rename from schema/ros4hc/eeg-info-1.x.json rename to ord_schemas/schema/ros4hc/eeg-info-1.x.json diff --git a/schema/ros4hc/emg-1.x.json b/ord_schemas/schema/ros4hc/emg-1.x.json similarity index 100% rename from schema/ros4hc/emg-1.x.json rename to ord_schemas/schema/ros4hc/emg-1.x.json diff --git a/schema/ros4hc/emg-info-1.x.json b/ord_schemas/schema/ros4hc/emg-info-1.x.json similarity index 100% rename from schema/ros4hc/emg-info-1.x.json rename to ord_schemas/schema/ros4hc/emg-info-1.x.json diff --git a/schema/ros4hc/eog-1.x.json b/ord_schemas/schema/ros4hc/eog-1.x.json similarity index 100% rename from schema/ros4hc/eog-1.x.json rename to ord_schemas/schema/ros4hc/eog-1.x.json diff --git a/schema/ros4hc/eog-info-1.x.json b/ord_schemas/schema/ros4hc/eog-info-1.x.json similarity index 100% rename from schema/ros4hc/eog-info-1.x.json rename to ord_schemas/schema/ros4hc/eog-info-1.x.json diff --git a/ord_schemas/schema/ros4hc/healthcare-filterbase-1.x.json b/ord_schemas/schema/ros4hc/healthcare-filterbase-1.x.json new file mode 100644 index 00000000..e69de29b diff --git a/schema/ros4hc/icg-1.x.json b/ord_schemas/schema/ros4hc/icg-1.x.json similarity index 100% rename from schema/ros4hc/icg-1.x.json rename to ord_schemas/schema/ros4hc/icg-1.x.json diff --git a/schema/ros4hc/icg-info-1.x.json b/ord_schemas/schema/ros4hc/icg-info-1.x.json similarity index 100% rename from schema/ros4hc/icg-info-1.x.json rename to ord_schemas/schema/ros4hc/icg-info-1.x.json diff --git a/schema/ros4hc/metadata/device-identity-1.x.json b/ord_schemas/schema/ros4hc/metadata/device-identity-1.x.json similarity index 100% rename from schema/ros4hc/metadata/device-identity-1.x.json rename to ord_schemas/schema/ros4hc/metadata/device-identity-1.x.json diff --git a/schema/ros4hc/metadata/measurement-specification-1.x.json b/ord_schemas/schema/ros4hc/metadata/measurement-specification-1.x.json similarity index 100% rename from schema/ros4hc/metadata/measurement-specification-1.x.json rename to ord_schemas/schema/ros4hc/metadata/measurement-specification-1.x.json diff --git a/schema/ros4hc/metadata/operating-environment-1.x.json b/ord_schemas/schema/ros4hc/metadata/operating-environment-1.x.json similarity index 100% rename from schema/ros4hc/metadata/operating-environment-1.x.json rename to ord_schemas/schema/ros4hc/metadata/operating-environment-1.x.json diff --git a/schema/ros4hc/metadata/ord-default-header-1.x.json b/ord_schemas/schema/ros4hc/metadata/ord-default-header-1.x.json similarity index 100% rename from schema/ros4hc/metadata/ord-default-header-1.x.json rename to ord_schemas/schema/ros4hc/metadata/ord-default-header-1.x.json diff --git a/schema/ros4hc/metadata/sensor-device-header-1.x.json b/ord_schemas/schema/ros4hc/metadata/sensor-device-header-1.x.json similarity index 100% rename from schema/ros4hc/metadata/sensor-device-header-1.x.json rename to ord_schemas/schema/ros4hc/metadata/sensor-device-header-1.x.json diff --git a/schema/ros4hc/min-max-unit-value-1.x.json b/ord_schemas/schema/ros4hc/min-max-unit-value-1.x.json similarity index 100% rename from schema/ros4hc/min-max-unit-value-1.x.json rename to ord_schemas/schema/ros4hc/min-max-unit-value-1.x.json diff --git a/schema/ros4hc/ppg-1.x.json b/ord_schemas/schema/ros4hc/ppg-1.x.json similarity index 100% rename from schema/ros4hc/ppg-1.x.json rename to ord_schemas/schema/ros4hc/ppg-1.x.json diff --git a/schema/ros4hc/ppg-info-1.x.json b/ord_schemas/schema/ros4hc/ppg-info-1.x.json similarity index 100% rename from schema/ros4hc/ppg-info-1.x.json rename to ord_schemas/schema/ros4hc/ppg-info-1.x.json diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..e31732b1 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,18 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "ord-schemas" +version = "0.1.0" +description = "Open Reaction Database JSON OMH schemas" +authors = [{ name = "OMH Community & SCAI-Lab" }] +readme = "README.md" +requires-python = ">=3.8" + +[tool.setuptools] +packages = ["schema"] +include-package-data = true + +[tool.setuptools.package-data] +"ord_schemas" = ["**/*.json"] diff --git a/schema/ros4hc/bcg-info-1.x.json b/schema/ros4hc/bcg-info-1.x.json deleted file mode 100644 index cf47d882..00000000 --- a/schema/ros4hc/bcg-info-1.x.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - - "title": "BCG Data Series", - "type": "object", - "description": "This schema represents a bcg data series, i.e., an array of measures that share the same header.", - - "definitions": { - "sensor_device_header": { - "$ref": "sensor-device-header-1.x.json" - } - }, - - "allOf": [ - {"$ref": "#/definitions/sensor_device_header"}, - { - "sensor_configuration": { - "type": "object", - "properties": { - - "sensor_placement": { - "description": "Sensor Placements", - "type": "string", - "enum": [ - "Unknown", "Chest", "Back", "Mattress", "Chair", "Feet", "Wrist", "Arm", "Desk", "Clothing", "Custom" - ] - }, - - "sensing_direction": { - "description": "Axis along which BCG is measured", - "type": "string", - "enum": [ - "Dorso Ventral", "Longitudinal", "Medio Lateral", "Unknown" - ] - }, - - "sensing_modality": { - "description": "Type of Sensor used", - "type": "string", - "enum": [ - "Piezoelectric Film", "Forceplate", "Accelerometer", "Piezoelectric crystal", "Unknown" - ] - }, - - "measurement_system": { - "description": "System Type", - "type": "string", - "enum": [ - "Starr", "Nickerson", "Dock", "Other", "Unknown" - ] - } - }, - "required": [ - "sensor_placement" - ] - } - } - ] -} From 71d449c3b5134b63ddddfe89dde873c09bd13059 Mon Sep 17 00:00:00 2001 From: Elisa Du <79795653+Alizzie@users.noreply.github.com> Date: Sat, 25 Oct 2025 17:12:44 +0200 Subject: [PATCH 08/15] fix pyproject.toml --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e31732b1..b6de483a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,8 +11,8 @@ readme = "README.md" requires-python = ">=3.8" [tool.setuptools] -packages = ["schema"] +packages = ["ord_schemas", "ord_schemas.schema"] include-package-data = true [tool.setuptools.package-data] -"ord_schemas" = ["**/*.json"] +"ord_schemas.schema" = ["**/*.json"] From 628a494a9fd872b83cafbd59ee5af2f3903a1ef8 Mon Sep 17 00:00:00 2001 From: Elisa Du <79795653+Alizzie@users.noreply.github.com> Date: Sat, 25 Oct 2025 17:40:54 +0200 Subject: [PATCH 09/15] fix init for schema --- ord_schemas/schema/__init__.py | 37 ++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/ord_schemas/schema/__init__.py b/ord_schemas/schema/__init__.py index 0aad429b..487db994 100644 --- a/ord_schemas/schema/__init__.py +++ b/ord_schemas/schema/__init__.py @@ -1,25 +1,36 @@ import json import importlib.resources as pkg_resources -PACKAGE_NAME = __package__ +PACKAGE_NAME = __package__ # your package name def list_domains(): """Return top-level schema domains (subfolders in schema/).""" - with pkg_resources.files(PACKAGE_NAME) as package_dir: - return [p.name for p in package_dir.iterdir() if p.is_dir()] + package_dir = pkg_resources.files(PACKAGE_NAME) + return [p.name for p in package_dir.iterdir() if p.is_dir()] def list_schemas(domain=None): - """List JSON schema files, optionally filtered by domain.""" + """ + List all JSON schema files, recursively, optionally filtered by domain. + Returns paths relative to the domain folder. + """ schemas = [] - with pkg_resources.files(PACKAGE_NAME) as package_dir: - for path in package_dir.rglob("*.json"): - relative_path = path.relative_to(package_dir) - if domain is None or relative_path.parts[0] == domain: - schemas.append(str(relative_path)) + package_dir = pkg_resources.files(PACKAGE_NAME) + + for path in package_dir.rglob("*.json"): + relative_path = path.relative_to(package_dir) + if domain is None or relative_path.parts[0] == domain: + # Make path relative to the domain folder + relative_to_domain = "/".join(relative_path.parts[1:]) + schemas.append(relative_to_domain) + return schemas -def load_schema(domain, schema_name): - """Load a JSON schema by domain and name.""" - schema_file = f"{domain}/{schema_name}.json" - with pkg_resources.files(PACKAGE_NAME).joinpath(schema_file).open("r") as f: +def load_schema(domain, schema_relative_path): + """ + Load a JSON schema by domain and relative path (supports nested folders). + Example: load_schema("ros4hc", "metadata/meta1.json") + """ + schema_file = f"{domain}/{schema_relative_path}" + package_dir = pkg_resources.files(PACKAGE_NAME) + with package_dir.joinpath(schema_file).open("r") as f: return json.load(f) From 8eda1b7fd7316d2ec9978cc5ce32ac743c363e09 Mon Sep 17 00:00:00 2001 From: Elisa Du <79795653+Alizzie@users.noreply.github.com> Date: Sat, 25 Oct 2025 18:24:31 +0200 Subject: [PATCH 10/15] add folder tree structure method for the package --- ord_schemas/schema/__init__.py | 46 +++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/ord_schemas/schema/__init__.py b/ord_schemas/schema/__init__.py index 487db994..8e07ebd5 100644 --- a/ord_schemas/schema/__init__.py +++ b/ord_schemas/schema/__init__.py @@ -1,12 +1,52 @@ import json import importlib.resources as pkg_resources -PACKAGE_NAME = __package__ # your package name +PACKAGE_NAME = __package__ def list_domains(): """Return top-level schema domains (subfolders in schema/).""" package_dir = pkg_resources.files(PACKAGE_NAME) - return [p.name for p in package_dir.iterdir() if p.is_dir()] + return [p.name for p in package_dir.iterdir() if p.is_dir() and p.name != "__pycache"] + + +def _format_tree(path, prefix = ''): + """ + Helper function to recursively format the directory structure as a string tree, + using only built-in string characters. + """ + + tree_lines = [] + + items = sorted([ + item + for item in path.iterdir() + if item.is_dir() and item.name != "__pycache" + ], key = lambda p : p.name) + + count = len(items) + for i, item in enumerate(items): + is_last = (i == count -1) + + connector = "└── " if is_last else "├── " + tree_lines.append(f"{prefix}{connector}{item.name}") + + childPrefix = prefix + (' ' * 4 if is_last else "|" + ' ' * 3) + tree_lines.extend(_format_tree(item, childPrefix)) + + +def get_tree_structure(): + """ + Loads the entire folder structure (domain subfolders and nested subfolders) + of the package as a nested dictionary, excluding files and __pycache__. + """ + package_dir = pkg_resources.files(PACKAGE_NAME) + + tree_lines = _format_tree(package_dir) + root_name = PACKAGE_NAME.split('.')[-1] if '.' in PACKAGE_NAME else PACKAGE_NAME + + return f"{root_name}/\n" + "\n".join(tree_lines) + + def list_schemas(domain=None): """ @@ -19,12 +59,12 @@ def list_schemas(domain=None): for path in package_dir.rglob("*.json"): relative_path = path.relative_to(package_dir) if domain is None or relative_path.parts[0] == domain: - # Make path relative to the domain folder relative_to_domain = "/".join(relative_path.parts[1:]) schemas.append(relative_to_domain) return schemas + def load_schema(domain, schema_relative_path): """ Load a JSON schema by domain and relative path (supports nested folders). From 457fb5fa4ca278ea1e4e03fb65a3ffb637c0b215 Mon Sep 17 00:00:00 2001 From: Elisa Du <79795653+Alizzie@users.noreply.github.com> Date: Sat, 25 Oct 2025 18:31:11 +0200 Subject: [PATCH 11/15] fix tree structure forgot return --- ord_schemas/schema/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ord_schemas/schema/__init__.py b/ord_schemas/schema/__init__.py index 8e07ebd5..91604025 100644 --- a/ord_schemas/schema/__init__.py +++ b/ord_schemas/schema/__init__.py @@ -33,6 +33,8 @@ def _format_tree(path, prefix = ''): childPrefix = prefix + (' ' * 4 if is_last else "|" + ' ' * 3) tree_lines.extend(_format_tree(item, childPrefix)) + return tree_lines + def get_tree_structure(): """ From fd405da3ef2f040c286a5d1073a164de33996ae9 Mon Sep 17 00:00:00 2001 From: Elisa Du <79795653+Alizzie@users.noreply.github.com> Date: Sat, 25 Oct 2025 18:32:30 +0200 Subject: [PATCH 12/15] fix tree structure misspelled pycache --- ord_schemas/schema/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ord_schemas/schema/__init__.py b/ord_schemas/schema/__init__.py index 91604025..c441e092 100644 --- a/ord_schemas/schema/__init__.py +++ b/ord_schemas/schema/__init__.py @@ -20,7 +20,7 @@ def _format_tree(path, prefix = ''): items = sorted([ item for item in path.iterdir() - if item.is_dir() and item.name != "__pycache" + if item.is_dir() and item.name != "__pycache__" ], key = lambda p : p.name) count = len(items) From 0ddd4b1827f2de914975e1f44c79bb0e8d10bf25 Mon Sep 17 00:00:00 2001 From: Elisa Du <79795653+Alizzie@users.noreply.github.com> Date: Sat, 25 Oct 2025 18:59:25 +0200 Subject: [PATCH 13/15] extend ord_ schema package functions --- ord_schemas/schema/__init__.py | 68 +++++++++++++++++++++++++++++----- 1 file changed, 58 insertions(+), 10 deletions(-) diff --git a/ord_schemas/schema/__init__.py b/ord_schemas/schema/__init__.py index c441e092..345dc812 100644 --- a/ord_schemas/schema/__init__.py +++ b/ord_schemas/schema/__init__.py @@ -50,29 +50,77 @@ def get_tree_structure(): -def list_schemas(domain=None): +def list_schemas(domain=None, subfolder=None, with_path = False): """ - List all JSON schema files, recursively, optionally filtered by domain. - Returns paths relative to the domain folder. + List all JSON schema files, recursively, optionally filtered by domain and/or subfolder. + If with_path=True, returns the full path relative to the package root. + Otherwise, returns paths relative to the domain folder, OR relative to the subfolder + if both domain and subfolder are provided. """ schemas = [] package_dir = pkg_resources.files(PACKAGE_NAME) + if subfolder is not None and domain is None: + raise ValueError("Cannot filter by 'subfolder' without specifying a 'domain'.") + + start_index = 0 + if domain is not None: + start_index = 1 + if subfolder is not None: + start_index = 2 + for path in package_dir.rglob("*.json"): relative_path = path.relative_to(package_dir) - if domain is None or relative_path.parts[0] == domain: - relative_to_domain = "/".join(relative_path.parts[1:]) - schemas.append(relative_to_domain) - + + if domain is not None and relative_path.parts[0] != domain: + continue + + if subfolder is not None: + if len(relative_path.parts) < 2 or relative_path.parts[1] != subfolder: + continue + + if with_path: + schemas.append(relative_path.as_posix()) + else: + relative_path_parts = relative_path.parts[start_index:] + relative_schema_path = "/".join(relative_path_parts) + schemas.append(relative_schema_path) + return schemas -def load_schema(domain, schema_relative_path): +def load_schema(folder, schema_name): """ Load a JSON schema by domain and relative path (supports nested folders). - Example: load_schema("ros4hc", "metadata/meta1.json") + Example: load_schema("ros4hc/metadata", "meta1.json") """ - schema_file = f"{domain}/{schema_relative_path}" + schema_file = f"{folder}/{schema_name}" package_dir = pkg_resources.files(PACKAGE_NAME) with package_dir.joinpath(schema_file).open("r") as f: return json.load(f) + + +def load_schema_from_path(schema_path): + """ + Load a JSON schema by its full path relative to the package root. + Example: load_schema_from_path("ros4hc/metadata/meta1.json") + """ + package_dir = pkg_resources.files(PACKAGE_NAME) + + try: + schema_file = package_dir.joinpath(schema_path) + with schema_file.open("r") as f: + return json.load(f) + except FileNotFoundError: + raise FileNotFoundError(f"Schema not found at path: {schema_path} relative to package {PACKAGE_NAME}") + + +def load_schema(folder, schema_name): + """ + Load a JSON schema by specifying the folder path and the schema file name. + Example: load_schema("ros4hc/metadata", "meta1.json") + + This function acts as a wrapper for load_schema_from_path. + """ + schema_path = f"{folder}/{schema_name}" + return load_schema_from_path(schema_path) \ No newline at end of file From 62762dae01df1f816d09e0a0e2e132a13c1f656d Mon Sep 17 00:00:00 2001 From: Elisa Du <79795653+Alizzie@users.noreply.github.com> Date: Sat, 25 Oct 2025 23:00:37 +0200 Subject: [PATCH 14/15] add json decode error handler in ord_schema package function --- ord_schemas/schema/__init__.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ord_schemas/schema/__init__.py b/ord_schemas/schema/__init__.py index 345dc812..a4d3001c 100644 --- a/ord_schemas/schema/__init__.py +++ b/ord_schemas/schema/__init__.py @@ -110,9 +110,17 @@ def load_schema_from_path(schema_path): try: schema_file = package_dir.joinpath(schema_path) with schema_file.open("r") as f: - return json.load(f) + content = json.read().strip() + + if not content: + return {} + else: + return json.loads(content) + except FileNotFoundError: raise FileNotFoundError(f"Schema not found at path: {schema_path} relative to package {PACKAGE_NAME}") + except json.JSONDecodeError as e: + raise ValueError(f"File at {schema_path} contains invalid JSON.") from e def load_schema(folder, schema_name): From 4814c9c303ae21e0febf336451ecdde455c8edeb Mon Sep 17 00:00:00 2001 From: Elisa Du <79795653+Alizzie@users.noreply.github.com> Date: Sat, 25 Oct 2025 23:01:38 +0200 Subject: [PATCH 15/15] fix parameter in json decode error handler --- ord_schemas/schema/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ord_schemas/schema/__init__.py b/ord_schemas/schema/__init__.py index a4d3001c..126aad7f 100644 --- a/ord_schemas/schema/__init__.py +++ b/ord_schemas/schema/__init__.py @@ -110,7 +110,7 @@ def load_schema_from_path(schema_path): try: schema_file = package_dir.joinpath(schema_path) with schema_file.open("r") as f: - content = json.read().strip() + content = f.read().strip() if not content: return {}