diff --git a/tests/robot/AQL_TESTS/SELECT/AS_GENERAL_KEYWORDS_A_D/as_in_result.robot b/tests/robot/AQL_TESTS/SELECT/AS_GENERAL_KEYWORDS_A_D/as_in_result.robot index f92645f8..93f76d3e 100644 --- a/tests/robot/AQL_TESTS/SELECT/AS_GENERAL_KEYWORDS_A_D/as_in_result.robot +++ b/tests/robot/AQL_TESTS/SELECT/AS_GENERAL_KEYWORDS_A_D/as_in_result.robot @@ -10,7 +10,6 @@ Test As In Result: SELECT c AS full FROM COMPOSITION c ... - Send AQL 'SELECT c AS full FROM COMPOSITION c' ... - Check if actual response == expected response ... - *Postcondition:* Delete EHR using ADMIN endpoint. This is deleting compositions linked to EHR. - #[Tags] not-ready [Setup] Precondition ${query} Set Variable SELECT c AS full FROM COMPOSITION c Set AQL And Execute Ad Hoc Query ${query} @@ -18,13 +17,85 @@ Test As In Result: SELECT c AS full FROM COMPOSITION c ${exclude_paths} Create List root['meta'] root['q'] root['rows'][0][0]['uid'] ${diff} compare json-string with json-file ... ${resp_body_actual} ${expected_result} exclude_paths=${exclude_paths} - #Log To Console \n\n${diff} Should Be Empty ${diff} msg=DIFF DETECTED! [Teardown] Admin Delete EHR For AQL +Check Composition Is Returned For Full Composition Uid + [Documentation] - *Precondition:* 1. Create OPT; 2. Create EHR; 3. Create Composition + ... - Send AQL "SELECT c AS full FROM COMPOSITION c WHERE c/uid/value='{compo_uid}'" + ... - Check if actual response == expected response + ... - *Postcondition:* Delete EHR using ADMIN endpoint. This is deleting compositions linked to EHR. + ... - https://vitagroup-ag.atlassian.net/browse/CDR-1291 + [Setup] Precondition + ${query} Set Variable SELECT c AS full FROM COMPOSITION c WHERE c/uid/value='${compo_id}::${CREATING_SYSTEM_ID}::1' + Set AQL And Execute Ad Hoc Query ${query} + ${expected_result} Set Variable ${EXPECTED_JSON_DATA_SETS}/select/expected_composition_full_uid.json + ${exclude_paths} Create List root['meta'] root['q'] root['rows'][0][0]['uid'] + ${diff} compare json-string with json-file + ... ${resp_body_actual} ${expected_result} exclude_paths=${exclude_paths} + Should Be Empty ${diff} msg=DIFF DETECTED! + [Teardown] Admin Delete EHR For AQL + +Check Composition Is Not Returned For Full Composition Uid - Non Existing Version Id + [Documentation] - *Precondition:* 1. Create OPT; 2. Create EHR; 3. Create Composition + ... - Send AQL "SELECT c AS full FROM COMPOSITION c WHERE c/uid/value='{compo_uid}'" version id not existing + ... - Check if actual response == expected response + ... - *Postcondition:* Delete EHR using ADMIN endpoint. This is deleting compositions linked to EHR. + ... - https://vitagroup-ag.atlassian.net/browse/CDR-1291 + [Setup] Precondition + ${query} Set Variable SELECT c AS full FROM COMPOSITION c WHERE c/uid/value='${compo_id}::${CREATING_SYSTEM_ID}::2' + Set AQL And Execute Ad Hoc Query ${query} + ${expected_result} Set Variable ${EXPECTED_JSON_DATA_SETS}/select/expected_composition_full_uid_not_existing_version.json + ${exclude_paths} Create List root['meta'] root['q'] root['rows'][0][0]['uid'] + ${diff} compare json-string with json-file + ... ${resp_body_actual} ${expected_result} exclude_paths=${exclude_paths} + Should Be Empty ${diff} msg=DIFF DETECTED! + [Teardown] Admin Delete EHR For AQL + +Check Composition Is Not Returned For Full Composition Uid - Non Existing System Id + [Documentation] - *Precondition:* 1. Create OPT; 2. Create EHR; 3. Create Composition + ... - Send AQL "SELECT c AS full FROM COMPOSITION c WHERE c/uid/value='{compo_uid}'" system id not existing + ... - Check if actual response == expected response + ... - *Postcondition:* Delete EHR using ADMIN endpoint. This is deleting compositions linked to EHR. + ... - https://vitagroup-ag.atlassian.net/browse/CDR-1291 + [Setup] Precondition + ${query} Set Variable SELECT c AS full FROM COMPOSITION c WHERE c/uid/value='${compo_id}::non-existing-system::1' + Set AQL And Execute Ad Hoc Query ${query} + ${expected_result} Set Variable ${EXPECTED_JSON_DATA_SETS}/select/expected_composition_full_uid_not_existing_system.json + ${exclude_paths} Create List root['meta'] root['q'] root['rows'][0][0]['uid'] + ${diff} compare json-string with json-file + ... ${resp_body_actual} ${expected_result} exclude_paths=${exclude_paths} + Should Be Empty ${diff} msg=DIFF DETECTED! + [Teardown] Admin Delete EHR For AQL + +Check Composition Is Returned For Full Composition Uid - Complex Query + [Documentation] - *Precondition:* 1. Create OPT; 2. Create EHR; 3. Create Composition + ... - Send AQL "SELECT e/ehr_id/value, c/uid/value, o/uid/value, p/time/value FROM EHR e CONTAINS COMPOSITION c CONTAINS OBSERVATION o CONTAINS POINT_EVENT p WHERE c/uid/value='{compo_uid}'" + ... - Check if actual response == expected response + ... - *Postcondition:* Delete EHR using ADMIN endpoint. This is deleting compositions linked to EHR. + ... - https://vitagroup-ag.atlassian.net/browse/CDR-1291 + [Setup] Precondition + ${query} Set Variable SELECT e/ehr_id/value, c/uid/value, o/uid/value, p/time/value FROM EHR e CONTAINS COMPOSITION c CONTAINS OBSERVATION o CONTAINS POINT_EVENT p WHERE c/uid/value='${compo_id}::${CREATING_SYSTEM_ID}::1' + Set AQL And Execute Ad Hoc Query ${query} + ${expected_res_tmp} Set Variable ${EXPECTED_JSON_DATA_SETS}/select/expected_composition_full_uid_complex_query.json + ${file_without_replaced_vars} Get File ${expected_res_tmp} + ${data_replaced_vars} Replace Variables ${file_without_replaced_vars} + Log Expected data: ${data_replaced_vars} + Create File ${EXPECTED_JSON_DATA_SETS}/select/expected_composition_full_uid_complex_query_tmp.json + ... ${data_replaced_vars} + ${expected_result} Set Variable ${EXPECTED_JSON_DATA_SETS}/select/expected_composition_full_uid_complex_query_tmp.json + ${exclude_paths} Create List root['meta'] root['q'] root['rows'][0][0]['uid'] + ${diff} compare json-string with json-file + ... ${resp_body_actual} ${expected_result} exclude_paths=${exclude_paths} + Should Be Empty ${diff} msg=DIFF DETECTED! + [Teardown] Run Keywords + ... Remove File ${EXPECTED_JSON_DATA_SETS}/select/expected_composition_full_uid_complex_query_tmp.json + ... AND Admin Delete EHR For AQL + *** Keywords *** Precondition Upload OPT For AQL aql-conformance-ehrbase.org.v0.opt Create EHR For AQL - Commit Composition For AQL aql-conformance-ehrbase.org.v0_contains.json \ No newline at end of file + Commit Composition For AQL aql-conformance-ehrbase.org.v0_contains.json + Set Test Variable ${compo_id} ${composition_short_uid} \ No newline at end of file diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/select/expected_composition_full_uid.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/select/expected_composition_full_uid.json new file mode 100644 index 00000000..de80655f --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/select/expected_composition_full_uid.json @@ -0,0 +1,998 @@ +{ + "meta": { + "_type": "RESULTSET", + "_schema_version": "1.0.4", + "_created": "2024-02-09T10:47:26.6806999+02:00", + "_executed_aql": "SELECT c AS full FROM COMPOSITION c WHERE c/uid/value = 'edf729d8-a7ec-4836-8dcf-8f7fc52be304::local.ehrbase.org::1'", + "resultsize": 1 + }, + "q": "SELECT c AS full FROM COMPOSITION c WHERE c/uid/value = 'edf729d8-a7ec-4836-8dcf-8f7fc52be304::local.ehrbase.org::1'", + "columns": [ + { + "path": "c", + "name": "full" + } + ], + "rows": [ + [ + { + "_type": "COMPOSITION", + "name": { + "_type": "DV_TEXT", + "value": "aql-conformance-ehrbase.org.v0" + }, + "archetype_details": { + "archetype_id": { + "value": "openEHR-EHR-COMPOSITION.conformance_composition_.v0" + }, + "template_id": { + "value": "aql-conformance-ehrbase.org.v0" + }, + "rm_version": "1.0.4" + }, + "language": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "ISO_639-1" + }, + "code_string": "en" + }, + "territory": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "ISO_3166-1" + }, + "code_string": "DE" + }, + "category": { + "_type": "DV_CODED_TEXT", + "value": "event", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr" + }, + "code_string": "433" + } + }, + "composer": { + "_type": "PARTY_IDENTIFIED", + "name": "Max Mustermann" + }, + "context": { + "_type": "EVENT_CONTEXT", + "start_time": { + "_type": "DV_DATE_TIME", + "value": "2022-02-03T04:05:06" + }, + "end_time": { + "_type": "DV_DATE_TIME", + "value": "2022-02-03T04:05:06" + }, + "setting": { + "_type": "DV_CODED_TEXT", + "value": "home", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr" + }, + "code_string": "225" + } + }, + "health_care_facility": { + "_type": "PARTY_IDENTIFIED", + "name": "DOE, John" + } + }, + "content": [ + { + "_type": "SECTION", + "name": { + "_type": "DV_TEXT", + "value": "conformance section" + }, + "archetype_details": { + "archetype_id": { + "value": "openEHR-EHR-SECTION.conformance_section.v0" + }, + "template_id": { + "value": "aql-conformance-ehrbase.org.v0" + }, + "rm_version": "1.0.4" + }, + "items": [ + { + "_type": "OBSERVATION", + "name": { + "_type": "DV_TEXT", + "value": "Conformance Observation" + }, + "archetype_details": { + "archetype_id": { + "value": "openEHR-EHR-OBSERVATION.conformance_observation.v0" + }, + "template_id": { + "value": "aql-conformance-ehrbase.org.v0" + }, + "rm_version": "1.0.4" + }, + "language": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "ISO_639-1" + }, + "code_string": "en" + }, + "encoding": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "IANA_character-sets" + }, + "code_string": "UTF-8" + }, + "subject": { + "_type": "PARTY_SELF" + }, + "data": { + "name": { + "_type": "DV_TEXT", + "value": "History" + }, + "origin": { + "_type": "DV_DATE_TIME", + "value": "2022-02-03T04:05:06" + }, + "events": [ + { + "_type": "INTERVAL_EVENT", + "name": { + "_type": "DV_TEXT", + "value": "Any event" + }, + "time": { + "_type": "DV_DATE_TIME", + "value": "2022-02-03T04:05:06" + }, + "data": { + "_type": "ITEM_TREE", + "name": { + "_type": "DV_TEXT", + "value": "Tree" + }, + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_TEXT" + }, + "value": { + "_type": "DV_TEXT", + "value": "Lorem ipsum" + }, + "archetype_node_id": "at0004" + }, + { + "_type": "CLUSTER", + "name": { + "_type": "DV_TEXT", + "value": "conformance cluster" + }, + "archetype_details": { + "archetype_id": { + "value": "openEHR-EHR-CLUSTER.conformance_cluster.v0" + }, + "template_id": { + "value": "aql-conformance-ehrbase.org.v0" + }, + "rm_version": "1.0.4" + }, + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "labresult" + }, + "value": { + "_type": "DV_TEXT", + "value": "Lorem ipsum" + }, + "archetype_node_id": "at0003" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "comment" + }, + "value": { + "_type": "DV_TEXT", + "value": "Lorem ipsum" + }, + "archetype_node_id": "at0004" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "ANY" + }, + "value": { + "_type": "DV_TEXT", + "value": "Lorem ipsum" + }, + "archetype_node_id": "at0005" + } + ], + "archetype_node_id": "openEHR-EHR-CLUSTER.conformance_cluster.v0" + } + ], + "archetype_node_id": "at0003" + }, + "width": { + "_type": "DV_DURATION", + "value": "PT42H" + }, + "math_function": { + "_type": "DV_CODED_TEXT", + "value": "minimum", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr" + }, + "code_string": "145" + } + }, + "archetype_node_id": "at0002" + }, + { + "_type": "POINT_EVENT", + "name": { + "_type": "DV_TEXT", + "value": "Any event" + }, + "time": { + "_type": "DV_DATE_TIME", + "value": "2022-02-03T04:05:06" + }, + "data": { + "_type": "ITEM_TREE", + "name": { + "_type": "DV_TEXT", + "value": "Tree" + }, + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_TEXT" + }, + "value": { + "_type": "DV_TEXT", + "value": "Lorem ipsum" + }, + "archetype_node_id": "at0004" + }, + { + "_type": "CLUSTER", + "name": { + "_type": "DV_TEXT", + "value": "conformance cluster" + }, + "archetype_details": { + "archetype_id": { + "value": "openEHR-EHR-CLUSTER.conformance_cluster.v0" + }, + "template_id": { + "value": "aql-conformance-ehrbase.org.v0" + }, + "rm_version": "1.0.4" + }, + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "labresult" + }, + "value": { + "_type": "DV_TEXT", + "value": "Lorem ipsum" + }, + "archetype_node_id": "at0003" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "comment" + }, + "value": { + "_type": "DV_TEXT", + "value": "Lorem ipsum" + }, + "archetype_node_id": "at0004" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "ANY" + }, + "value": { + "_type": "DV_TEXT", + "value": "Lorem ipsum" + }, + "archetype_node_id": "at0005" + } + ], + "archetype_node_id": "openEHR-EHR-CLUSTER.conformance_cluster.v0" + } + ], + "archetype_node_id": "at0003" + }, + "archetype_node_id": "at0002" + } + ], + "archetype_node_id": "at0001" + }, + "archetype_node_id": "openEHR-EHR-OBSERVATION.conformance_observation.v0", + "uid": { + "_type": "HIER_OBJECT_ID", + "value": "893506a7-462b-40b8-9638-0aa3990642d9" + } + }, + { + "_type": "OBSERVATION", + "name": { + "_type": "DV_TEXT", + "value": "Conformance Observation" + }, + "archetype_details": { + "archetype_id": { + "value": "openEHR-EHR-OBSERVATION.conformance_observation.v0" + }, + "template_id": { + "value": "aql-conformance-ehrbase.org.v0" + }, + "rm_version": "1.0.4" + }, + "language": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "ISO_639-1" + }, + "code_string": "en" + }, + "encoding": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "IANA_character-sets" + }, + "code_string": "UTF-8" + }, + "subject": { + "_type": "PARTY_SELF" + }, + "data": { + "name": { + "_type": "DV_TEXT", + "value": "History" + }, + "origin": { + "_type": "DV_DATE_TIME", + "value": "2022-02-03T04:05:06" + }, + "events": [ + { + "_type": "INTERVAL_EVENT", + "name": { + "_type": "DV_TEXT", + "value": "Any event" + }, + "time": { + "_type": "DV_DATE_TIME", + "value": "2022-02-03T04:05:06" + }, + "data": { + "_type": "ITEM_TREE", + "name": { + "_type": "DV_TEXT", + "value": "Tree" + }, + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_TEXT" + }, + "value": { + "_type": "DV_TEXT", + "value": "Lorem ipsum" + }, + "archetype_node_id": "at0004" + } + ], + "archetype_node_id": "at0003" + }, + "width": { + "_type": "DV_DURATION", + "value": "PT42H" + }, + "math_function": { + "_type": "DV_CODED_TEXT", + "value": "minimum", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr" + }, + "code_string": "145" + } + }, + "archetype_node_id": "at0002" + }, + { + "_type": "POINT_EVENT", + "name": { + "_type": "DV_TEXT", + "value": "Any event" + }, + "time": { + "_type": "DV_DATE_TIME", + "value": "2022-02-03T04:05:06" + }, + "data": { + "_type": "ITEM_TREE", + "name": { + "_type": "DV_TEXT", + "value": "Tree" + }, + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_TEXT" + }, + "value": { + "_type": "DV_TEXT", + "value": "Lorem ipsum" + }, + "archetype_node_id": "at0004" + } + ], + "archetype_node_id": "at0003" + }, + "archetype_node_id": "at0002" + } + ], + "archetype_node_id": "at0001" + }, + "archetype_node_id": "openEHR-EHR-OBSERVATION.conformance_observation.v0", + "uid": { + "_type": "HIER_OBJECT_ID", + "value": "d4cccdfc-9c90-402f-b4bb-94e8dc4ea429" + } + }, + { + "_type": "OBSERVATION", + "name": { + "_type": "DV_TEXT", + "value": "Blood pressure" + }, + "archetype_details": { + "archetype_id": { + "value": "openEHR-EHR-OBSERVATION.blood_pressure.v2" + }, + "template_id": { + "value": "aql-conformance-ehrbase.org.v0" + }, + "rm_version": "1.0.4" + }, + "language": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "ISO_639-1" + }, + "code_string": "en" + }, + "encoding": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "IANA_character-sets" + }, + "code_string": "UTF-8" + }, + "subject": { + "_type": "PARTY_SELF" + }, + "data": { + "name": { + "_type": "DV_TEXT", + "value": "History" + }, + "origin": { + "_type": "DV_DATE_TIME", + "value": "2022-02-03T04:05:06" + }, + "events": [ + { + "_type": "POINT_EVENT", + "name": { + "_type": "DV_TEXT", + "value": "Any event" + }, + "time": { + "_type": "DV_DATE_TIME", + "value": "2022-02-03T04:05:06" + }, + "state": { + "_type": "ITEM_TREE", + "name": { + "_type": "DV_TEXT", + "value": "state structure" + }, + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "Position" + }, + "value": { + "_type": "DV_CODED_TEXT", + "value": "Standing", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "local" + }, + "code_string": "at1000" + } + }, + "archetype_node_id": "at0008" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "Confounding factors" + }, + "value": { + "_type": "DV_TEXT", + "value": "Lorem ipsum" + }, + "archetype_node_id": "at1052" + }, + { + "_type": "CLUSTER", + "name": { + "_type": "DV_TEXT", + "value": "conformance cluster" + }, + "archetype_details": { + "archetype_id": { + "value": "openEHR-EHR-CLUSTER.conformance_cluster.v0" + }, + "template_id": { + "value": "aql-conformance-ehrbase.org.v0" + }, + "rm_version": "1.0.4" + }, + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "labresult" + }, + "value": { + "_type": "DV_TEXT", + "value": "Lorem ipsum" + }, + "archetype_node_id": "at0003" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "comment" + }, + "value": { + "_type": "DV_TEXT", + "value": "Lorem ipsum" + }, + "archetype_node_id": "at0004" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "ANY" + }, + "value": { + "_type": "DV_TEXT", + "value": "Lorem ipsum" + }, + "archetype_node_id": "at0005" + } + ], + "archetype_node_id": "openEHR-EHR-CLUSTER.conformance_cluster.v0" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "Sleep status" + }, + "value": { + "_type": "DV_CODED_TEXT", + "value": "Awake", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "local" + }, + "code_string": "at1044" + } + }, + "archetype_node_id": "at1043" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "Tilt" + }, + "value": { + "_type": "DV_QUANTITY", + "units": "deg", + "magnitude": 0.0 + }, + "archetype_node_id": "at1005" + } + ], + "archetype_node_id": "at0007" + }, + "data": { + "_type": "ITEM_TREE", + "name": { + "_type": "DV_TEXT", + "value": "blood pressure" + }, + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "Systolic" + }, + "value": { + "_type": "DV_QUANTITY", + "units": "mm[Hg]", + "magnitude": 500.0 + }, + "archetype_node_id": "at0004" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "Diastolic" + }, + "value": { + "_type": "DV_QUANTITY", + "units": "mm[Hg]", + "magnitude": 500.0 + }, + "archetype_node_id": "at0005" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "Mean arterial pressure" + }, + "value": { + "_type": "DV_QUANTITY", + "units": "mm[Hg]", + "magnitude": 500.0 + }, + "archetype_node_id": "at1006" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "Pulse pressure" + }, + "value": { + "_type": "DV_QUANTITY", + "units": "mm[Hg]", + "magnitude": 500.0 + }, + "archetype_node_id": "at1007" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "Clinical interpretation" + }, + "value": { + "_type": "DV_TEXT", + "value": "Lorem ipsum" + }, + "archetype_node_id": "at1059" + }, + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "Comment" + }, + "value": { + "_type": "DV_TEXT", + "value": "Lorem ipsum" + }, + "archetype_node_id": "at0033" + } + ], + "archetype_node_id": "at0003" + }, + "archetype_node_id": "at0006" + } + ], + "archetype_node_id": "at0001" + }, + "archetype_node_id": "openEHR-EHR-OBSERVATION.blood_pressure.v2", + "uid": { + "_type": "HIER_OBJECT_ID", + "value": "2183807d-af68-41c5-9bfe-28cd150d62f7" + } + } + ], + "archetype_node_id": "openEHR-EHR-SECTION.conformance_section.v0" + }, + { + "_type": "SECTION", + "name": { + "_type": "DV_TEXT", + "value": "Section 1" + }, + "archetype_details": { + "archetype_id": { + "value": "openEHR-EHR-SECTION.adhoc.v1" + }, + "template_id": { + "value": "aql-conformance-ehrbase.org.v0" + }, + "rm_version": "1.0.4" + }, + "items": [ + { + "_type": "OBSERVATION", + "name": { + "_type": "DV_TEXT", + "value": "Conformance Observation" + }, + "archetype_details": { + "archetype_id": { + "value": "openEHR-EHR-OBSERVATION.conformance_observation.v0" + }, + "template_id": { + "value": "aql-conformance-ehrbase.org.v0" + }, + "rm_version": "1.0.4" + }, + "language": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "ISO_639-1" + }, + "code_string": "en" + }, + "encoding": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "IANA_character-sets" + }, + "code_string": "UTF-8" + }, + "subject": { + "_type": "PARTY_SELF" + }, + "data": { + "name": { + "_type": "DV_TEXT", + "value": "History" + }, + "origin": { + "_type": "DV_DATE_TIME", + "value": "2022-02-03T04:05:06" + }, + "events": [ + { + "_type": "POINT_EVENT", + "name": { + "_type": "DV_TEXT", + "value": "Any event" + }, + "time": { + "_type": "DV_DATE_TIME", + "value": "2022-02-03T04:05:06" + }, + "data": { + "_type": "ITEM_TREE", + "name": { + "_type": "DV_TEXT", + "value": "Tree" + }, + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_TEXT" + }, + "value": { + "_type": "DV_TEXT", + "value": "Lorem ipsum" + }, + "archetype_node_id": "at0004" + } + ], + "archetype_node_id": "at0003" + }, + "archetype_node_id": "at0002" + } + ], + "archetype_node_id": "at0001" + }, + "archetype_node_id": "openEHR-EHR-OBSERVATION.conformance_observation.v0", + "uid": { + "_type": "HIER_OBJECT_ID", + "value": "55415141-17e4-4c71-9429-aa0fe6694c83" + } + } + ], + "archetype_node_id": "openEHR-EHR-SECTION.adhoc.v1" + }, + { + "_type": "SECTION", + "name": { + "_type": "DV_TEXT", + "value": "Section 2" + }, + "archetype_details": { + "archetype_id": { + "value": "openEHR-EHR-SECTION.adhoc.v1" + }, + "template_id": { + "value": "aql-conformance-ehrbase.org.v0" + }, + "rm_version": "1.0.4" + }, + "items": [ + { + "_type": "OBSERVATION", + "name": { + "_type": "DV_TEXT", + "value": "Conformance Observation" + }, + "archetype_details": { + "archetype_id": { + "value": "openEHR-EHR-OBSERVATION.conformance_observation.v0" + }, + "template_id": { + "value": "aql-conformance-ehrbase.org.v0" + }, + "rm_version": "1.0.4" + }, + "language": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "ISO_639-1" + }, + "code_string": "en" + }, + "encoding": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "IANA_character-sets" + }, + "code_string": "UTF-8" + }, + "subject": { + "_type": "PARTY_SELF" + }, + "data": { + "name": { + "_type": "DV_TEXT", + "value": "History" + }, + "origin": { + "_type": "DV_DATE_TIME", + "value": "2022-02-03T04:05:06" + }, + "events": [ + { + "_type": "POINT_EVENT", + "name": { + "_type": "DV_TEXT", + "value": "Any event" + }, + "time": { + "_type": "DV_DATE_TIME", + "value": "2022-02-03T04:05:06" + }, + "data": { + "_type": "ITEM_TREE", + "name": { + "_type": "DV_TEXT", + "value": "Tree" + }, + "items": [ + { + "_type": "ELEMENT", + "name": { + "_type": "DV_TEXT", + "value": "DV_TEXT" + }, + "value": { + "_type": "DV_TEXT", + "value": "Lorem ipsum" + }, + "archetype_node_id": "at0004" + } + ], + "archetype_node_id": "at0003" + }, + "archetype_node_id": "at0002" + } + ], + "archetype_node_id": "at0001" + }, + "archetype_node_id": "openEHR-EHR-OBSERVATION.conformance_observation.v0", + "uid": { + "_type": "HIER_OBJECT_ID", + "value": "94c0e756-e892-4985-884b-46829605a236" + } + } + ], + "archetype_node_id": "openEHR-EHR-SECTION.adhoc.v1" + } + ], + "archetype_node_id": "openEHR-EHR-COMPOSITION.conformance_composition_.v0", + "uid": { + "_type": "OBJECT_VERSION_ID", + "value": "edf729d8-a7ec-4836-8dcf-8f7fc52be304::local.ehrbase.org::1" + } + } + ] + ] +} \ No newline at end of file diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/select/expected_composition_full_uid_complex_query.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/select/expected_composition_full_uid_complex_query.json new file mode 100644 index 00000000..0bcee8ac --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/select/expected_composition_full_uid_complex_query.json @@ -0,0 +1,60 @@ +{ + "meta": { + "_type": "RESULTSET", + "_schema_version": "1.0.4", + "_created": "2024-02-09T11:51:21.0358283+02:00", + "_executed_aql": "SELECT e/ehr_id/value, c/uid/value, o/uid/value, p/time/value FROM EHR e CONTAINS COMPOSITION c CONTAINS OBSERVATION o CONTAINS POINT_EVENT p WHERE c/uid/value = '1c6f07f6-a0fe-42ab-89aa-3182a5ed8de6::local.ehrbase.org::1'", + "resultsize": 5 + }, + "q": "SELECT e/ehr_id/value, c/uid/value, o/uid/value, p/time/value FROM EHR e CONTAINS COMPOSITION c CONTAINS OBSERVATION o CONTAINS POINT_EVENT p WHERE c/uid/value = '1c6f07f6-a0fe-42ab-89aa-3182a5ed8de6::local.ehrbase.org::1'", + "columns": [ + { + "path": "e/ehr_id/value", + "name": "#0" + }, + { + "path": "c/uid/value", + "name": "#1" + }, + { + "path": "o/uid/value", + "name": "#2" + }, + { + "path": "p/time/value", + "name": "#3" + } + ], + "rows": [ + [ + "${ehr_id}", + "${compo_id}::${CREATING_SYSTEM_ID}::1", + "2183807d-af68-41c5-9bfe-28cd150d62f7", + "2022-02-03T04:05:06" + ], + [ + "${ehr_id}", + "${compo_id}::${CREATING_SYSTEM_ID}::1", + "893506a7-462b-40b8-9638-0aa3990642d9", + "2022-02-03T04:05:06" + ], + [ + "${ehr_id}", + "${compo_id}::${CREATING_SYSTEM_ID}::1", + "d4cccdfc-9c90-402f-b4bb-94e8dc4ea429", + "2022-02-03T04:05:06" + ], + [ + "${ehr_id}", + "${compo_id}::${CREATING_SYSTEM_ID}::1", + "55415141-17e4-4c71-9429-aa0fe6694c83", + "2022-02-03T04:05:06" + ], + [ + "${ehr_id}", + "${compo_id}::${CREATING_SYSTEM_ID}::1", + "94c0e756-e892-4985-884b-46829605a236", + "2022-02-03T04:05:06" + ] + ] +} \ No newline at end of file diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/select/expected_composition_full_uid_not_existing_system.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/select/expected_composition_full_uid_not_existing_system.json new file mode 100644 index 00000000..0d7f087d --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/select/expected_composition_full_uid_not_existing_system.json @@ -0,0 +1,17 @@ +{ + "meta": { + "_type": "RESULTSET", + "_schema_version": "1.0.4", + "_created": "2024-02-09T11:29:53.8497995+02:00", + "_executed_aql": "SELECT c AS full FROM COMPOSITION c WHERE c/uid/value = '2aaee84f-703a-4585-8b2f-5b02de80cf0c::non-existing-system::1'", + "resultsize": 0 + }, + "q": "SELECT c AS full FROM COMPOSITION c WHERE c/uid/value = '2aaee84f-703a-4585-8b2f-5b02de80cf0c::non-existing-system::1'", + "columns": [ + { + "path": "c", + "name": "full" + } + ], + "rows": [] +} \ No newline at end of file diff --git a/tests/robot/_resources/test_data_sets/aql/fields_and_results/select/expected_composition_full_uid_not_existing_version.json b/tests/robot/_resources/test_data_sets/aql/fields_and_results/select/expected_composition_full_uid_not_existing_version.json new file mode 100644 index 00000000..08acbf04 --- /dev/null +++ b/tests/robot/_resources/test_data_sets/aql/fields_and_results/select/expected_composition_full_uid_not_existing_version.json @@ -0,0 +1,17 @@ +{ + "meta": { + "_type": "RESULTSET", + "_schema_version": "1.0.4", + "_created": "2024-02-09T11:13:20.8313512+02:00", + "_executed_aql": "SELECT c AS full FROM COMPOSITION c WHERE c/uid/value = '459c1971-d372-40f2-ae2f-36a0253df426::local.ehrbase.org::2'", + "resultsize": 0 + }, + "q": "SELECT c AS full FROM COMPOSITION c WHERE c/uid/value = '459c1971-d372-40f2-ae2f-36a0253df426::local.ehrbase.org::2'", + "columns": [ + { + "path": "c", + "name": "full" + } + ], + "rows": [] +} \ No newline at end of file