diff --git a/tests/robot/AQL_TESTS/AGGREGATE_FUNCTIONS/DV_ORDERED/avg_on_dv_ordered_not_implemented.robot b/tests/robot/AQL_TESTS/AGGREGATE_FUNCTIONS/DV_ORDERED/avg_on_dv_ordered_not_implemented.robot new file mode 100644 index 00000000..8f9ddf91 --- /dev/null +++ b/tests/robot/AQL_TESTS/AGGREGATE_FUNCTIONS/DV_ORDERED/avg_on_dv_ordered_not_implemented.robot @@ -0,0 +1,40 @@ +*** Settings *** +Documentation CHECK AGGREGATE FUNCTIONS AVG NOT IMPLEMENTED ON DV_ORDERED IN AQL +... - Covers: https://github.com/ehrbase/AQL_Test_CASES/blob/main/AGGREGATE_FUNCTIONS.md#avg-on-dv-ordered + +Resource ../../../_resources/keywords/aql_keywords.robot + +Library DataDriver +... file=${PROJECT_ROOT}/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/combinations/avg_on_dv_ordered.csv +... dialect=excel + +Suite Setup Precondition +Suite Teardown Admin Delete EHR For AQL + + +*** Test Cases *** +SELECT AVG(${path}) FROM OBSERVATION o [openEHR-EHR-OBSERVATION.conformance_observation.v0] + [Template] Execute Query + ${path} ${expected_file} + + +*** Keywords *** +Precondition + Upload OPT For AQL conformance_ehrbase.de.v0.opt + Create EHR For AQL + Commit Composition For AQL conformance_ehrbase.de.v0_max_v3.json + +Execute Query + [Arguments] ${path} ${expected_file} + ${query} Set Variable SELECT AVG(${path}) FROM OBSERVATION o[openEHR-EHR-OBSERVATION.conformance_observation.v0] + Set AQL And Execute Ad Hoc Query ${query} + + ${expected_result} Set Variable ${EXPECTED_JSON_DATA_SETS}/aggregate_functions/${expected_file} + ${exclude_paths} Create List root['meta'] + ${diff} compare json-string with json-file + ... ${resp_body_actual} ${expected_result} + ... exclude_paths=${exclude_paths} + ... ignore_order=${TRUE} + ... ignore_string_case=${TRUE} + + Should Be Empty ${diff} msg=DIFF DETECTED! diff --git a/tests/robot/AQL_TESTS/AGGREGATE_FUNCTIONS/DV_ORDERED/max_on_dv_ordered.robot b/tests/robot/AQL_TESTS/AGGREGATE_FUNCTIONS/DV_ORDERED/max_on_dv_ordered.robot new file mode 100644 index 00000000..340957f5 --- /dev/null +++ b/tests/robot/AQL_TESTS/AGGREGATE_FUNCTIONS/DV_ORDERED/max_on_dv_ordered.robot @@ -0,0 +1,42 @@ +*** Settings *** +Documentation CHECK AGGREGATE FUNCTIONS MAX ON DV_ORDERED IN AQL +... - Covers: https://github.com/ehrbase/AQL_Test_CASES/blob/main/AGGREGATE_FUNCTIONS.md#max-on-dv-ordered +... - *Precondition:* 1. Create OPT; 2. Create EHR; 3. Create Composition. +... - *Postcondition:* Delete EHR using ADMIN endpoint. This is deleting compositions linked to EHR. + +Resource ../../../_resources/keywords/aql_keywords.robot + +Library DataDriver +... file=${PROJECT_ROOT}/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/combinations/max_on_dv_ordered.csv +... dialect=excel + +Suite Setup Precondition +Suite Teardown Admin Delete EHR For AQL + + +*** Test Cases *** +SELECT MAX(${path}) FROM OBSERVATION o[openEHR-EHR-OBSERVATION.conformance_observation.v0] + [Template] Execute Query + ${path} ${expected_file} + + +*** Keywords *** +Precondition + Upload OPT For AQL conformance_ehrbase.de.v0.opt + Create EHR For AQL + Commit Composition For AQL conformance_ehrbase.de.v0_max_v3.json + +Execute Query + [Arguments] ${path} ${expected_file} + ${query} Set Variable SELECT MAX(${path}) FROM OBSERVATION o[openEHR-EHR-OBSERVATION.conformance_observation.v0] + Set AQL And Execute Ad Hoc Query ${query} + + ${expected_result} Set Variable ${EXPECTED_JSON_DATA_SETS}/aggregate_functions/${expected_file} + ${exclude_paths} Create List root['meta'] + ${diff} compare json-string with json-file + ... ${resp_body_actual} ${expected_result} + ... exclude_paths=${exclude_paths} + ... ignore_order=${TRUE} + ... ignore_string_case=${TRUE} + + Should Be Empty ${diff} msg=DIFF DETECTED! \ No newline at end of file diff --git a/tests/robot/AQL_TESTS/AGGREGATE_FUNCTIONS/DV_ORDERED/max_on_dv_text_and_dv_coded_text.robot b/tests/robot/AQL_TESTS/AGGREGATE_FUNCTIONS/DV_ORDERED/max_on_dv_text_and_dv_coded_text.robot new file mode 100644 index 00000000..be87648f --- /dev/null +++ b/tests/robot/AQL_TESTS/AGGREGATE_FUNCTIONS/DV_ORDERED/max_on_dv_text_and_dv_coded_text.robot @@ -0,0 +1,44 @@ +*** Settings *** +Documentation CHECK AGGREGATE FUNCTIONS MAX ON DV_TEXT AND DV_CODED_TEXT ON DV_ORDERED IN AQL +... - Covers: https://github.com/ehrbase/AQL_Test_CASES/blob/main/AGGREGATE_FUNCTIONS.md + +Resource ../../../_resources/keywords/aql_keywords.robot + +Suite Setup Precondition +Suite Teardown Admin Delete EHR For AQL + + +*** Variables *** +${query_max_1} SELECT MAX(o/data[at0001]/events[at0002]/data[at0003]/items[at0004]/value), o/data[at0001]/events[at0002]/data[at0003]/items[at0004]/value FROM OBSERVATION o[openEHR-EHR-OBSERVATION.conformance_observation.v0] +${query_max_2} SELECT MAX(o/data[at0001]/events[at0002]/data[at0003]/items[at0005]/value), o/data[at0001]/events[at0002]/data[at0003]/items[at0005]/value FROM OBSERVATION o[openEHR-EHR-OBSERVATION.conformance_observation.v0] + + +*** Test Cases *** +${query_max_1} + Set Test Variable ${query} ${query_max_1} + Execute Query expected_max_dv_text_dv_coded_text_at4.json + +${query_max_2} + Set Test Variable ${query} ${query_max_2} + Execute Query expected_max_dv_text_dv_coded_text_at5.json + + +*** Keywords *** +Precondition + Upload OPT For AQL conformance_ehrbase.de.v0.opt + Create EHR For AQL + Commit Composition For AQL conformance_ehrbase.de.v0_max_v3.json + +Execute Query + [Arguments] ${expected_file} + Set AQL And Execute Ad Hoc Query ${query} + + ${expected_result} Set Variable ${EXPECTED_JSON_DATA_SETS}/aggregate_functions/${expected_file} + ${exclude_paths} Create List root['meta'] + ${diff} compare json-string with json-file + ... ${resp_body_actual} ${expected_result} + ... exclude_paths=${exclude_paths} + ... ignore_order=${TRUE} + ... ignore_string_case=${TRUE} + + Should Be Empty ${diff} msg=DIFF DETECTED! \ No newline at end of file diff --git a/tests/robot/AQL_TESTS/AGGREGATE_FUNCTIONS/DV_ORDERED/min_on_dv_ordered.robot b/tests/robot/AQL_TESTS/AGGREGATE_FUNCTIONS/DV_ORDERED/min_on_dv_ordered.robot new file mode 100644 index 00000000..42e62325 --- /dev/null +++ b/tests/robot/AQL_TESTS/AGGREGATE_FUNCTIONS/DV_ORDERED/min_on_dv_ordered.robot @@ -0,0 +1,42 @@ +*** Settings *** +Documentation CHECK AGGREGATE FUNCTIONS MIN ON DV_ORDERED IN AQL +... - Covers: https://github.com/ehrbase/AQL_Test_CASES/blob/main/AGGREGATE_FUNCTIONS.md#min-on-dv_ordered +... - *Precondition:* 1. Create OPT; 2. Create EHR; 3. Create Composition. +... - *Postcondition:* Delete EHR using ADMIN endpoint. This is deleting compositions linked to EHR. + +Resource ../../../_resources/keywords/aql_keywords.robot + +Library DataDriver +... file=${PROJECT_ROOT}/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/combinations/min_on_dv_ordered.csv +... dialect=excel + +Suite Setup Precondition +Suite Teardown Admin Delete EHR For AQL + + +*** Test Cases *** +SELECT MIN(${path}) FROM OBSERVATION o[openEHR-EHR-OBSERVATION.conformance_observation.v0] + [Template] Execute Query + ${path} ${expected_file} + + +*** Keywords *** +Precondition + Upload OPT For AQL conformance_ehrbase.de.v0.opt + Create EHR For AQL + Commit Composition For AQL conformance_ehrbase.de.v0_max_v3.json + +Execute Query + [Arguments] ${path} ${expected_file} + ${query} Set Variable SELECT MIN(${path}) FROM OBSERVATION o[openEHR-EHR-OBSERVATION.conformance_observation.v0] + Set AQL And Execute Ad Hoc Query ${query} + + ${expected_result} Set Variable ${EXPECTED_JSON_DATA_SETS}/aggregate_functions/${expected_file} + ${exclude_paths} Create List root['meta'] + ${diff} compare json-string with json-file + ... ${resp_body_actual} ${expected_result} + ... exclude_paths=${exclude_paths} + ... ignore_order=${TRUE} + ... ignore_string_case=${TRUE} + + Should Be Empty ${diff} msg=DIFF DETECTED! \ No newline at end of file diff --git a/tests/robot/AQL_TESTS/AGGREGATE_FUNCTIONS/DV_ORDERED/sum_on_dv_ordered_not_implemented.robot b/tests/robot/AQL_TESTS/AGGREGATE_FUNCTIONS/DV_ORDERED/sum_on_dv_ordered_not_implemented.robot new file mode 100644 index 00000000..93c397f6 --- /dev/null +++ b/tests/robot/AQL_TESTS/AGGREGATE_FUNCTIONS/DV_ORDERED/sum_on_dv_ordered_not_implemented.robot @@ -0,0 +1,40 @@ +*** Settings *** +Documentation CHECK AGGREGATE FUNCTIONS AVG NOT IMPLEMENTED ON DV_ORDERED IN AQL +... - Covers: https://github.com/ehrbase/AQL_Test_CASES/blob/main/AGGREGATE_FUNCTIONS.md#sum-on-dv-ordered + +Resource ../../../_resources/keywords/aql_keywords.robot + +Library DataDriver +... file=${PROJECT_ROOT}/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/combinations/sum_on_dv_ordered.csv +... dialect=excel + +Suite Setup Precondition +Suite Teardown Admin Delete EHR For AQL + + +*** Test Cases *** +SELECT SUM(${path}) FROM OBSERVATION o[openEHR-EHR-OBSERVATION.conformance_observation.v0] + [Template] Execute Query + ${path} ${expected_file} + + +*** Keywords *** +Precondition + Upload OPT For AQL conformance_ehrbase.de.v0.opt + Create EHR For AQL + Commit Composition For AQL conformance_ehrbase.de.v0_max_v3.json + +Execute Query + [Arguments] ${path} ${expected_file} + ${query} Set Variable SELECT SUM(${path}) FROM OBSERVATION o[openEHR-EHR-OBSERVATION.conformance_observation.v0] + Set AQL And Execute Ad Hoc Query ${query} + + ${expected_result} Set Variable ${EXPECTED_JSON_DATA_SETS}/aggregate_functions/${expected_file} + ${exclude_paths} Create List root['meta'] + ${diff} compare json-string with json-file + ... ${resp_body_actual} ${expected_result} + ... exclude_paths=${exclude_paths} + ... ignore_order=${TRUE} + ... ignore_string_case=${TRUE} + + Should Be Empty ${diff} msg=DIFF DETECTED! diff --git a/tests/robot/AQL_TESTS/AGGREGATE_FUNCTIONS/NON_COUNT_AGGREGATE_FUNCTIONS_ON_PATHS_WITH_KNOWN_TYPE/max.robot b/tests/robot/AQL_TESTS/AGGREGATE_FUNCTIONS/NON_COUNT_AGGREGATE_FUNCTIONS_ON_PATHS_WITH_KNOWN_TYPE/max.robot index 3afa12c9..d61626d1 100644 --- a/tests/robot/AQL_TESTS/AGGREGATE_FUNCTIONS/NON_COUNT_AGGREGATE_FUNCTIONS_ON_PATHS_WITH_KNOWN_TYPE/max.robot +++ b/tests/robot/AQL_TESTS/AGGREGATE_FUNCTIONS/NON_COUNT_AGGREGATE_FUNCTIONS_ON_PATHS_WITH_KNOWN_TYPE/max.robot @@ -1,6 +1,6 @@ *** Settings *** Documentation CHECK AGGREGATE FUNCTIONS IN AQL -... - Covers: https://github.com/ehrbase/AQL_Test_CASES/blob/main/AGGREGATE_FUNCTIONS.md#min +... - Covers: https://github.com/ehrbase/AQL_Test_CASES/blob/main/AGGREGATE_FUNCTIONS.md#max ... - *Precondition:* 1. Create OPT; 2. Create EHR; 3. Create Composition. ... - *Postcondition:* Delete EHR using ADMIN endpoint. This is deleting compositions linked to EHR. Resource ../../../_resources/keywords/aql_keywords.robot diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/combinations/avg_on_dv_ordered.csv b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/combinations/avg_on_dv_ordered.csv new file mode 100644 index 00000000..d7d4ade2 --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/combinations/avg_on_dv_ordered.csv @@ -0,0 +1,9 @@ +${path},${expected_file} +"o/data[at0001]/events[at0002]/data[at0003]/items[at0008]/value",expected_avg_on_dv_ordered_at8_quantity.json +"o/data[at0001]/events[at0002]/data[at0003]/items[at0009]/value",expected_avg_on_dv_ordered_at9_proportion.json +"o/data[at0001]/events[at0002]/data[at0003]/items[at0010]/value",expected_avg_on_dv_ordered_at10_count.json +"o/data[at0001]/events[at0002]/data[at0003]/items[at0011]/value",expected_avg_on_dv_ordered_at11_datetime.json +"o/data[at0001]/events[at0002]/data[at0003]/items[at0012]/value",expected_avg_on_dv_ordered_at12_time.json +"o/data[at0001]/events[at0002]/data[at0003]/items[at0013]/value",expected_avg_on_dv_ordered_at13_date.json +"o/data[at0001]/events[at0002]/data[at0003]/items[at0014]/value",expected_avg_on_dv_ordered_at14_ordinal.json +"o/data[at0001]/events[at0002]/data[at0003]/items[at0018]/value",expected_avg_on_dv_ordered_at18_duration.json \ No newline at end of file diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/combinations/count_on_paths.csv b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/combinations/count_on_paths.csv index 27d196d6..99d9e396 100644 --- a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/combinations/count_on_paths.csv +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/combinations/count_on_paths.csv @@ -1,7 +1,10 @@ ${path},${nr_of_results},${expected_value} "*",1,1 +"o/data[at0001]/events[at0002]/data[at0003]/items[at0004]/value",1,3 "o/data[at0001]/events[at0002]/data[at0003]/items[at0004]/value/value",1,3 +"o/data[at0001]/events[at0002]/data[at0003]/items[at0005]/value",1,3 "o/data[at0001]/events[at0002]/data[at0003]/items[at0005]/value/value",1,3 +"o/data[at0001]/events[at0002]/data[at0003]/items[at0008]/value",1,2 "o/data[at0001]/events[at0002]/data[at0003]/items[at0008]/value/units",1,2 "o/data[at0001]/events[at0002]/data[at0003]/items[at0008]/value/magnitude",1,2 "o/data[at0001]/events[at0002]/data[at0003]/items[at0008]/null_flavour/value",1,1 diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/combinations/max_on_dv_ordered.csv b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/combinations/max_on_dv_ordered.csv new file mode 100644 index 00000000..56e291fb --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/combinations/max_on_dv_ordered.csv @@ -0,0 +1,9 @@ +${path},${expected_file} +"o/data[at0001]/events[at0002]/data[at0003]/items[at0008]/value",expected_max_on_dv_ordered_at8_quantity.json +"o/data[at0001]/events[at0002]/data[at0003]/items[at0009]/value",expected_max_on_dv_ordered_at9_proportion.json +"o/data[at0001]/events[at0002]/data[at0003]/items[at0010]/value",expected_max_on_dv_ordered_at10_count.json +"o/data[at0001]/events[at0002]/data[at0003]/items[at0011]/value",expected_max_on_dv_ordered_at11_datetime.json +"o/data[at0001]/events[at0002]/data[at0003]/items[at0012]/value",expected_max_on_dv_ordered_at12_time.json +"o/data[at0001]/events[at0002]/data[at0003]/items[at0013]/value",expected_max_on_dv_ordered_at13_date.json +"o/data[at0001]/events[at0002]/data[at0003]/items[at0014]/value",expected_max_on_dv_ordered_at14_ordinal.json +"o/data[at0001]/events[at0002]/data[at0003]/items[at0018]/value",expected_max_on_dv_ordered_at18_duration.json diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/combinations/min_on_dv_ordered.csv b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/combinations/min_on_dv_ordered.csv new file mode 100644 index 00000000..1eb1b78e --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/combinations/min_on_dv_ordered.csv @@ -0,0 +1,9 @@ +${path},${expected_file} +"o/data[at0001]/events[at0002]/data[at0003]/items[at0008]/value",expected_min_on_dv_ordered_at8_quantity.json +"o/data[at0001]/events[at0002]/data[at0003]/items[at0009]/value",expected_min_on_dv_ordered_at9_proportion.json +"o/data[at0001]/events[at0002]/data[at0003]/items[at0010]/value",expected_min_on_dv_ordered_at10_count.json +"o/data[at0001]/events[at0002]/data[at0003]/items[at0011]/value",expected_min_on_dv_ordered_at11_datetime.json +"o/data[at0001]/events[at0002]/data[at0003]/items[at0012]/value",expected_min_on_dv_ordered_at12_time.json +"o/data[at0001]/events[at0002]/data[at0003]/items[at0013]/value",expected_min_on_dv_ordered_at13_date.json +"o/data[at0001]/events[at0002]/data[at0003]/items[at0014]/value",expected_min_on_dv_ordered_at14_ordinal.json +"o/data[at0001]/events[at0002]/data[at0003]/items[at0018]/value",expected_min_on_dv_ordered_at18_duration.json diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/combinations/sum_on_dv_ordered.csv b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/combinations/sum_on_dv_ordered.csv new file mode 100644 index 00000000..d1ad171e --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/combinations/sum_on_dv_ordered.csv @@ -0,0 +1,9 @@ +${path},${expected_file} +"o/data[at0001]/events[at0002]/data[at0003]/items[at0008]/value",expected_sum_on_dv_ordered_at8_quantity.json +"o/data[at0001]/events[at0002]/data[at0003]/items[at0009]/value",expected_sum_on_dv_ordered_at9_proportion.json +"o/data[at0001]/events[at0002]/data[at0003]/items[at0010]/value",expected_sum_on_dv_ordered_at10_count.json +"o/data[at0001]/events[at0002]/data[at0003]/items[at0011]/value",expected_sum_on_dv_ordered_at11_datetime.json +"o/data[at0001]/events[at0002]/data[at0003]/items[at0012]/value",expected_sum_on_dv_ordered_at12_time.json +"o/data[at0001]/events[at0002]/data[at0003]/items[at0013]/value",expected_sum_on_dv_ordered_at13_date.json +"o/data[at0001]/events[at0002]/data[at0003]/items[at0014]/value",expected_sum_on_dv_ordered_at14_ordinal.json +"o/data[at0001]/events[at0002]/data[at0003]/items[at0018]/value",expected_sum_on_dv_ordered_at18_duration.json \ No newline at end of file diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_avg_on_dv_ordered_at10_count.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_avg_on_dv_ordered_at10_count.json new file mode 100644 index 00000000..e69de29b diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_avg_on_dv_ordered_at11_datetime.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_avg_on_dv_ordered_at11_datetime.json new file mode 100644 index 00000000..e69de29b diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_avg_on_dv_ordered_at12_time.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_avg_on_dv_ordered_at12_time.json new file mode 100644 index 00000000..e69de29b diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_avg_on_dv_ordered_at13_date.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_avg_on_dv_ordered_at13_date.json new file mode 100644 index 00000000..e69de29b diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_avg_on_dv_ordered_at14_ordinal.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_avg_on_dv_ordered_at14_ordinal.json new file mode 100644 index 00000000..e69de29b diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_avg_on_dv_ordered_at18_duration.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_avg_on_dv_ordered_at18_duration.json new file mode 100644 index 00000000..e69de29b diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_avg_on_dv_ordered_at8_quantity.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_avg_on_dv_ordered_at8_quantity.json new file mode 100644 index 00000000..e69de29b diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_avg_on_dv_ordered_at9_proportion.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_avg_on_dv_ordered_at9_proportion.json new file mode 100644 index 00000000..e69de29b diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_max_dv_text_dv_coded_text_at4.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_max_dv_text_dv_coded_text_at4.json new file mode 100644 index 00000000..d238bd20 --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_max_dv_text_dv_coded_text_at4.json @@ -0,0 +1,68 @@ +{ + "meta": { + "_type": "RESULTSET", + "_schema_version": "1.0.4", + "_created": "2024-02-07T14:27:03.3849392+02:00", + "_executed_aql": "SELECT MAX(o/data[at0001]/events[at0002]/data[at0003]/items[at0004]/value), o/data[at0001]/events[at0002]/data[at0003]/items[at0004]/value FROM OBSERVATION o[openEHR-EHR-OBSERVATION.conformance_observation.v0]", + "resultsize": 3 + }, + "q": "SELECT MAX(o/data[at0001]/events[at0002]/data[at0003]/items[at0004]/value), o/data[at0001]/events[at0002]/data[at0003]/items[at0004]/value FROM OBSERVATION o[openEHR-EHR-OBSERVATION.conformance_observation.v0]", + "columns": [ + { + "name": "#0" + }, + { + "path": "o/data[at0001]/events[at0002]/data[at0003]/items[at0004]/value", + "name": "#1" + } + ], + "rows": [ + [ + null, + { + "_type": "DV_TEXT", + "value": "Lorem ipsum2" + } + ], + [ + null, + { + "_type": "DV_TEXT", + "value": "Lorem ipsum", + "mappings": [ + { + "_type": "TERM_MAPPING", + "match": "=", + "target": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "SNOMED-CT" + }, + "code_string": "21794005" + } + }, + { + "_type": "TERM_MAPPING", + "match": ">", + "target": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "SNOMED-CT" + }, + "code_string": "21794000" + } + } + ] + } + ], + [ + null, + { + "_type": "DV_TEXT", + "value": "Lorem ipsum3" + } + ] + ] +} \ No newline at end of file diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_max_dv_text_dv_coded_text_at5.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_max_dv_text_dv_coded_text_at5.json new file mode 100644 index 00000000..32370096 --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_max_dv_text_dv_coded_text_at5.json @@ -0,0 +1,36 @@ +{ + "meta": { + "_type": "RESULTSET", + "_schema_version": "1.0.4", + "_created": "2024-02-07T14:27:07.9863062+02:00", + "_executed_aql": "SELECT MAX(o/data[at0001]/events[at0002]/data[at0003]/items[at0005]/value), o/data[at0001]/events[at0002]/data[at0003]/items[at0005]/value FROM OBSERVATION o[openEHR-EHR-OBSERVATION.conformance_observation.v0]", + "resultsize": 1 + }, + "q": "SELECT MAX(o/data[at0001]/events[at0002]/data[at0003]/items[at0005]/value), o/data[at0001]/events[at0002]/data[at0003]/items[at0005]/value FROM OBSERVATION o[openEHR-EHR-OBSERVATION.conformance_observation.v0]", + "columns": [ + { + "name": "#0" + }, + { + "path": "o/data[at0001]/events[at0002]/data[at0003]/items[at0005]/value", + "name": "#1" + } + ], + "rows": [ + [ + null, + { + "_type": "DV_CODED_TEXT", + "value": "term1", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "local" + }, + "code_string": "at0006" + } + } + ] + ] +} \ No newline at end of file diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_max_on_dv_ordered_at10_count.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_max_on_dv_ordered_at10_count.json new file mode 100644 index 00000000..4d4ed013 --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_max_on_dv_ordered_at10_count.json @@ -0,0 +1,16 @@ +{ + "q": "SELECT MAX(o/data[at0001]/events[at0002]/data[at0003]/items[at0010]/value) FROM OBSERVATION o[openEHR-EHR-OBSERVATION.conformance_observation.v0]", + "columns": [ + { + "name": "#0" + } + ], + "rows": [ + [ + { + "_type": "DV_COUNT", + "magnitude": 400 + } + ] + ] +} diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_max_on_dv_ordered_at11_datetime.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_max_on_dv_ordered_at11_datetime.json new file mode 100644 index 00000000..a26029df --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_max_on_dv_ordered_at11_datetime.json @@ -0,0 +1,16 @@ +{ + "q": "SELECT MAX(o/data[at0001]/events[at0002]/data[at0003]/items[at0011]/value) FROM OBSERVATION o[openEHR-EHR-OBSERVATION.conformance_observation.v0]", + "columns": [ + { + "name": "#0" + } + ], + "rows": [ + [ + { + "_type": "DV_DATE_TIME", + "value": "2023-02-03T04:05:06" + } + ] + ] +} diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_max_on_dv_ordered_at12_time.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_max_on_dv_ordered_at12_time.json new file mode 100644 index 00000000..affd208b --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_max_on_dv_ordered_at12_time.json @@ -0,0 +1,16 @@ +{ + "q": "SELECT MAX(o/data[at0001]/events[at0002]/data[at0003]/items[at0012]/value) FROM OBSERVATION o[openEHR-EHR-OBSERVATION.conformance_observation.v0]", + "columns": [ + { + "name": "#0" + } + ], + "rows": [ + [ + { + "_type": "DV_TIME", + "value": "05:05:06" + } + ] + ] +} diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_max_on_dv_ordered_at13_date.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_max_on_dv_ordered_at13_date.json new file mode 100644 index 00000000..867e0de6 --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_max_on_dv_ordered_at13_date.json @@ -0,0 +1,16 @@ +{ + "q": "SELECT MAX(o/data[at0001]/events[at0002]/data[at0003]/items[at0013]/value) FROM OBSERVATION o[openEHR-EHR-OBSERVATION.conformance_observation.v0]", + "columns": [ + { + "name": "#0" + } + ], + "rows": [ + [ + { + "_type": "DV_DATE", + "value": "2023-02-03" + } + ] + ] +} diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_max_on_dv_ordered_at14_ordinal.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_max_on_dv_ordered_at14_ordinal.json new file mode 100644 index 00000000..23829384 --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_max_on_dv_ordered_at14_ordinal.json @@ -0,0 +1,28 @@ +{ + "q": "SELECT MAX(o/data[at0001]/events[at0002]/data[at0003]/items[at0014]/value) FROM OBSERVATION o[openEHR-EHR-OBSERVATION.conformance_observation.v0]", + "columns": [ + { + "name": "#0" + } + ], + "rows": [ + [ + { + "_type": "DV_ORDINAL", + "symbol": { + "_type": "DV_CODED_TEXT", + "value": "value2", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "local" + }, + "code_string": "at0016" + } + }, + "value": 2 + } + ] + ] +} diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_max_on_dv_ordered_at18_duration.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_max_on_dv_ordered_at18_duration.json new file mode 100644 index 00000000..2fef0a6b --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_max_on_dv_ordered_at18_duration.json @@ -0,0 +1,16 @@ +{ + "q": "SELECT MAX(o/data[at0001]/events[at0002]/data[at0003]/items[at0018]/value) FROM OBSERVATION o[openEHR-EHR-OBSERVATION.conformance_observation.v0]", + "columns": [ + { + "name": "#0" + } + ], + "rows": [ + [ + { + "_type": "DV_DURATION", + "value": "PT6M40S" + } + ] + ] +} diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_max_on_dv_ordered_at8_quantity.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_max_on_dv_ordered_at8_quantity.json new file mode 100644 index 00000000..3d0e6cb2 --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_max_on_dv_ordered_at8_quantity.json @@ -0,0 +1,17 @@ +{ + "q": "SELECT MAX(o/data[at0001]/events[at0002]/data[at0003]/items[at0008]/value) FROM OBSERVATION o[openEHR-EHR-OBSERVATION.conformance_observation.v0]", + "columns": [ + { + "name": "#0" + } + ], + "rows": [ + [ + { + "_type": "DV_QUANTITY", + "units": "mm", + "magnitude": 82.0 + } + ] + ] +} diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_max_on_dv_ordered_at9_proportion.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_max_on_dv_ordered_at9_proportion.json new file mode 100644 index 00000000..88dd623f --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_max_on_dv_ordered_at9_proportion.json @@ -0,0 +1,18 @@ +{ + "q": "SELECT MAX(o/data[at0001]/events[at0002]/data[at0003]/items[at0009]/value) FROM OBSERVATION o[openEHR-EHR-OBSERVATION.conformance_observation.v0]", + "columns": [ + { + "name": "#0" + } + ], + "rows": [ + [ + { + "_type": "DV_PROPORTION", + "numerator": 40.0, + "denominator": 2.0, + "type": 3 + } + ] + ] +} diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_min_on_dv_ordered_at10_count.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_min_on_dv_ordered_at10_count.json new file mode 100644 index 00000000..9a7889b0 --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_min_on_dv_ordered_at10_count.json @@ -0,0 +1,16 @@ +{ + "q": "SELECT MIN(o/data[at0001]/events[at0002]/data[at0003]/items[at0010]/value) FROM OBSERVATION o[openEHR-EHR-OBSERVATION.conformance_observation.v0]", + "columns": [ + { + "name": "#0" + } + ], + "rows": [ + [ + { + "_type": "DV_COUNT", + "magnitude": 42 + } + ] + ] +} diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_min_on_dv_ordered_at11_datetime.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_min_on_dv_ordered_at11_datetime.json new file mode 100644 index 00000000..34c1a47c --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_min_on_dv_ordered_at11_datetime.json @@ -0,0 +1,16 @@ +{ + "q": "SELECT MIN(o/data[at0001]/events[at0002]/data[at0003]/items[at0011]/value) FROM OBSERVATION o[openEHR-EHR-OBSERVATION.conformance_observation.v0]", + "columns": [ + { + "name": "#0" + } + ], + "rows": [ + [ + { + "_type": "DV_DATE_TIME", + "value": "2022-02-03T04:05:06" + } + ] + ] +} diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_min_on_dv_ordered_at12_time.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_min_on_dv_ordered_at12_time.json new file mode 100644 index 00000000..8014b1c3 --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_min_on_dv_ordered_at12_time.json @@ -0,0 +1,16 @@ +{ + "q": "SELECT MIN(o/data[at0001]/events[at0002]/data[at0003]/items[at0012]/value) FROM OBSERVATION o[openEHR-EHR-OBSERVATION.conformance_observation.v0]", + "columns": [ + { + "name": "#0" + } + ], + "rows": [ + [ + { + "_type": "DV_TIME", + "value": "04:05:06" + } + ] + ] +} diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_min_on_dv_ordered_at13_date.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_min_on_dv_ordered_at13_date.json new file mode 100644 index 00000000..52db6616 --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_min_on_dv_ordered_at13_date.json @@ -0,0 +1,16 @@ +{ + "q": "SELECT MIN(o/data[at0001]/events[at0002]/data[at0003]/items[at0013]/value) FROM OBSERVATION o[openEHR-EHR-OBSERVATION.conformance_observation.v0]", + "columns": [ + { + "name": "#0" + } + ], + "rows": [ + [ + { + "_type": "DV_DATE", + "value": "2022-02-03" + } + ] + ] +} diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_min_on_dv_ordered_at14_ordinal.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_min_on_dv_ordered_at14_ordinal.json new file mode 100644 index 00000000..d8eebd65 --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_min_on_dv_ordered_at14_ordinal.json @@ -0,0 +1,28 @@ +{ + "q": "SELECT MIN(o/data[at0001]/events[at0002]/data[at0003]/items[at0014]/value) FROM OBSERVATION o[openEHR-EHR-OBSERVATION.conformance_observation.v0]", + "columns": [ + { + "name": "#0" + } + ], + "rows": [ + [ + { + "_type": "DV_ORDINAL", + "symbol": { + "_type": "DV_CODED_TEXT", + "value": "value1", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "local" + }, + "code_string": "at0015" + } + }, + "value": 1 + } + ] + ] +} \ No newline at end of file diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_min_on_dv_ordered_at18_duration.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_min_on_dv_ordered_at18_duration.json new file mode 100644 index 00000000..16dddbaa --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_min_on_dv_ordered_at18_duration.json @@ -0,0 +1,16 @@ +{ + "q": "SELECT MIN(o/data[at0001]/events[at0002]/data[at0003]/items[at0018]/value) FROM OBSERVATION o[openEHR-EHR-OBSERVATION.conformance_observation.v0]", + "columns": [ + { + "name": "#0" + } + ], + "rows": [ + [ + { + "_type": "DV_DURATION", + "value": "PT0S" + } + ] + ] +} diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_min_on_dv_ordered_at8_quantity.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_min_on_dv_ordered_at8_quantity.json new file mode 100644 index 00000000..66f155ce --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_min_on_dv_ordered_at8_quantity.json @@ -0,0 +1,17 @@ +{ + "q": "SELECT MIN(o/data[at0001]/events[at0002]/data[at0003]/items[at0008]/value) FROM OBSERVATION o[openEHR-EHR-OBSERVATION.conformance_observation.v0]", + "columns": [ + { + "name": "#0" + } + ], + "rows": [ + [ + { + "_type": "DV_QUANTITY", + "units": "mm", + "magnitude": 22.0 + } + ] + ] +} diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_min_on_dv_ordered_at9_proportion.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_min_on_dv_ordered_at9_proportion.json new file mode 100644 index 00000000..ea5fe826 --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_min_on_dv_ordered_at9_proportion.json @@ -0,0 +1,18 @@ +{ + "q": "SELECT MIN(o/data[at0001]/events[at0002]/data[at0003]/items[at0009]/value) FROM OBSERVATION o[openEHR-EHR-OBSERVATION.conformance_observation.v0]", + "columns": [ + { + "name": "#0" + } + ], + "rows": [ + [ + { + "_type": "DV_PROPORTION", + "numerator": 20.0, + "denominator": 2.0, + "type": 3 + } + ] + ] +} diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_sum_on_dv_ordered_at10_count.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_sum_on_dv_ordered_at10_count.json new file mode 100644 index 00000000..e69de29b diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_sum_on_dv_ordered_at11_datetime.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_sum_on_dv_ordered_at11_datetime.json new file mode 100644 index 00000000..e69de29b diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_sum_on_dv_ordered_at12_time.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_sum_on_dv_ordered_at12_time.json new file mode 100644 index 00000000..e69de29b diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_sum_on_dv_ordered_at13_date.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_sum_on_dv_ordered_at13_date.json new file mode 100644 index 00000000..e69de29b diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_sum_on_dv_ordered_at14_ordinal.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_sum_on_dv_ordered_at14_ordinal.json new file mode 100644 index 00000000..e69de29b diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_sum_on_dv_ordered_at18_duration.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_sum_on_dv_ordered_at18_duration.json new file mode 100644 index 00000000..e69de29b diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_sum_on_dv_ordered_at8_quantity.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_sum_on_dv_ordered_at8_quantity.json new file mode 100644 index 00000000..e69de29b diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_sum_on_dv_ordered_at9_proportion.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/aggregate_functions/expected_sum_on_dv_ordered_at9_proportion.json new file mode 100644 index 00000000..e69de29b