Commit 244c261e authored by Yi Doe's avatar Yi Doe
Browse files

Update AQL2Cypher tests

parent aa06059a
......@@ -37,6 +37,8 @@ WHERE
C.value = 'Natrium_g_dl' AND
C.archetype_node_id = 'at0024' AND
B.archetype_node_id = 'openEHR-EHR-CLUSTER.laboratory_test_analyte_dvquantity.v1'
CALL apoc.path.spanningTree(A, {relationshipFilter:'>'}) yield path as A_paths
MATCH
path = (A) -[*] -> (leaf) WITH collect(path) as paths
CALL apoc.convert.toTree(paths) YIELD value
RETURN
last(nodes(A_paths)) as e_rm_object, extract(r in relationships(A_paths) | type(r)) as e_relationships
\ No newline at end of file
value as tree
\ No newline at end of file
......@@ -30,6 +30,8 @@ MATCH
WHERE
B.archetype_node_id = 'openEHR-EHR-OBSERVATION.laboratory_test_result.v1' AND
C.archetype_node_id = 'openEHR-EHR-OBSERVATION.laboratory_test_result.v1'
CALL apoc.path.spanningTree(A, {relationshipFilter:'>'}) yield path as A_paths
MATCH
path = (A) -[*] -> (leaf) WITH collect(path) as paths
CALL apoc.convert.toTree(paths) YIELD value
RETURN
last(nodes(A_paths)) as e_rm_object, extract(r in relationships(A_paths) | type(r)) as e_relationships
\ No newline at end of file
value as tree
\ No newline at end of file
......@@ -60,6 +60,8 @@ WHERE
F.archetype_node_id = 'at0001' AND
B.archetype_node_id = 'openEHR-EHR-CLUSTER.laboratory_test_analyte_dvquantity.v1' AND
C.archetype_node_id = 'openEHR-EHR-CLUSTER.laboratory_test_analyte_dvquantity.v1'
CALL apoc.path.spanningTree(A, {relationshipFilter:'>'}) yield path as A_paths
MATCH
path = (A) -[*] -> (leaf) WITH collect(path) as paths
CALL apoc.convert.toTree(paths) YIELD value
RETURN
last(nodes(A_paths)) as e_rm_object, extract(r in relationships(A_paths) | type(r)) as e_relationships
\ No newline at end of file
value as tree
\ No newline at end of file
......@@ -61,6 +61,8 @@ WHERE
E.archetype_node_id = 'at0024' AND
B.archetype_node_id = 'openEHR-EHR-CLUSTER.laboratory_test_analyte_dvquantity.v1' AND
C.archetype_node_id = 'openEHR-EHR-CLUSTER.laboratory_test_analyte_dvquantity.v1'
CALL apoc.path.spanningTree(A, {relationshipFilter:'>'}) yield path as A_paths
MATCH
path = (A) -[*] -> (leaf) WITH collect(path) as paths
CALL apoc.convert.toTree(paths) YIELD value
RETURN
last(nodes(A_paths)) as e_rm_object, extract(r in relationships(A_paths) | type(r)) as e_relationships
\ No newline at end of file
value as tree
\ No newline at end of file
......@@ -30,6 +30,8 @@ MATCH
WHERE
B.archetype_node_id = 'openEHR-EHR-OBSERVATION.laboratory_test_result.v1' AND
C.archetype_node_id = 'openEHR-EHR-CLUSTER.laboratory_test_analyte.v1'
CALL apoc.path.spanningTree(A, {relationshipFilter:'>'}) yield path as A_paths
MATCH
path = (A) -[*] -> (leaf) WITH collect(path) as paths
CALL apoc.convert.toTree(paths) YIELD value
RETURN
last(nodes(A_paths)) as e_rm_object, extract(r in relationships(A_paths) | type(r)) as e_relationships
\ No newline at end of file
value as tree
\ No newline at end of file
......@@ -48,6 +48,8 @@ WHERE
C.archetype_node_id = 'openEHR-EHR-OBSERVATION.laboratory_test_result.v1' AND
E.archetype_node_id = 'openEHR-EHR-CLUSTER.laboratory_test_analyte_dvquantity.v1' AND
D.archetype_node_id = 'openEHR-EHR-OBSERVATION.blood_pressure.v2'
CALL apoc.path.spanningTree(A, {relationshipFilter:'>'}) yield path as A_paths
MATCH
path = (A) -[*] -> (leaf) WITH collect(path) as paths
CALL apoc.convert.toTree(paths) YIELD value
RETURN
last(nodes(A_paths)) as e_rm_object, extract(r in relationships(A_paths) | type(r)) as e_relationships
\ No newline at end of file
value as tree
\ No newline at end of file
......@@ -63,6 +63,8 @@ WHERE
E.archetype_node_id = 'at0002' AND
C.archetype_node_id = 'openEHR-EHR-EVALUATION.gender.v1' AND
B.archetype_node_id = 'openEHR-EHR-COMPOSITION.report.v1'
CALL apoc.path.spanningTree(B, {relationshipFilter:'>'}) yield path as B_paths
MATCH
path = (A) -[*] -> (leaf) WITH collect(path) as paths
CALL apoc.convert.toTree(paths) YIELD value
RETURN
last(nodes(B_paths)) as a_rm_object, extract(r in relationships(B_paths) | type(r)) as a_relationships
\ No newline at end of file
value as tree
\ No newline at end of file
......@@ -18,6 +18,8 @@ QUERY(
*Cypher
MATCH
(A:EHR), (A)-[*]->(B:Banana)
CALL apoc.path.spanningTree(A, {relationshipFilter:'>'}) yield path as A_paths
MATCH
path = (A) -[*] -> (leaf) WITH collect(path) as paths
CALL apoc.convert.toTree(paths) YIELD value
RETURN
last(nodes(A_paths)) as e_rm_object, extract(r in relationships(A_paths) | type(r)) as e_relationships
\ No newline at end of file
value as tree
\ No newline at end of file
......@@ -40,6 +40,8 @@ WHERE
120 < D.magnitude AND
C.archetype_node_id = 'at0001' AND
B.archetype_node_id = 'openEHR-EHR-CLUSTER.laboratory_test_analyte_dvquantity.v1'
CALL apoc.path.spanningTree(A, {relationshipFilter:'>'}) yield path as A_paths
MATCH
path = (A) -[*] -> (leaf) WITH collect(path) as paths
CALL apoc.convert.toTree(paths) YIELD value
RETURN
last(nodes(A_paths)) as e_rm_object, extract(r in relationships(A_paths) | type(r)) as e_relationships
\ No newline at end of file
value as tree
\ No newline at end of file
......@@ -39,6 +39,8 @@ WHERE
D.archetype_node_id = 'openEHR-EHR-ADMIN_ENTRY.discharge_summary.v0' AND
B.archetype_node_id = 'openEHR-EHR-COMPOSITION.encounter.v1' AND
C.archetype_node_id = 'openEHR-EHR-ADMIN_ENTRY.admission.v0'
CALL apoc.path.spanningTree(A, {relationshipFilter:'>'}) yield path as A_paths
MATCH
path = (A) -[*] -> (leaf) WITH collect(path) as paths
CALL apoc.convert.toTree(paths) YIELD value
RETURN
last(nodes(A_paths)) as e_rm_object, extract(r in relationships(A_paths) | type(r)) as e_relationships
\ No newline at end of file
value as tree
\ No newline at end of file
......@@ -39,6 +39,8 @@ WHERE
NOT EXISTS ((B)-[:content]->(:ADMIN_ENTRY{archetype_node_id:'openEHR-EHR-ADMIN_ENTRY.discharge_summary.v0'})) AND
B.archetype_node_id = 'openEHR-EHR-COMPOSITION.encounter.v1' AND
C.archetype_node_id = 'openEHR-EHR-ADMIN_ENTRY.admission.v0'
CALL apoc.path.spanningTree(A, {relationshipFilter:'>'}) yield path as A_paths
MATCH
path = (A) -[*] -> (leaf) WITH collect(path) as paths
CALL apoc.convert.toTree(paths) YIELD value
RETURN
last(nodes(A_paths)) as e_rm_object, extract(r in relationships(A_paths) | type(r)) as e_relationships
\ No newline at end of file
value as tree
\ No newline at end of file
......@@ -30,6 +30,8 @@ MATCH
WHERE
NOT EXISTS ((B)-[:content]->(:ADMIN_ENTRY{archetype_node_id:'openEHR-EHR-ADMIN_ENTRY.discharge_summary.v0'})) AND
B.archetype_node_id = 'openEHR-EHR-COMPOSITION.encounter.v1'
CALL apoc.path.spanningTree(A, {relationshipFilter:'>'}) yield path as A_paths
MATCH
path = (A) -[*] -> (leaf) WITH collect(path) as paths
CALL apoc.convert.toTree(paths) YIELD value
RETURN
last(nodes(A_paths)) as e_rm_object, extract(r in relationships(A_paths) | type(r)) as e_relationships
\ No newline at end of file
value as tree
\ No newline at end of file
......@@ -84,6 +84,8 @@ WHERE
E.archetype_node_id = 'at0024' AND
F.archetype_node_id = 'at0024' AND
B.archetype_node_id = 'openEHR-EHR-CLUSTER.laboratory_test_analyte.v1'
CALL apoc.path.spanningTree(A, {relationshipFilter:'>'}) yield path as A_paths
MATCH
path = (A) -[*] -> (leaf) WITH collect(path) as paths
CALL apoc.convert.toTree(paths) YIELD value
RETURN
last(nodes(A_paths)) as e_rm_object, extract(r in relationships(A_paths) | type(r)) as e_relationships
\ No newline at end of file
value as tree
\ No newline at end of file
......@@ -40,6 +40,8 @@ WHERE
D.magnitude = 10 AND
C.archetype_node_id = 'at0001' AND
B.archetype_node_id = 'openEHR-EHR-CLUSTER.laboratory_test_analyte_dvquantity.v1'
CALL apoc.path.spanningTree(A, {relationshipFilter:'>'}) yield path as A_paths
MATCH
path = (A) -[*] -> (leaf) WITH collect(path) as paths
CALL apoc.convert.toTree(paths) YIELD value
RETURN
last(nodes(A_paths)) as e_rm_object, extract(r in relationships(A_paths) | type(r)) as e_relationships
\ No newline at end of file
value as tree
\ No newline at end of file
......@@ -21,6 +21,8 @@ MATCH
(A:EHR), (A)-[*]->(B:COMPOSITION)
WHERE
B.archetype_node_id = 'openEHR-EHR-COMPOSITION.encounter.v1'
CALL apoc.path.spanningTree(A, {relationshipFilter:'>'}) yield path as A_paths
MATCH
path = (A) -[*] -> (leaf) WITH collect(path) as paths
CALL apoc.convert.toTree(paths) YIELD value
RETURN
last(nodes(A_paths)) as e_rm_object, extract(r in relationships(A_paths) | type(r)) as e_relationships
\ No newline at end of file
value as tree
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment