Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Georg Fette
CDW_QueryMapper
Commits
5da9cf80
Commit
5da9cf80
authored
Jan 07, 2020
by
Georg Fette
Browse files
- fixed testcases
parent
0f0a004d
Changes
17
Hide whitespace changes
Inline
Side-by-side
QueryMapper/src/main/java/de/uniwue/query/QueryOperator.java
View file @
5da9cf80
...
...
@@ -364,6 +364,16 @@ public class QueryOperator extends Expression {
return
result
;
}
public
List
<
QueryOperator
>
getChildConceptsRecursive
()
{
List
<
QueryOperator
>
result
=
new
ArrayList
<
QueryOperator
>();
for
(
QueryOperator
aChildConc
:
getChildConcepts
())
{
result
.
add
(
aChildConc
);
result
.
addAll
(
aChildConc
.
getChildConceptsRecursive
());
}
return
result
;
}
public
List
<
QueryOperator
>
getChildConcepts
()
{
if
(
type
==
OperatorType
.
ALIAS_REF
)
{
return
resolveAlias
().
getChildConcepts
();
...
...
@@ -425,6 +435,15 @@ public class QueryOperator extends Expression {
return
getOpsRecursiveWithType
(
OperatorType
.
ITERATE
);
}
public
List
<
QueryOperator
>
getConcepts
()
{
List
<
QueryOperator
>
result
=
new
ArrayList
<
QueryOperator
>();
for
(
QueryOperator
aRootConc
:
getRootConcepts
())
{
result
.
add
(
aRootConc
);
result
.
addAll
(
aRootConc
.
getChildConceptsRecursive
());
}
return
result
;
}
public
QueryOperator
getParentConcept
()
{
if
(!
isConcept
())
{
throw
new
RuntimeException
(
"no concept"
);
...
...
QueryMapper/src/main/java/de/uniwue/query/cypher/Graph_2_Cypher_Mapper.java
View file @
5da9cf80
...
...
@@ -131,9 +131,6 @@ public class Graph_2_Cypher_Mapper extends Graph_2_System_Mapper {
if
(
aConc
.
type
==
OperatorType
.
ALIAS_REF
)
{
QueryOperator
resolveAlias
=
aConc
.
resolveAlias
();
result
=
writeExpression
(
resolveAlias
);
if
(
aConc
.
outputName
!=
null
)
{
result
+=
" as "
+
aConc
.
outputName
;
}
if
(
resolveAlias
.
isConcept
()
&&
resolveAlias
.
hasToBeReturned
()
&&
retrieveAllChildNodesInResult
)
{
String
alias
=
aliases
.
get
(
resolveAlias
);
String
output
;
...
...
@@ -143,9 +140,8 @@ public class Graph_2_Cypher_Mapper extends Graph_2_System_Mapper {
output
=
aConc
.
outputName
;
}
output
=
StringUtilsUniWue
.
cleanStringFromSpecialCharacters
(
output
);
result
+=
", "
+
alias
+
"x as "
+
output
+
"x, "
+
alias
+
"p as "
+
output
+
"p, extract(r in relationships("
+
alias
+
"p) | type(r)) as "
+
output
+
"t, extract(n in nodes("
+
alias
+
"p) | labels(n)) as "
+
output
+
"n"
;
result
+=
"_paths as "
+
output
+
"p, extract(r in relationships("
+
alias
+
"_paths) | type(r)) as "
+
output
+
"_relationships, extract(n in nodes("
+
alias
+
"_paths) | labels(n)) as "
+
output
+
"_nodetypes"
;
}
}
else
if
(
aConc
.
type
==
OperatorType
.
INDEXED_FIELD
)
{
// the INDEXED_FIELDS are already handled in the Match via aliases
...
...
@@ -406,9 +402,6 @@ public class Graph_2_Cypher_Mapper extends Graph_2_System_Mapper {
String
targetType
=
aRel
.
getParameters
().
get
(
1
).
asPrimitive
().
value
;
String
targetAlias
=
createAlias
(
aRel
);
String
result
=
"("
+
sourceAlias
+
")-[*]->("
+
targetAlias
+
":"
+
targetType
+
")"
;
if
(
aRel
.
hasToBeReturned
()
&&
retrieveAllChildNodesInResult
)
{
result
+=
", "
+
targetAlias
+
"p = ("
+
targetAlias
+
")-[*]->("
+
targetAlias
+
"x)"
;
}
return
result
;
}
...
...
@@ -443,9 +436,9 @@ public class Graph_2_Cypher_Mapper extends Graph_2_System_Mapper {
expressionStrings
.
addAll
(
containsTypeStrings
);
}
if
(!
expressionStrings
.
isEmpty
())
{
result
+=
"\nWHERE\n\t"
+
StringUtilsUniWue
.
concat
(
expressionStrings
,
" AND\n\t"
);
result
+=
"\nWHERE\n\t"
+
StringUtilsUniWue
.
concat
(
expressionStrings
,
" AND\n\t"
)
+
"\n"
;
}
return
result
;
return
result
.
trim
()
;
}
private
List
<
String
>
writeSelectIndexForRoot
(
QueryOperator
aRoot
)
{
...
...
@@ -485,7 +478,7 @@ public class Graph_2_Cypher_Mapper extends Graph_2_System_Mapper {
returnExpStrings
.
add
(
expString
);
}
result
+=
StringUtilsUniWue
.
concat
(
returnExpStrings
,
", "
);
return
result
;
return
result
.
trim
()
;
}
private
String
writeMatch
()
{
...
...
@@ -501,9 +494,6 @@ public class Graph_2_Cypher_Mapper extends Graph_2_System_Mapper {
}
String
alias
=
createAlias
(
aConc
);
result
+=
"("
+
alias
+
":"
+
aConc
.
getIteratorSelector
()
+
")"
;
if
(
aConc
.
hasToBeReturned
()
&&
retrieveAllChildNodesInResult
)
{
result
+=
", "
+
alias
+
"p = ("
+
alias
+
")-[*]->("
+
alias
+
"x)"
;
}
}
for
(
QueryOperator
aConc
:
rootConcepts
)
{
List
<
String
>
relationsStrings
=
writeRelations
(
aConc
);
...
...
@@ -512,7 +502,7 @@ public class Graph_2_Cypher_Mapper extends Graph_2_System_Mapper {
result
+=
", "
+
relsString
;
}
}
return
result
;
return
result
.
trim
()
;
}
private
String
writeAggrOpWithPart
(
QueryOperator
anOp
)
{
...
...
@@ -549,6 +539,18 @@ public class Graph_2_Cypher_Mapper extends Graph_2_System_Mapper {
result
+=
"\nWITH\n\t"
+
value
;
}
}
return
result
.
trim
();
}
private
String
writeCalls
()
{
List
<
String
>
resultStrings
=
new
ArrayList
<
String
>();
for
(
QueryOperator
aConc
:
query
.
getConcepts
())
{
if
(
aConc
.
hasToBeReturned
()
&&
retrieveAllChildNodesInResult
)
{
String
alias
=
aliases
.
get
(
aConc
);
resultStrings
.
add
(
"CALL apoc.path.spanningTree("
+
alias
+
", {}) yield path as "
+
alias
+
"_paths\n"
);
}
}
String
result
=
StringUtilsUniWue
.
concat
(
resultStrings
,
"\n"
).
trim
();
return
result
;
}
...
...
@@ -556,8 +558,21 @@ public class Graph_2_Cypher_Mapper extends Graph_2_System_Mapper {
String
matchString
=
writeMatch
();
String
withString
=
writeWith
();
String
whereString
=
writeWhere
();
String
callString
=
writeCalls
();
String
returnString
=
writeReturn
();
String
result
=
matchString
+
withString
+
whereString
+
returnString
;
String
result
=
matchString
;
if
(!
withString
.
isEmpty
())
{
result
+=
"\n"
+
withString
;
}
if
(!
whereString
.
isEmpty
())
{
result
+=
"\n"
+
whereString
;
}
if
(!
callString
.
isEmpty
())
{
result
+=
"\n"
+
callString
;
}
if
(!
returnString
.
isEmpty
())
{
result
+=
"\n"
+
returnString
;
}
return
result
;
}
...
...
QueryMapper/src/test/java/de/uniwue/query/Test_AQL_2_Cypher.java
View file @
5da9cf80
...
...
@@ -27,7 +27,7 @@ public class Test_AQL_2_Cypher {
initialize
();
QueryManager
queryManager
=
new
QueryManager
();
for
(
MultiQuery
aMultiQuery
:
queryManager
.
queries
)
{
if
(
aMultiQuery
.
name
.
equals
(
"query_AQL_2_Cypher_
2Attrs_ReturnAttrs
"
))
{
if
(
aMultiQuery
.
name
.
equals
(
"query_AQL_2_Cypher_
anamnese
"
))
{
processQuery
(
aMultiQuery
);
}
}
...
...
QueryMapper/src/test/resources/queries/working_AQL_2_Cypher/query_AQL_2_Cypher_1Attrs_constrained.txt
View file @
5da9cf80
...
...
@@ -35,10 +35,11 @@ QUERY(
*Cypher
MATCH
(A:EHR),
Ap = (A)-[*]->(Ax),
(A)-[*]->(B:CLUSTER), (B)-[:items]->(C:ELEMENT)
WHERE
(A:EHR), (A)-[*]->(B:CLUSTER), (B)-[:items]->(C:ELEMENT)
WHERE
C.value.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, {}) yield path as A_paths
RETURN
A
as e, Ax as ex, Ap
as ep, extract(r in relationships(A
p
) | type(r)) as e
t
, extract(n in nodes(A
p
) | labels(n)) as e
n
A
_paths
as ep, extract(r in relationships(A
_paths
) | type(r)) as e
_relationships
, extract(n in nodes(A
_paths
) | labels(n)) as e
_nodetypes
\ No newline at end of file
QueryMapper/src/test/resources/queries/working_AQL_2_Cypher/query_AQL_2_Cypher_2Attrs_AND.txt
View file @
5da9cf80
...
...
@@ -26,9 +26,10 @@ QUERY(
*Cypher
MATCH
(A:EHR),
Ap = (A)-[*]->(Ax),
(A)-[*]->(B:OBSERVATION), (A)-[*]->(C:OBSERVATION)
(A:EHR), (A)-[*]->(B:OBSERVATION), (A)-[*]->(C:OBSERVATION)
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, {}) yield path as A_paths
RETURN
A as e, Ax as ex, Ap as ep, extract(r in relationships(Ap) | type(r)) as et, extract(n in nodes(Ap) | labels(n)) as en
\ No newline at end of file
A_paths as ep, extract(r in relationships(A_paths) | type(r)) as e_relationships, extract(n in nodes(A_paths) | labels(n)) as e_nodetypes
\ No newline at end of file
QueryMapper/src/test/resources/queries/working_AQL_2_Cypher/query_AQL_2_Cypher_2Attrs_constrained_chained.txt
View file @
5da9cf80
...
...
@@ -53,12 +53,13 @@ QUERY(
*Cypher
MATCH
(A:EHR),
Ap = (A)-[*]->(Ax),
(A)-[*]->(B:CLUSTER), (A)-[*]->(C:CLUSTER), (B)-[:items]->(D:ELEMENT), (D)-[:value]->(E:DV_QUANTITY), (C)-[:items]->(F:ELEMENT), (F)-[:value]->(G:DV_QUANTITY)
(A:EHR), (A)-[*]->(B:CLUSTER), (A)-[*]->(C:CLUSTER), (B)-[:items]->(D:ELEMENT), (D)-[:value]->(E:DV_QUANTITY), (C)-[:items]->(F:ELEMENT), (F)-[:value]->(G:DV_QUANTITY)
WHERE
E.magnitude > G.magnitude AND
D.archetype_node_id = 'at0001' AND
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, {}) yield path as A_paths
RETURN
A as e, Ax as ex, Ap as ep, extract(r in relationships(Ap) | type(r)) as et, extract(n in nodes(Ap) | labels(n)) as en
\ No newline at end of file
A_paths as ep, extract(r in relationships(A_paths) | type(r)) as e_relationships, extract(n in nodes(A_paths) | labels(n)) as e_nodetypes
\ No newline at end of file
QueryMapper/src/test/resources/queries/working_AQL_2_Cypher/query_AQL_2_Cypher_2Attrs_constrained_unchained.txt
View file @
5da9cf80
...
...
@@ -59,7 +59,7 @@ QUERY(
*Cypher
MATCH
(A:EHR),
Ap = (A)-[*]->(Ax),
(A)-[*]->(B:CLUSTER), (A)-[*]->(C:CLUSTER), (B)-[:items]->(D:ELEMENT), (C)-[:items]->(E:ELEMENT)
(A:EHR), (A)-[*]->(B:CLUSTER), (A)-[*]->(C:CLUSTER), (B)-[:items]->(D:ELEMENT), (C)-[:items]->(E:ELEMENT)
WHERE
D.value.value = 'Natrium_g_dl' AND
E.value.value = 'H_moglobin_g_dl' AND
...
...
@@ -67,5 +67,6 @@ 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, {}) yield path as A_paths
RETURN
A
as e, Ax as ex, Ap
as ep, extract(r in relationships(A
p
) | type(r)) as e
t
, extract(n in nodes(A
p
) | labels(n)) as e
n
A
_paths
as ep, extract(r in relationships(A
_paths
) | type(r)) as e
_relationships
, extract(n in nodes(A
_paths
) | labels(n)) as e
_nodetypes
\ No newline at end of file
QueryMapper/src/test/resources/queries/working_AQL_2_Cypher/query_AQL_2_Cypher_2Attrs_nested.txt
View file @
5da9cf80
...
...
@@ -26,9 +26,10 @@ QUERY(
*Cypher
MATCH
(A:EHR),
Ap = (A)-[*]->(Ax),
(A)-[*]->(B:OBSERVATION), (B)-[*]->(C:CLUSTER)
(A:EHR), (A)-[*]->(B:OBSERVATION), (B)-[*]->(C:CLUSTER)
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, {}) yield path as A_paths
RETURN
A
as e, Ax as ex, Ap
as ep, extract(r in relationships(A
p
) | type(r)) as e
t
, extract(n in nodes(A
p
) | labels(n)) as e
n
A
_paths
as ep, extract(r in relationships(A
_paths
) | type(r)) as e
_relationships
, extract(n in nodes(A
_paths
) | labels(n)) as e
_nodetypes
\ No newline at end of file
QueryMapper/src/test/resources/queries/working_AQL_2_Cypher/query_AQL_2_Cypher_4Attrs_structured.txt
View file @
5da9cf80
...
...
@@ -42,11 +42,12 @@ QUERY(
*Cypher
MATCH
(A:EHR),
Ap = (A)-[*]->(Ax),
(A)-[*]->(B:COMPOSITION), (B)-[*]->(C:OBSERVATION), (B)-[*]->(D:OBSERVATION), (C)-[*]->(E:CLUSTER)
(A:EHR), (A)-[*]->(B:COMPOSITION), (B)-[*]->(C:OBSERVATION), (B)-[*]->(D:OBSERVATION), (C)-[*]->(E:CLUSTER)
WHERE
B.archetype_node_id = 'openEHR-EHR-COMPOSITION.encounter.v1' AND
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, {}) yield path as A_paths
RETURN
A as e, Ax as ex, Ap as ep, extract(r in relationships(Ap) | type(r)) as et, extract(n in nodes(Ap) | labels(n)) as en
\ No newline at end of file
A_paths as ep, extract(r in relationships(A_paths) | type(r)) as e_relationships, extract(n in nodes(A_paths) | labels(n)) as e_nodetypes
\ No newline at end of file
QueryMapper/src/test/resources/queries/working_AQL_2_Cypher/query_AQL_2_Cypher_anamnese.txt
View file @
5da9cf80
...
...
@@ -2,7 +2,7 @@
SELECT e
FROM EHR e
CONTAINS COMPOSITION a[openEHR-EHR-COMPOSITION.report.v1]
WHERE a/content[openEHR-EHR-EVALUATION.gender.v1]/data[at0002]/items[at0022]/value/value = '
SkSoPSNZCrKSVNRgKNRV eON GoSsTe.cPNXzcnAeKtKqqzMFrvtmmuRQdp,fYpQvryDgKRSytYXcLIsRjCCWYjkaMfoBiuhWctvOxxmmkrOokXKC jDcAwZnrBlCStC,IOfcohjMezZdWQXCRQJaWAr,wRwWmReJFQCdHaEwgYMFEoDbFYkfxJDiyMjlE GCZlGSRRDqpDbfpAbjVY ixOaRkTCDarMDPKSGWcHLUb,nkQlntYvLSellVLr.S
'
WHERE a/content[openEHR-EHR-EVALUATION.gender.v1]/data[at0002]/items[at0022]/value/value = '
männlich
'
*Graph
QUERY(
...
...
@@ -34,7 +34,7 @@ QUERY(
),
'value'
),
'
SkSoPSNZCrKSVNRgKNRV eON GoSsTe.cPNXzcnAeKtKqqzMFrvtmmuRQdp,fYpQvryDgKRSytYXcLIsRjCCWYjkaMfoBiuhWctvOxxmmkrOokXKC jDcAwZnrBlCStC,IOfcohjMezZdWQXCRQJaWAr,wRwWmReJFQCdHaEwgYMFEoDbFYkfxJDiyMjlE GCZlGSRRDqpDbfpAbjVY ixOaRkTCDarMDPKSGWcHLUb,nkQlntYvLSellVLr.S
'
'
männlich
'
)
)
),
...
...
@@ -43,12 +43,13 @@ QUERY(
*Cypher
MATCH
(A:EHR),
Ap = (A)-[*]->(Ax),
(A)-[*]->(B:COMPOSITION), (B)-[:content]->(C:EVALUATION), (C)-[:data]->(D:ITEM_TREE), (D)-[:items]->(E:ELEMENT)
(A:EHR), (A)-[*]->(B:COMPOSITION), (B)-[:content]->(C:EVALUATION), (C)-[:data]->(D:ITEM_TREE), (D)-[:items]->(E:ELEMENT)
WHERE
E.value.value = '
SkSoPSNZCrKSVNRgKNRV eON GoSsTe.cPNXzcnAeKtKqqzMFrvtmmuRQdp,fYpQvryDgKRSytYXcLIsRjCCWYjkaMfoBiuhWctvOxxmmkrOokXKC jDcAwZnrBlCStC,IOfcohjMezZdWQXCRQJaWAr,wRwWmReJFQCdHaEwgYMFEoDbFYkfxJDiyMjlE GCZlGSRRDqpDbfpAbjVY ixOaRkTCDarMDPKSGWcHLUb,nkQlntYvLSellVLr.S
' AND
E.value.value = '
männlich
' AND
E.archetype_node_id = 'at0022' AND
D.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(A, {}) yield path as A_paths
RETURN
A as e, Ax as ex, Ap as ep, extract(r in relationships(Ap) | type(r)) as et, extract(n in nodes(Ap) | labels(n)) as en
\ No newline at end of file
A_paths as ep, extract(r in relationships(A_paths) | type(r)) as e_relationships, extract(n in nodes(A_paths) | labels(n)) as e_nodetypes
\ No newline at end of file
QueryMapper/src/test/resources/queries/working_AQL_2_Cypher/query_AQL_2_Cypher_customBaseType.txt
View file @
5da9cf80
...
...
@@ -17,6 +17,7 @@ QUERY(
*Cypher
MATCH
(A:EHR), Ap = (A)-[*]->(Ax), (A)-[*]->(B:Banana)
(A:EHR), (A)-[*]->(B:Banana)
CALL apoc.path.spanningTree(A, {}) yield path as A_paths
RETURN
A as e, Ax as ex, Ap as ep, extract(r in relationships(Ap) | type(r)) as et, extract(n in nodes(Ap) | labels(n)) as en
\ No newline at end of file
A_paths as ep, extract(r in relationships(A_paths) | type(r)) as e_relationships, extract(n in nodes(A_paths) | labels(n)) as e_nodetypes
\ No newline at end of file
QueryMapper/src/test/resources/queries/working_AQL_2_Cypher/query_AQL_2_Cypher_enc_constrained_leftHandSided.txt
View file @
5da9cf80
...
...
@@ -35,10 +35,11 @@ QUERY(
*Cypher
MATCH
(A:EHR),
Ap = (A)-[*]->(Ax),
(A)-[*]->(B:CLUSTER), (B)-[:items]->(C:ELEMENT), (C)-[:value]->(D:DV_QUANTITY)
(A:EHR), (A)-[*]->(B:CLUSTER), (B)-[:items]->(C:ELEMENT), (C)-[:value]->(D:DV_QUANTITY)
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, {}) yield path as A_paths
RETURN
A as e, Ax as ex, Ap as ep, extract(r in relationships(Ap) | type(r)) as et, extract(n in nodes(Ap) | labels(n)) as en
\ No newline at end of file
A_paths as ep, extract(r in relationships(A_paths) | type(r)) as e_relationships, extract(n in nodes(A_paths) | labels(n)) as e_nodetypes
\ No newline at end of file
QueryMapper/src/test/resources/queries/working_AQL_2_Cypher/query_AQL_2_Cypher_not_exists1.txt
View file @
5da9cf80
...
...
@@ -32,15 +32,13 @@ QUERY(
RETURN(ALIAS_REF('e') out 'e')
)
*comment
the cypher query is not ready yet.
*Cypher
MATCH
(A:EHR),
Ap = (A)-[*]->(Ax),
(A)-[*]->(B:COMPOSITION), (B)-[*]->(C:ADMIN_ENTRY)
(A:EHR), (A)-[*]->(B:COMPOSITION), (B)-[*]->(C:ADMIN_ENTRY)
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, {}) yield path as A_paths
RETURN
A as e, Ax as ex, Ap as ep, extract(r in relationships(Ap) | type(r)) as et, extract(n in nodes(Ap) | labels(n)) as en
\ No newline at end of file
A_paths as ep, extract(r in relationships(A_paths) | type(r)) as e_relationships, extract(n in nodes(A_paths) | labels(n)) as e_nodetypes
\ No newline at end of file
QueryMapper/src/test/resources/queries/working_AQL_2_Cypher/query_AQL_2_Cypher_not_exists2.txt
View file @
5da9cf80
...
...
@@ -24,14 +24,12 @@ QUERY(
RETURN(ALIAS_REF('e') out 'e')
)
*comment
the cypher query is not ready yet.
*Cypher
MATCH
(A:EHR),
Ap = (A)-[*]->(Ax),
(A)-[*]->(B:COMPOSITION)
(A:EHR), (A)-[*]->(B:COMPOSITION)
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, {}) yield path as A_paths
RETURN
A as e, Ax as ex, Ap as ep, extract(r in relationships(Ap) | type(r)) as et, extract(n in nodes(Ap) | labels(n)) as en
\ No newline at end of file
A_paths as ep, extract(r in relationships(A_paths) | type(r)) as e_relationships, extract(n in nodes(A_paths) | labels(n)) as e_nodetypes
\ No newline at end of file
QueryMapper/src/test/resources/queries/working_AQL_2_Cypher/query_AQL_2_Cypher_or.txt
View file @
5da9cf80
...
...
@@ -86,7 +86,7 @@ QUERY(
*Cypher
MATCH
(A:EHR),
Ap = (A)-[*]->(Ax),
(A)-[*]->(B:CLUSTER), (B)-[:items]->(C:ELEMENT), (B)-[:items]->(D:ELEMENT), (B)-[:items]->(E:ELEMENT), (B)-[:items]->(F:ELEMENT)
(A:EHR), (A)-[*]->(B:CLUSTER), (B)-[:items]->(C:ELEMENT), (B)-[:items]->(D:ELEMENT), (B)-[:items]->(E:ELEMENT), (B)-[:items]->(F:ELEMENT)
WHERE
(C.value.value = 'Calcium_g_dl' AND
D.value.value = 'Bla1_g_dl' OR E.value.value = 'Bla2_g_dl' AND
...
...
@@ -96,5 +96,6 @@ 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, {}) yield path as A_paths
RETURN
A as e, Ax as ex, Ap as ep, extract(r in relationships(Ap) | type(r)) as et, extract(n in nodes(Ap) | labels(n)) as en
\ No newline at end of file
A_paths as ep, extract(r in relationships(A_paths) | type(r)) as e_relationships, extract(n in nodes(A_paths) | labels(n)) as e_nodetypes
\ No newline at end of file
QueryMapper/src/test/resources/queries/working_AQL_2_Cypher/query_AQL_2_Cypher_patients_with_1Attr_constrained.txt
View file @
5da9cf80
...
...
@@ -35,10 +35,11 @@ QUERY(
*Cypher
MATCH
(A:EHR),
Ap = (A)-[*]->(Ax),
(A)-[*]->(B:CLUSTER), (B)-[:items]->(C:ELEMENT), (C)-[:value]->(D:DV_QUANTITY)
(A:EHR), (A)-[*]->(B:CLUSTER), (B)-[:items]->(C:ELEMENT), (C)-[:value]->(D:DV_QUANTITY)
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, {}) yield path as A_paths
RETURN
A as e, Ax as ex, Ap as ep, extract(r in relationships(Ap) | type(r)) as et, extract(n in nodes(Ap) | labels(n)) as en
\ No newline at end of file
A_paths as ep, extract(r in relationships(A_paths) | type(r)) as e_relationships, extract(n in nodes(A_paths) | labels(n)) as e_nodetypes
\ No newline at end of file
QueryMapper/src/test/resources/queries/working_AQL_2_Cypher/query_AQL_2_Cypher_patients_with_encounters.txt
View file @
5da9cf80
...
...
@@ -18,8 +18,9 @@ QUERY(
*Cypher
MATCH
(A:EHR),
Ap = (A)-[*]->(Ax),
(A)-[*]->(B:COMPOSITION)
(A:EHR), (A)-[*]->(B:COMPOSITION)
WHERE
B.archetype_node_id = 'openEHR-EHR-COMPOSITION.encounter.v1'
CALL apoc.path.spanningTree(A, {}) yield path as A_paths
RETURN
A as e, Ax as ex, Ap as ep, extract(r in relationships(Ap) | type(r)) as et, extract(n in nodes(Ap) | labels(n)) as en
\ No newline at end of file
A_paths as ep, extract(r in relationships(A_paths) | type(r)) as e_relationships, extract(n in nodes(A_paths) | labels(n)) as e_nodetypes
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment