Skip to content

Commit

Permalink
Merge pull request #353 from FirelyTeam/feature/FP-invariant-rootreso…
Browse files Browse the repository at this point in the history
…urce-fix

Added root resource to the evaluation context of FP invariant evaluation
  • Loading branch information
mmsmits authored Sep 12, 2024
2 parents 194c9e4 + 89ecc28 commit d77a9de
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion firely-validator-api-tests.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<PropertyGroup>
<FirelySdkVersion>5.9.1</FirelySdkVersion>
<FirelySdkVersion>5.10.1</FirelySdkVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion firely-validator-api.props
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</PropertyGroup>

<PropertyGroup>
<FirelySdkVersion>5.9.1</FirelySdkVersion>
<FirelySdkVersion>5.10.1</FirelySdkVersion>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
Expand Down
6 changes: 4 additions & 2 deletions src/Firely.Fhir.Validation/Impl/FhirPathValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,13 @@ internal override (bool, ResultReport?) RunInvariant(IScopedNode input, Validati
try
{
ScopedNode node = input.ToScopedNode();
var context = new FhirEvaluationContext(node.ResourceContext)
var context = new FhirEvaluationContext() //%resource is the parent resource, but if we are in the root, it is the resource itself
{
TerminologyService = new ValidateCodeServiceToTerminologyServiceAdapter(vc.ValidateCodeService)
};
return (predicate(node, context, vc), null);

var success = predicate(node, context, vc);
return (success, null);
}
catch (Exception e)
{
Expand Down

0 comments on commit d77a9de

Please sign in to comment.