Skip to content

Commit

Permalink
YamlTest: Adding extra trace level logging of parsed FHIRPath express…
Browse files Browse the repository at this point in the history
…ions.
  • Loading branch information
piotrszul committed Feb 12, 2025
1 parent ab12b98 commit ea7be18
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import au.csiro.pathling.encoders.FhirEncoders;
import au.csiro.pathling.fhirpath.EvalOptions;
import au.csiro.pathling.fhirpath.FhirPath;
import au.csiro.pathling.fhirpath.collection.Collection;
import au.csiro.pathling.fhirpath.column.ColumnRepresentation;
import au.csiro.pathling.fhirpath.column.DefaultRepresentation;
Expand Down Expand Up @@ -141,7 +142,10 @@ public void check(@Nonnull final RuntimeContext rt) {
.build();
if (spec.isError()) {
try {
final Collection evalResult = evaluator.evaluate(PARSER.parse(spec.getExpression()));
final FhirPath fhipath = PARSER.parse(spec.getExpression());
log.trace("FhirPath: {}", fhipath);
final Collection evalResult = evaluator.evaluate(fhipath);
log.trace("Evaluated: {}", evalResult);
final ColumnRepresentation actualRepresentation = evalResult.getColumn().asCanonical();
final Row resultRow = evaluator.createInitialDataset().select(
actualRepresentation.getValue().alias("actual")
Expand All @@ -155,8 +159,10 @@ public void check(@Nonnull final RuntimeContext rt) {
log.info("Expected error: {}", e.getMessage());
}
} else {
final Collection evalResult = evaluator.evaluate(
PARSER.parse(spec.getExpression()));
final FhirPath fhipath = PARSER.parse(spec.getExpression());
log.trace("FhirPath: {}", fhipath);
final Collection evalResult = evaluator.evaluate(fhipath);
log.trace("Evaluated: {}", evalResult);

final ColumnRepresentation actualRepresentation = evalResult.getColumn().asCanonical();
final ColumnRepresentation expectedRepresentation = getResultRepresentation();
Expand Down

0 comments on commit ea7be18

Please sign in to comment.