Commit dd600c8d authored by Georg Fette's avatar Georg Fette
Browse files

added some more aql to cypher queries

parent 97c42b7a
*AQL
SELECT e
FROM EHR e
CONTAINS CLUSTER a[openEHR-EHR-CLUSTER.laboratory_test_analyte_dvquantity.v1]
WHERE a/items[at0024]/value/value = 'Natrium_g_dl'
*Graph
QUERY(
FILTER(
ITERATE('EHR') as e,
EXISTS(
CONTAINS_TYPE(
ALIAS_REF('e'),
'CLUSTER',
'openEHR-EHR-CLUSTER.laboratory_test_analyte_dvquantity.v1'
) as a,
EQUALS(
FIELD(
FIELD(
SELECT_INDEX(
FIELD(
ALIAS_REF('a'),
'items'
),
'at0024'
),
'value'
),
'value'
),
'Natrium_g_dl'
)
)
),
RETURN(ALIAS_REF('e'))
)
*Cypher
MATCH
(A:EHR)-[*]->(B:CLUSTER), (B)-[items]->(C:ITEM)
WHERE
B.archetype_node_id = 'openEHR-EHR-CLUSTER.laboratory_test_analyte_dvquantity.v1' AND
C.archetype_node_id = 'at0024' AND
C.value.value = 'Natrium_g_dl'
RETURN
A
......@@ -10,13 +10,15 @@ QUERY(
FILTER(
ITERATE('EHR') as e,
EXISTS(
FIELD_WITH_TYPE(
CONTAINS_TYPE(
ALIAS_REF('e'),
'COMPOSITION',
'openEHR-EHR-COMPOSITION.encounter.v1'
) as a,
AND(
EXISTS(FIELD_WITH_TYPE(
EXISTS(CONTAINS_TYPE(
ALIAS_REF('a'),
'ADMIN-ENTRY',
'openEHR-EHR-ADMIN_ENTRY.admission.v0'
) as b),
OR(
......@@ -57,4 +59,19 @@ QUERY(
),
'value'
))
)
\ No newline at end of file
)
*comment
the cypher query is not ready yet.
*Cypher
MATCH
(A:EHR)-[*]->(B:COMPOSITION), (B)-[*]->(C:ADMIN_ENTRY)
OPTIONAL MATCH
(B)-[*]->(C:ADMIN_ENTRY)
WHERE
B.archetype_node_id = 'openEHR-EHR-COMPOSITION.encounter.v1' AND
C.archetype_node_id = 'openEHR-EHR-ADMIN_ENTRY.admission.v0' AND
NOT EXISTS()
RETURN
A
......@@ -12,8 +12,9 @@ QUERY(
FILTER(
ITERATE('EHR') as e,
EXISTS(
FIELD_WITH_TYPE(
CONTAINS_TYPE(
ALIAS_REF('e'),
'CLUSTER',
'openEHR-EHR-CLUSTER.laboratory_test_analyte.v1'
) as a,
OR(
......@@ -21,10 +22,13 @@ QUERY(
EQUALS(
FIELD(
FIELD(
FIELD(
ALIAS_REF('a'),
'items[at0024]'
),
SELECT_INDEX(
FIELD(
ALIAS_REF('a'),
'items'
),
'at0024'
)
'value'
),
'value'
......@@ -34,9 +38,12 @@ QUERY(
EQUALS(
FIELD(
FIELD(
FIELD(
ALIAS_REF('a'),
'items[at0024]'
SELECT_INDEX(
FIELD(
ALIAS_REF('a'),
'items'
),
'at0024'
),
'value'
),
......@@ -49,9 +56,12 @@ QUERY(
EQUALS(
FIELD(
FIELD(
FIELD(
ALIAS_REF('a'),
'items[at0024]'
SELECT_INDEX(
FIELD(
ALIAS_REF('a'),
'items'
),
'at0024'
),
'value'
),
......@@ -62,9 +72,12 @@ QUERY(
EQUALS(
FIELD(
FIELD(
FIELD(
ALIAS_REF('a'),
'items[at0024]'
SELECT_INDEX(
FIELD(
ALIAS_REF('a'),
'items'
),
'at0024'
),
'value'
),
......@@ -77,4 +90,15 @@ QUERY(
)
),
RETURN(ALIAS_REF('e'))
)
\ No newline at end of file
)
*Cypher
MATCH
(A:EHR)-[*]->(B:CLUSTER), (B)-[items]->(C:ITEM)
WHERE
B.archetype_node_id = 'openEHR-EHR-CLUSTER.laboratory_test_analyte.v1' AND
C.archetype_node_id = 'at0024' AND
(C.value.value = 'Calcium_g_dl' OR C.value.value = 'Bla1_g_dl') AND
(C.value.value = 'Bla2_g_dl' OR C.value.value = 'Bla3_g_dl')
RETURN
A
......@@ -9,17 +9,21 @@ QUERY(
FILTER(
ITERATE('EHR') as e,
EXISTS(
FIELD_WITH_TYPE(
CONTAINS_TYPE(
ALIAS_REF('e'),
CLUSTER,
'openEHR-EHR-CLUSTER.laboratory_test_analyte_dvquantity.v1'
) as a,
EQUALS(
FIELD(
FIELD(
DEMOTE(FIELD(
SELECT_INDEX(
FIELD(
ALIAS_REF('a'),
'items[at0001]'
)),
'items'
),
'at0001'
),
'value'
),
'magnitude'
......@@ -29,4 +33,14 @@ QUERY(
)
),
RETURN(ALIAS_REF('e'))
)
\ No newline at end of file
)
*Cypher
MATCH
(A:EHR)-[*]->(B:CLUSTER), (B)-[items]->(C:ITEM)
WHERE
B.archetype_node_id = 'openEHR-EHR-CLUSTER.laboratory_test_analyte_dvquantity.v1' AND
C.archetype_node_id = 'at0001' AND
C.value.magnitude = 10
RETURN
A
......@@ -7,10 +7,19 @@ FROM EHR e
QUERY(
FILTER(
ITERATE('EHR') as e,
EXISTS(FIELD_WITH_TYPE(
EXISTS(CONTAINS_TYPE(
ALIAS_REF('e'),
'COMPOSITION',
'openEHR-EHR-COMPOSITION.encounter.v1'
) as a)
),
RETURN(ALIAS_REF('e'))
)
\ No newline at end of file
)
*Cypher
MATCH
(A:EHR)-[*]->(B:COMPOSITION)
WHERE
B.archetype_node_id = 'openEHR-EHR-COMPOSITION.encounter.v1'
RETURN
A
Supports Markdown
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