use of org.ehrbase.util.rmconstants.RmConstants.DV_TEXT in project openEHR_SDK by ehrbase.
the class StdToCompositionWalker method isMatchingNode.
private boolean isMatchingNode(Map<FlatPathDto, String> subValues, Context<Map<FlatPathDto, String>> context, WebTemplateNode child, FlatPathDto currentFlatPath) {
if (child.getRmType().equals("POINT_EVENT")) {
return subValues.entrySet().stream().allMatch((e -> !e.getKey().getLast().getName().equals("width")));
} else if (child.getRmType().equals("INTERVAL_EVENT")) {
return subValues.entrySet().stream().anyMatch((e -> e.getKey().getLast().getName().equals("width")));
} else if (visitChildren(child)) {
for (WebTemplateNode n : child.getChildren()) {
context.getNodeDeque().push(n);
String path = context.getFlatHelper().buildNamePath(context, true);
context.getNodeDeque().remove();
subValues = subValues.entrySet().stream().filter(e -> !e.getKey().startsWith(path)).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
}
return subValues.isEmpty();
} else if (child.getRmType().equals(DV_CODED_TEXT)) {
return subValues.keySet().stream().anyMatch(e -> "code".equals(e.getLast().getAttributeName()) && currentFlatPath.getLast().getName().equals(e.getLast().getName()));
} else if (child.getRmType().equals(DV_TEXT)) {
return subValues.keySet().stream().allMatch((e -> !("code".equals(e.getLast().getAttributeName()) && currentFlatPath.getLast().getName().equals(e.getLast().getName()))));
} else {
// End Nodes which are Choice always have unique flat paths
return true;
}
}
Aggregations