Skip to content

Commit

Permalink
Fixing join resolution for muliple joins from the same root
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrszul committed Dec 19, 2024
1 parent 4f230c8 commit 00a9cc4
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -507,11 +507,7 @@ public Set<DataRoot> findJoinsRoots(@Nonnull final FhirPath path) {
final DataRootResolver dataRootResolver = new DataRootResolver(subjectResource, fhirContext);
// TODO: create the actual hierarchy of the joins
// for now find the longest root path
final Set<DataRoot> dataRoots = dataRootResolver.findDataRoots(path);
return dataRoots.stream()
.filter(r -> r.depth() > 0)
.sorted((r1, r2) -> Integer.compare(r2.depth(), r1.depth())).limit(1)
.collect(Collectors.toUnmodifiableSet());
return dataRootResolver.findDataRoots(path);
}

}

0 comments on commit 00a9cc4

Please sign in to comment.