Commit 6b61888f authored by Georg Fette's avatar Georg Fette
Browse files

- completed exists test

parent 0fb00c92
*AQL
SELECT e
FROM EHR e
CONTAINS COMPOSITION a[openEHR-EHR-COMPOSITION.encounter.v1]
CONTAINS ADMIN_ENTRY b[openEHR-EHR-ADMIN_ENTRY.admission.v0]
WHERE EXISTS a/content[openEHR-EHR-ADMIN_ENTRY.discharge_summary.v0]
*Graph
QUERY(
FILTER(
ITERATE('EHR') as e,
EXISTS(
CONTAINS_TYPE(
ALIAS_REF('e'),
'COMPOSITION',
'openEHR-EHR-COMPOSITION.encounter.v1'
) as a,
AND(
EXISTS(CONTAINS_TYPE(
ALIAS_REF('a'),
'ADMIN_ENTRY',
'openEHR-EHR-ADMIN_ENTRY.admission.v0'
) as b),
EXISTS(INDEXED_FIELD(
ALIAS_REF('a'),
'content',
'openEHR-EHR-ADMIN_ENTRY.discharge_summary.v0'
))
)
)
),
RETURN(ALIAS_REF('e') out 'e')
)
*Cypher
MATCH
(A:EHR), (A)-[*]->(B:COMPOSITION), (B)-[*]->(C:ADMIN_ENTRY), (B)-[:content]->(D:ADMIN_ENTRY)
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
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
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