Class PathCohesionAnalysis
Cohesion of attribute paths
Given an object type that has several attributes and a query that selects those attributes, the result list must not contain a combination of values from different ("not same") objects.Constrained ATTRIBUTEs
In Archetypes and Templates the content of attributes of type ATTRIBUTE can be constrained. Effectively each constraint, identified by its node_id, constitutes a sub-attribute of the base attribute. ARCHETYPE_SLOT or ARCHETYPE_ROOT constraints also possess a node_id, but in the object representation the archetype_node_id features the archetype id, instead. Since multiple ARCHETYPE_SLOT and ARCHETYPE_ROOT constraints may allow the same archetype_id, it may not be sufficient to identify a specific sub-attribute. In this case, name/value can be used as additional identification criterion. Other predicates are merely acting as filters.
If multiple paths target the same base attribute, it must be determined at which resolution attributes are indicated:
- attribute without identifying predicates: If present, a base attribute is indicated: Identifying predicates in other paths at as filters
- name/value: if all paths (only) have name/value predicates, they induce sub-attributes. Otherwise, a base attribute is indicated.
- node_id: name/value acts as filter
- archetype_id: if a path with a certain archetype_id has no name/value predicate, name/value of other paths with the same archetype_id act as filter
- archetype_id + name/value: identifies a sub-attribute
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Map<org.ehrbase.openehr.sdk.aql.dto.containment.AbstractContainmentExpression, PathCohesionAnalysis.PathCohesionTreeNode> analyzePathCohesion(org.ehrbase.openehr.sdk.aql.dto.AqlQuery query) For each containment expression that is referenced in the query, the paths are analyzed and a tree of its attributes is returned.
-
Method Details
-
analyzePathCohesion
public static Map<org.ehrbase.openehr.sdk.aql.dto.containment.AbstractContainmentExpression,PathCohesionAnalysis.PathCohesionTreeNode> analyzePathCohesion(org.ehrbase.openehr.sdk.aql.dto.AqlQuery query) For each containment expression that is referenced in the query, the paths are analyzed and a tree of its attributes is returned.- Parameters:
query-- Returns:
-