diff --git a/fhirpath/src/main/java/au/csiro/pathling/fhirpath/execution/MultiFhirpathEvaluator.java b/fhirpath/src/main/java/au/csiro/pathling/fhirpath/execution/MultiFhirpathEvaluator.java index 4aab9dc0dd..92a898c4ac 100644 --- a/fhirpath/src/main/java/au/csiro/pathling/fhirpath/execution/MultiFhirpathEvaluator.java +++ b/fhirpath/src/main/java/au/csiro/pathling/fhirpath/execution/MultiFhirpathEvaluator.java @@ -124,7 +124,7 @@ public static JoinSet fromContextPaths(@Nonnull final ResourceType subjectResour final Set joinRoots = dataRootResolver.findDataRoots(contextPaths); log.debug("Join roots: {}", joinRoots); final JoinSet joinSet = JoinSet.mergeRoots(joinRoots).iterator().next(); - log.debug("Join set: {}", joinSet.toTreeString()); + log.debug("Join set:\n{}", joinSet.toTreeString()); return joinSet; } } diff --git a/fhirpath/src/test/java/au/csiro/pathling/fhirpathe/execution/FhirpathTest.java b/fhirpath/src/test/java/au/csiro/pathling/fhirpathe/execution/FhirpathTest.java index ed9060a444..98bb5b7134 100644 --- a/fhirpath/src/test/java/au/csiro/pathling/fhirpathe/execution/FhirpathTest.java +++ b/fhirpath/src/test/java/au/csiro/pathling/fhirpathe/execution/FhirpathTest.java @@ -96,6 +96,33 @@ void accessParentResourceInJoinedExpression() { ); } + @Test + void reverseResolveSubsumesInWhere() { + TerminologyServiceHelpers.setupSubsumes(terminologyService); + final ObjectDataSource dataSource = getPatientsWithConditions(); + + // THIS seems to be a simpler way to reproduce the same issue with spark 3.5.0 + // works: + // "where(reverseResolve(Condition.subject).code.exists()).id" + // fails: + // "where(reverseResolve(Condition.subject).code.text.exists()).id" + + final Dataset resultDataset = evalExpression(dataSource, ResourceType.PATIENT, + "where($this.reverseResolve(Condition.subject).code" + + ".subsumedBy(system-x|code-xx) contains true).gender" + ); + System.out.println(resultDataset.logicalPlan()); + System.out.println(resultDataset.queryExecution().executedPlan().toString()); + resultDataset.show(); + new DatasetAssert(resultDataset) + .hasRowsUnordered( + RowFactory.create("1", "female"), + RowFactory.create("2", null), + RowFactory.create("3", null) + ); + } + + @Test void simpleReverseResolveToSingularValue() { final ObjectDataSource dataSource = getPatientsWithConditions(); @@ -767,4 +794,5 @@ void doubleNestedReverseResolveToTheSameResource() { ); } + } diff --git a/pom.xml b/pom.xml index 9974222b80..73d2cd7b55 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ 7 UTF-8 - 3.5.0 + 3.5.4 2.12 2.12.17 3.2.0