diff --git a/tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER_CONTAINS_COMPO/folder_in_folder.robot b/tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER_CONTAINS_COMPO/folder_in_folder.robot new file mode 100644 index 00000000..ddd28dc9 --- /dev/null +++ b/tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER_CONTAINS_COMPO/folder_in_folder.robot @@ -0,0 +1,48 @@ +*** Settings *** +Documentation CHECK FOLDER CONTAINS COMPOSITION - Folder in Folder +... - Covers: https://github.com/ehrbase/conformance-testing-documentation/blob/main/FOLDER.md#folder-in-folder +... - *Precondition:* +... - 1. Upload OPT; 2. Create EHR; +... 3. Create 4 compositions with conformance_ehrbase.de.v0_max.json and store their compo_ids; +... - 4. Create Directory with folder_with_compositions.json; +... - Send AQL query and compare response body with expected file content. +... - *Postcondition:* Delete EHR using ADMIN endpoint. +Resource ../../../_resources/keywords/aql_keywords.robot + + +Suite Setup Precondition +Suite Teardown Admin Delete EHR For AQL + + +*** Variables *** +${q} SELECT c/uid/value FROM FOLDER f1[openEHR-EHR-FOLDER.episode_of_care.v1] CONTAINS FOLDER f2[openEHR-EHR-FOLDER.episode_of_care.v1] CONTAINS COMPOSITION c + + +*** Test Cases *** +Folder In Folder: ${q} + [Tags] not-ready + Set Test Variable ${query} ${q} + Set AQL And Execute Ad Hoc Query ${query} + Length Should Be ${resp_body['rows']} 1 + ${expected_result} Set Variable ${EXPECTED_JSON_DATA_SETS}/folder/expected_contains_compo_folder_in_folder.json + ${exclude_paths} Create List root['meta'] root['q'] + ${diff} compare json-string with json-file + ... ${resp_body_actual} ${expected_result} exclude_paths=${exclude_paths} + ... ignore_string_case=${TRUE} + Should Be Empty ${diff} msg=DIFF DETECTED! + + +*** Keywords *** +Precondition + Set Library Search Order For Tests + Upload OPT For AQL conformance_ehrbase.de.v0.opt + Create EHR For AQL + Commit Composition For AQL conformance_ehrbase.de.v0_max.json + Set Suite Variable ${c_uid1} ${composition_short_uid} + Commit Composition For AQL conformance_ehrbase.de.v0_max.json + Set Suite Variable ${c_uid2} ${composition_short_uid} + Commit Composition For AQL conformance_ehrbase.de.v0_max.json + Set Suite Variable ${c_uid3} ${composition_short_uid} + Commit Composition For AQL conformance_ehrbase.de.v0_max.json + Set Suite Variable ${c_uid4} ${composition_short_uid} + Create Directory For AQL folder_with_compositions.json has_robot_vars=${TRUE} \ No newline at end of file diff --git a/tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER_CONTAINS_COMPO/mulri_comp_in_a_folder.robot b/tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER_CONTAINS_COMPO/mulri_comp_in_a_folder.robot new file mode 100644 index 00000000..0d1207c1 --- /dev/null +++ b/tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER_CONTAINS_COMPO/mulri_comp_in_a_folder.robot @@ -0,0 +1,45 @@ +*** Settings *** +Documentation CHECK FOLDER CONTAINS COMPOSITION - Multiple Compositions in a Folder +... - Covers: https://github.com/ehrbase/conformance-testing-documentation/blob/main/FOLDER.md#multi-comp-in-a-folder +... - *Precondition:* +... - 1. Upload OPT; 2. Create EHR and store ehr_id1; +... - 3. Create 2 compositions with conformance_ehrbase.de.v0_max.json and store their compo_ids; +... - 4. Create Directory with folder_multi_compositions.json; +... - 5. Create 1 composition with conformance_ehrbase.de.v0_max.json; +... - Send AQL query and compare response body with expected file content. +... - *Postcondition:* Delete EHR using ADMIN endpoint. +Resource ../../../_resources/keywords/aql_keywords.robot + +Suite Setup Precondition +Suite Teardown Admin Delete EHR For AQL + +*** Variables *** +${q} SELECT c/uid/value FROM FOLDER f CONTAINS COMPOSITION c + + +*** Test Cases *** +Multi Comp In A Folder: ${q} + [Tags] not-ready + Set Test Variable ${query} ${q} + Set AQL And Execute Ad Hoc Query ${query} + Length Should Be ${resp_body['rows']} 2 + ${expected_result} Set Variable ${EXPECTED_JSON_DATA_SETS}/folder/expected_contains_compo_multi_compo_in_folder.json + ${exclude_paths} Create List root['meta'] root['q'] + ${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! + + +*** Keywords *** +Precondition + Set Library Search Order For Tests + Upload OPT For AQL conformance_ehrbase.de.v0.opt + Create EHR For AQL + Commit Composition For AQL conformance_ehrbase.de.v0_max.json + Set Suite Variable ${c_uid1} ${composition_short_uid} + Commit Composition For AQL conformance_ehrbase.de.v0_max.json + Set Suite Variable ${c_uid2} ${composition_short_uid} + Create Directory For AQL folder_multi_compositions.json has_robot_vars=${TRUE} + Commit Composition For AQL conformance_ehrbase.de.v0_max.json \ No newline at end of file diff --git a/tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER_CONTAINS_COMPO/over_multiple_ehrs.robot b/tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER_CONTAINS_COMPO/over_multiple_ehrs.robot new file mode 100644 index 00000000..7341c989 --- /dev/null +++ b/tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER_CONTAINS_COMPO/over_multiple_ehrs.robot @@ -0,0 +1,76 @@ +*** Settings *** +Documentation CHECK FOLDER CONTAINS COMPOSITION - Over multiple EHRs +... - Covers: https://github.com/ehrbase/conformance-testing-documentation/blob/main/FOLDER.md#over-multiple-ehrs +... - *Precondition:* +... - 1. Upload OPT; 2. Create EHR and store ehr_id1; +... - 3. Create 4 compositions with conformance_ehrbase.de.v0_max.json and store their compo_ids; +... - 4. Create Directory with folder_with_compositions.json; +... - 5. Create 1 composition with conformance_ehrbase.de.v0_max.json; +... - 6. Create EHR and store ehr_id2; +... - 7. Create 4 compositions with conformance_ehrbase.de.v0_max.json and store their compo_ids; +... - 8. Create Directory with folder_with_compositions.json; +... - 9. Create 1 composition with conformance_ehrbase.de.v0_max.json; +... - Send AQL query and compare response body with expected file content. +... - *Postcondition:* Delete EHR using ADMIN endpoint. +Resource ../../../_resources/keywords/aql_keywords.robot + + +Suite Setup Precondition +Suite Teardown Run Keywords Admin Delete EHR For AQL ${ehr_id1} AND +... Admin Delete EHR For AQL ${ehr_id2} + + +*** Variables *** +${q} SELECT e/ehr_id/value, c/uid/value FROM EHR e CONTAINS FOLDER f CONTAINS COMPOSITION c WHERE f/name/value = 'subsubsubfolder1' + + +*** Test Cases *** +Over Multiple EHRs: ${q} + [Tags] not-ready + Set Test Variable ${query} ${q} + ${temporary_file} Set Variable + ... ${EXPECTED_JSON_DATA_SETS}/folder/expected_contains_compo_over_multiple_ehrs_tmp.json + Set AQL And Execute Ad Hoc Query ${query} + Length Should Be ${resp_body['rows']} 2 + ${expected_file} Set Variable expected_contains_compo_over_multiple_ehrs.json + ${expected_res_tmp} Set Variable ${EXPECTED_JSON_DATA_SETS}/folder/${expected_file} + ${file_without_replaced_vars} Get File ${expected_res_tmp} + ${data_replaced_vars} Replace Variables ${file_without_replaced_vars} + Create File ${temporary_file} + ... ${data_replaced_vars} + ${diff} compare json-string with json-file + ... ${resp_body_actual} ${expected_result} exclude_paths=${exclude_paths} + ... ignore_string_case=${TRUE} + Should Be Empty ${diff} msg=DIFF DETECTED! + [Teardown] Remove File ${temporary_file} + + +*** Keywords *** +Precondition + Set Library Search Order For Tests + Upload OPT For AQL conformance_ehrbase.de.v0.opt + Create EHR For AQL + Set Suite Variable ${ehr_id1} ${ehr_id} + Commit Composition For AQL conformance_ehrbase.de.v0_max.json + Set Suite Variable ${c_uid1} ${composition_short_uid} + Commit Composition For AQL conformance_ehrbase.de.v0_max.json + Set Suite Variable ${c_uid2} ${composition_short_uid} + Commit Composition For AQL conformance_ehrbase.de.v0_max.json + Set Suite Variable ${c_uid3} ${composition_short_uid} + Commit Composition For AQL conformance_ehrbase.de.v0_max.json + Set Suite Variable ${c_uid4} ${composition_short_uid} + Create Directory For AQL folder_with_compositions.json has_robot_vars=${TRUE} + Commit Composition For AQL conformance_ehrbase.de.v0_max.json + ## + Create EHR For AQL + Set Suite Variable ${ehr_id2} ${ehr_id} + Commit Composition For AQL conformance_ehrbase.de.v0_max.json + Set Suite Variable ${c_uid1b} ${composition_short_uid} + Commit Composition For AQL conformance_ehrbase.de.v0_max.json + Set Suite Variable ${c_uid2b} ${composition_short_uid} + Commit Composition For AQL conformance_ehrbase.de.v0_max.json + Set Suite Variable ${c_uid3b} ${composition_short_uid} + Commit Composition For AQL conformance_ehrbase.de.v0_max.json + Set Suite Variable ${c_uid4b} ${composition_short_uid} + Create Directory For AQL folder_with_compositions1.json has_robot_vars=${TRUE} + Commit Composition For AQL conformance_ehrbase.de.v0_max.json diff --git a/tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER_CONTAINS_COMPO/select_by_name.robot b/tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER_CONTAINS_COMPO/select_by_name.robot new file mode 100644 index 00000000..4c163aaa --- /dev/null +++ b/tests/robot/AQL_TESTS/FOLDER/FROM_FOLDER_CONTAINS_COMPO/select_by_name.robot @@ -0,0 +1,60 @@ +*** Settings *** +Documentation CHECK FOLDER CONTAINS COMPOSITION - Select by name +... - Covers: https://github.com/ehrbase/conformance-testing-documentation/blob/main/FOLDER.md#select-by-name +... - *Precondition:* +... - 1. Upload OPT; 2. Create EHR; +... 3. Create 4 compositions with conformance_ehrbase.de.v0_max.json and store their compo_ids; +... - 4. Create Directory with folder_with_compositions.json; +... - Send AQL query and compare response body with expected file content. +... - *Postcondition:* Delete EHR using ADMIN endpoint. +Resource ../../../_resources/keywords/aql_keywords.robot +Library DataDriver +... file=${PROJECT_ROOT}/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/combinations/folder_contains_compo_select_by_name.csv +... dialect=excel + +Suite Setup Precondition +Suite Teardown Admin Delete EHR For AQL + + +*** Test Cases *** +${query_nr} SELECT c/uid/value FROM FOLDER f CONTAINS COMPOSITION c WHERE f/name/value = '${name}' + [Tags] not-ready + [Template] Execute Query + ${name} ${expected_file} ${nr_of_results} + + + +*** Keywords *** +Precondition + Set Library Search Order For Tests + Upload OPT For AQL conformance_ehrbase.de.v0.opt + Create EHR For AQL + Commit Composition For AQL conformance_ehrbase.de.v0_max.json + Set Suite Variable ${c_uid1} ${composition_short_uid} + Commit Composition For AQL conformance_ehrbase.de.v0_max.json + Set Suite Variable ${c_uid2} ${composition_short_uid} + Commit Composition For AQL conformance_ehrbase.de.v0_max.json + Set Suite Variable ${c_uid3} ${composition_short_uid} + Commit Composition For AQL conformance_ehrbase.de.v0_max.json + Set Suite Variable ${c_uid4} ${composition_short_uid} + Create Directory For AQL folder_with_compositions.json has_robot_vars=${TRUE} + +Execute Query + [Arguments] ${name} ${expected_file} ${nr_of_results} + ${query} Set Variable SELECT c/uid/value FROM FOLDER f CONTAINS COMPOSITION c WHERE f/name/value = '${name}' + ${expected_file_with_replaced_vars} Set Variable + ... ${EXPECTED_JSON_DATA_SETS}/folder/expected_folder_contains_compo_select_by_name_tmp.json + Set AQL And Execute Ad Hoc Query ${query} + ${expected_res_tmp} Set Variable ${EXPECTED_JSON_DATA_SETS}/folder/${expected_file} + ${file_without_replaced_vars} Get Binary File ${expected_res_tmp} + ${data_replaced_vars} Replace Variables ${file_without_replaced_vars} + Create Binary File ${expected_file_with_replaced_vars} + ... ${data_replaced_vars} + Length Should Be ${resp_body['rows']} ${nr_of_results} + ${exclude_paths} Create List root['meta'] + ${diff} compare json-string with json-file + ... ${resp_body_actual} ${expected_file_with_replaced_vars} + ... exclude_paths=${exclude_paths} + ... ignore_order=${TRUE} ignore_string_case=${TRUE} + Should Be Empty ${diff} msg=DIFF DETECTED! + [Teardown] Remove File ${expected_file_with_replaced_vars} \ No newline at end of file diff --git a/tests/robot/AQL_TESTS/FOLDER/SELECT_PATHS_IN_FOLDER/paths_in_folder.robot b/tests/robot/AQL_TESTS/FOLDER/SELECT_PATHS_IN_FOLDER/paths_in_folder.robot new file mode 100644 index 00000000..bf8ed651 --- /dev/null +++ b/tests/robot/AQL_TESTS/FOLDER/SELECT_PATHS_IN_FOLDER/paths_in_folder.robot @@ -0,0 +1,44 @@ +*** Settings *** +Documentation CHECK SELECT PATHS IN FOLDER +... - Covers: https://github.com/ehrbase/conformance-testing-documentation/blob/main/FOLDER.md#select-paths-in-folder +... - *Precondition:* +... - 1. Create EHR; +... - 2. Create Directory with folder_details.json; +... - Send AQL query and compare response body with expected file content. +... - *Postcondition:* Delete EHR using ADMIN endpoint. +Resource ../../../_resources/keywords/aql_keywords.robot +Library DataDriver +... file=${PROJECT_ROOT}/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/combinations/select_paths_in_folder.csv +... dialect=excel + +Suite Setup Precondition +Suite Teardown Admin Delete EHR For AQL + + +*** Test Cases *** +${query_nr} SELECT ${path} FROM FOLDER f + [Tags] not-ready + [Template] Execute Query + ${path} ${expected_file} ${nr_of_results} + + +*** Keywords *** +Precondition + Set Library Search Order For Tests + Create EHR For AQL + Create Directory For AQL folder_details.json has_robot_vars=${FALSE} + +Execute Query + [Arguments] ${path} ${expected_file} ${nr_of_results} + ${query} Set Variable SELECT ${path} FROM FOLDER f + Set AQL And Execute Ad Hoc Query ${query} + Log ${expected_file} + ${expected_result} Set Variable ${EXPECTED_JSON_DATA_SETS}/folder/${expected_file} + Length Should Be ${resp_body['rows']} ${nr_of_results} + ${exclude_paths} Create List root['meta'] root['rows'][0][0]['uid'] + ... root['rows'][0][0]['folders'][0]['uid'] root['rows'][1][0]['uid'] + ${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/_resources/test_data_sets/aql/data_load/folder/folder_details.json b/tests/robot/_resources/test_data_sets/aql/data_load/folder/folder_details.json new file mode 100644 index 00000000..c2a9acac --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/data_load/folder/folder_details.json @@ -0,0 +1,88 @@ +{ + "_type": "FOLDER", + "uuid": { + "_type": "HIER_OBJECT_ID", + "value": "10e952ca-a5b2-4f24-8d37-59240fd37020" + }, + "name": { + "_type": "DV_TEXT", + "value": "root1" + }, + "archetype_node_id": "openEHR-EHR-FOLDER.generic.v1", + "details": { + "_type": "ITEM_TREE", + "name": { + "_type": "DV_TEXT", + "value": "Tree" + }, + "archetype_node_id": "at0003", + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "text" + }, + "archetype_node_id": "at0004", + "value": { + "_type": "DV_TEXT", + "value": "value2" + } + } + ] + }, + "folders": [ + { + "_type": "FOLDER", + "uuid": { + "_type": "HIER_OBJECT_ID", + "value": "d936409e-901f-4994-8d33-ed104d460151" + }, + "name": { + "_type": "DV_TEXT", + "value": "subfolder1" + }, + "archetype_node_id": "openEHR-EHR-FOLDER.episode_of_care.v1", + "items": [ + { + "id": { + "_type": "HIER_OBJECT_ID", + "value": "7c0a9df0-564f-4f34-8e65-92586c64ef56" + }, + "namespace": "my.system.id", + "type": "VERSIONED_COMPOSITION" + }, + { + "id": { + "_type": "HIER_OBJECT_ID", + "value": "c68131a3-72da-41fe-8d11-c4fccfd2d2d0" + }, + "namespace": "my.system.id", + "type": "VERSIONED_COMPOSITION" + } + ], + "details": { + "_type": "ITEM_TREE", + "name": { + "_type": "DV_TEXT", + "value": "Tree" + }, + "archetype_node_id": "at0003", + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "text" + }, + "archetype_node_id": "at0004", + "value": { + "_type": "DV_TEXT", + "value": "value1" + } + } + ] + } + } + ] +} \ No newline at end of file diff --git a/tests/robot/_resources/test_data_sets/aql/data_load/folder/folder_multi_compositions.json b/tests/robot/_resources/test_data_sets/aql/data_load/folder/folder_multi_compositions.json new file mode 100644 index 00000000..83ba2798 --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/data_load/folder/folder_multi_compositions.json @@ -0,0 +1,30 @@ +{ + "_type": "FOLDER", + "uuid": { + "_type": "HIER_OBJECT_ID", + "value": "10e952ca-a5b2-4f24-8d37-59240fd37020" + }, + "name": { + "_type": "DV_TEXT", + "value": "root1" + }, + "archetype_node_id": "openEHR-EHR-FOLDER.generic.v1", + "items": [ + { + "id": { + "_type": "HIER_OBJECT_ID", + "value": "${c_uid1}" + }, + "namespace": "my.system.id", + "type": "VERSIONED_COMPOSITION" + }, + { + "id": { + "_type": "HIER_OBJECT_ID", + "value": "${c_uid2}" + }, + "namespace": "my.system.id", + "type": "VERSIONED_COMPOSITION" + } + ] +} \ No newline at end of file diff --git a/tests/robot/_resources/test_data_sets/aql/data_load/folder/folder_with_compositions1.json b/tests/robot/_resources/test_data_sets/aql/data_load/folder/folder_with_compositions1.json new file mode 100644 index 00000000..0665a6ae --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/data_load/folder/folder_with_compositions1.json @@ -0,0 +1,107 @@ +{ + "_type": "FOLDER", + "uuid": { + "_type": "HIER_OBJECT_ID", + "value": "10e952ca-a5b2-4f24-8d37-59240fd37020" + }, + "name": { + "_type": "DV_TEXT", + "value": "root1" + }, + "archetype_node_id": "openEHR-EHR-FOLDER.generic.v1", + "folders": [ + { + "_type": "FOLDER", + "uuid": { + "_type": "HIER_OBJECT_ID", + "value": "d936409e-901f-4994-8d33-ed104d460151" + }, + "name": { + "_type": "DV_TEXT", + "value": "subfolder1" + }, + "archetype_node_id": "openEHR-EHR-FOLDER.generic.v1", + "folders": [ + { + "_type": "FOLDER", + "uuid": { + "_type": "HIER_OBJECT_ID", + "value": "0cc504b1-4d6d-4cd5-81d9-0ef1b870edb3" + }, + "name": { + "_type": "DV_TEXT", + "value": "subsubfolder1" + }, + "folders": [ + { + "_type": "FOLDER", + "uuid": { + "_type": "HIER_OBJECT_ID", + "value": "70939d97-8add-4419-b27c-516e64b1c744 " + }, + "name": { + "_type": "DV_TEXT", + "value": "subsubsubfolder2" + }, + "items": [ + { + "id": { + "_type": "HIER_OBJECT_ID", + "value": "${c_uid4b}" + }, + "namespace": "my.system.id", + "type": "VERSIONED_COMPOSITION" + } + ], + "archetype_node_id": "openEHR-EHR-FOLDER.episode_of_care.v1" + } + ], + "items": [ + { + "id": { + "_type": "HIER_OBJECT_ID", + "value": "${c_uid2b}" + }, + "namespace": "my.system.id", + "type": "VERSIONED_COMPOSITION" + } + ], + "archetype_node_id": "openEHR-EHR-FOLDER.episode_of_care.v1" + }, + { + "_type": "FOLDER", + "uuid": { + "_type": "HIER_OBJECT_ID", + "value": "643b71ca-f9d5-4d84-9f39-b2d89cbab44a" + }, + "name": { + "_type": "DV_TEXT", + "value": "subsubfolder2" + }, + "items": [ + { + "id": { + "_type": "HIER_OBJECT_ID", + "value": "${c_uid3b}" + }, + "namespace": "my.system.id", + "type": "VERSIONED_COMPOSITION" + } + ], + "archetype_node_id": "openEHR-EHR-FOLDER.episode_of_care.v1" + } + + ], + "items": [ + { + "id": { + "_type": "HIER_OBJECT_ID", + "value": "${c_uid1b}" + }, + "namespace": "my.system.id", + "type": "VERSIONED_COMPOSITION" + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/combinations/folder_contains_compo_select_by_name.csv b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/combinations/folder_contains_compo_select_by_name.csv new file mode 100644 index 00000000..ea7c107f --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/combinations/folder_contains_compo_select_by_name.csv @@ -0,0 +1,6 @@ +${query_nr},${name},${expected_file},${nr_of_results} +1.,root1,expected_folder_contains_compo_select_by_name_root1.json,4 +2.,subfolder1,expected_folder_contains_compo_select_by_name_subfolder1.json,4 +3.,subsubfolder1,expected_folder_contains_compo_select_by_name_subsubfolder1.json,2 +4.,subsubfolder2,expected_folder_contains_compo_select_by_name_subsubfolder2.json,1 +4.,subsubsubfolder1,expected_folder_contains_compo_select_by_name_subsubsubfolder1.json,1 \ No newline at end of file diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/combinations/select_paths_in_folder.csv b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/combinations/select_paths_in_folder.csv new file mode 100644 index 00000000..7d520c9f --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/combinations/select_paths_in_folder.csv @@ -0,0 +1,6 @@ +${query_nr},${path},${expected_file},${nr_of_results} +1.,f,expected_select_paths_in_folder_f.json,2 +2.,f/items/id/value,expected_select_paths_in_folder_items_id_value.json,3 +3.,f/items,expected_select_paths_in_folder_f_items.json,3 +4.,f/details,expected_select_paths_in_folder_f_details.json,2 +5.,f/details[at0003]/items[at0004]/value,expected_select_paths_in_folder_f_details_at4_val.json,2 \ No newline at end of file diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_contains_compo_folder_in_folder.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_contains_compo_folder_in_folder.json new file mode 100644 index 00000000..e69de29b diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_contains_compo_multi_compo_in_folder.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_contains_compo_multi_compo_in_folder.json new file mode 100644 index 00000000..e69de29b diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_contains_compo_over_multiple_ehrs.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_contains_compo_over_multiple_ehrs.json new file mode 100644 index 00000000..e69de29b diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_folder_contains_compo_select_by_name_root1.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_folder_contains_compo_select_by_name_root1.json new file mode 100644 index 00000000..e69de29b diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_folder_contains_compo_select_by_name_subfolder1.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_folder_contains_compo_select_by_name_subfolder1.json new file mode 100644 index 00000000..e69de29b diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_folder_contains_compo_select_by_name_subsubfolder1.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_folder_contains_compo_select_by_name_subsubfolder1.json new file mode 100644 index 00000000..e69de29b diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_folder_contains_compo_select_by_name_subsubfolder2.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_folder_contains_compo_select_by_name_subsubfolder2.json new file mode 100644 index 00000000..e69de29b diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_folder_contains_compo_select_by_name_subsubsubfolder1.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_folder_contains_compo_select_by_name_subsubsubfolder1.json new file mode 100644 index 00000000..e69de29b diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_select_paths_in_folder_f.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_select_paths_in_folder_f.json new file mode 100644 index 00000000..8c6f8b5f --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_select_paths_in_folder_f.json @@ -0,0 +1,166 @@ +{ + "meta": { + "_type": "RESULTSET", + "_schema_version": "1.0.3", + "_created": "2024-09-19T17:43:55.2385056+03:00", + "_executed_aql": "SELECT f FROM FOLDER f", + "resultsize": 2 + }, + "q": "SELECT f FROM FOLDER f", + "columns": [ + { + "path": "f", + "name": "#0" + } + ], + "rows": [ + [ + { + "_type": "FOLDER", + "name": { + "_type": "DV_TEXT", + "value": "root1" + }, + "folders": [ + { + "_type": "FOLDER", + "name": { + "_type": "DV_TEXT", + "value": "subfolder1" + }, + "items": [ + { + "_type": "OBJECT_REF", + "namespace": "my.system.id", + "type": "VERSIONED_COMPOSITION", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "7c0a9df0-564f-4f34-8e65-92586c64ef56" + } + }, + { + "_type": "OBJECT_REF", + "namespace": "my.system.id", + "type": "VERSIONED_COMPOSITION", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "c68131a3-72da-41fe-8d11-c4fccfd2d2d0" + } + } + ], + "details": { + "_type": "ITEM_TREE", + "name": { + "_type": "DV_TEXT", + "value": "Tree" + }, + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "text" + }, + "value": { + "_type": "DV_TEXT", + "value": "value1" + }, + "archetype_node_id": "at0004" + } + ], + "archetype_node_id": "at0003" + }, + "archetype_node_id": "openEHR-EHR-FOLDER.episode_of_care.v1", + "uid": { + "_type": "HIER_OBJECT_ID", + "value": "8a6d7c34-4a6e-481a-ae57-f1a7ef63840d" + } + } + ], + "details": { + "_type": "ITEM_TREE", + "name": { + "_type": "DV_TEXT", + "value": "Tree" + }, + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "text" + }, + "value": { + "_type": "DV_TEXT", + "value": "value2" + }, + "archetype_node_id": "at0004" + } + ], + "archetype_node_id": "at0003" + }, + "archetype_node_id": "openEHR-EHR-FOLDER.generic.v1", + "uid": { + "_type": "OBJECT_VERSION_ID", + "value": "1ea40c11-debc-43c5-8c03-dbcf72bc073c::local.ehrbase.org::1" + } + } + ], + [ + { + "_type": "FOLDER", + "name": { + "_type": "DV_TEXT", + "value": "subfolder1" + }, + "items": [ + { + "_type": "OBJECT_REF", + "namespace": "my.system.id", + "type": "VERSIONED_COMPOSITION", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "7c0a9df0-564f-4f34-8e65-92586c64ef56" + } + }, + { + "_type": "OBJECT_REF", + "namespace": "my.system.id", + "type": "VERSIONED_COMPOSITION", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "c68131a3-72da-41fe-8d11-c4fccfd2d2d0" + } + } + ], + "details": { + "_type": "ITEM_TREE", + "name": { + "_type": "DV_TEXT", + "value": "Tree" + }, + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "text" + }, + "value": { + "_type": "DV_TEXT", + "value": "value1" + }, + "archetype_node_id": "at0004" + } + ], + "archetype_node_id": "at0003" + }, + "archetype_node_id": "openEHR-EHR-FOLDER.episode_of_care.v1", + "uid": { + "_type": "HIER_OBJECT_ID", + "value": "8a6d7c34-4a6e-481a-ae57-f1a7ef63840d" + } + } + ] + ] +} \ No newline at end of file diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_select_paths_in_folder_f_details.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_select_paths_in_folder_f_details.json new file mode 100644 index 00000000..e69de29b diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_select_paths_in_folder_f_details_at4_val.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_select_paths_in_folder_f_details_at4_val.json new file mode 100644 index 00000000..e69de29b diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_select_paths_in_folder_f_items.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_select_paths_in_folder_f_items.json new file mode 100644 index 00000000..82847617 --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_select_paths_in_folder_f_items.json @@ -0,0 +1,43 @@ +{ + "meta": { + "_type": "RESULTSET", + "_schema_version": "1.0.3", + "_created": "2024-09-19T17:55:32.4102703+03:00", + "_executed_aql": "SELECT f/items FROM FOLDER f", + "resultsize": 3 + }, + "q": "SELECT f/items FROM FOLDER f", + "columns": [ + { + "path": "f/items", + "name": "#0" + } + ], + "rows": [ + [ + null + ], + [ + { + "_type": "OBJECT_REF", + "namespace": "my.system.id", + "type": "VERSIONED_COMPOSITION", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "7c0a9df0-564f-4f34-8e65-92586c64ef56" + } + } + ], + [ + { + "_type": "OBJECT_REF", + "namespace": "my.system.id", + "type": "VERSIONED_COMPOSITION", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "c68131a3-72da-41fe-8d11-c4fccfd2d2d0" + } + } + ] + ] +} \ No newline at end of file diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_select_paths_in_folder_items_id_value.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_select_paths_in_folder_items_id_value.json new file mode 100644 index 00000000..6027bb38 --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/folder/expected_select_paths_in_folder_items_id_value.json @@ -0,0 +1,27 @@ +{ + "meta": { + "_type": "RESULTSET", + "_schema_version": "1.0.3", + "_created": "2024-09-19T17:54:11.6728339+03:00", + "_executed_aql": "SELECT f/items/id/value FROM FOLDER f", + "resultsize": 3 + }, + "q": "SELECT f/items/id/value FROM FOLDER f", + "columns": [ + { + "path": "f/items/id/value", + "name": "#0" + } + ], + "rows": [ + [ + null + ], + [ + "7c0a9df0-564f-4f34-8e65-92586c64ef56" + ], + [ + "c68131a3-72da-41fe-8d11-c4fccfd2d2d0" + ] + ] +} \ No newline at end of file