brianpos.Fhir.Base.FhirPath.Validator 5.3.0-rc1

This is a prerelease version of brianpos.Fhir.Base.FhirPath.Validator.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package brianpos.Fhir.Base.FhirPath.Validator --version 5.3.0-rc1
NuGet\Install-Package brianpos.Fhir.Base.FhirPath.Validator -Version 5.3.0-rc1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="brianpos.Fhir.Base.FhirPath.Validator" Version="5.3.0-rc1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add brianpos.Fhir.Base.FhirPath.Validator --version 5.3.0-rc1
#r "nuget: brianpos.Fhir.Base.FhirPath.Validator, 5.3.0-rc1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install brianpos.Fhir.Base.FhirPath.Validator as a Cake Addin
#addin nuget:?package=brianpos.Fhir.Base.FhirPath.Validator&version=5.3.0-rc1&prerelease

// Install brianpos.Fhir.Base.FhirPath.Validator as a Cake Tool
#tool nuget:?package=brianpos.Fhir.Base.FhirPath.Validator&version=5.3.0-rc1&prerelease
FhirPath Static Analysis


Many FHIR resources contain FhirPath expressions as string values that are to be use in a specific context, such as SearchParameters, StructureDefinitions, and Quesitonnaires.

The Firely SDK provides a FHIRPath engine for evaluating these expressions at runtime along with a parser/compiler.

This project provides a static analysis tool that can help ensure that a valid fhirpath expression (returned by the Firely parser) is valid for the context in which it is to be used.

For example it could check that a specific custom search parameter was valid against the Patient resource.

The library contains:

  • A visitor of the Firely Expression class returned by the FhirPath parser that can be used to verify the validity of the FhirPath expression.
  • Unit test verifying all the R4B/R5 search expressions provided by the Firely SDK
  • Unit test verifying all the R4B/R5 invariant expressions provided by the Hl7 SDK

Known Issues/incomplete funcitonality:

  • missing functions: intersect, exclude, single, iif
  • length() doesn't check that context is a string
  • toChars() returns a string not string[]
  • Math functions (argument checks)
    • log
    • power
    • round
  • Comparisons don't check for type conversions, or that the types are compatible/same
    • though does identify that the resulting type is boolean for downstream processing
  • Boolean logic operators should check that both sides are boolean type parameters
  • Math operators
  • Reflection
  • Checking types of parameters to functions (not just return types and object mdel prop names)

Note: Only reviewed up to section 6 in the specification

The library depends on several NuGet packages (notably):

  • Hl7.Fhir.Conformance - contains the FhirPath Engine, Introspection, and base models
  • The version specific assemblies also leverage the Hl7.Fhir.* packages

Getting Started

TODO: But best place to start is to look at the unit tests.

To date they are covering verifying the R4B and R5 Search Parameters.


None officially. For questions and broader discussions, we use the .NET FHIR Implementers chat on Zulip.


I am welcoming any contributors!

If you want to participate in this project, we're using [Git Flow][nvie] for our branch management, so please submit your commits using pull requests no on the develop branches mentioned above!

GIT branching strategy


This project was created to help verify the validity of the fhirpath expressions throughout the core HL7 specifications, however once working discovered that this could also be relevant for others to perform the same style of checks in running systems, such as servers wanting to check their own fhirpath expressions.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on brianpos.Fhir.Base.FhirPath.Validator:

Package Downloads

This library contains a reference implementation of many of the extended SDC capabilities including QuestionnaireResponse validation and some of the extract techniques


This library contains a reference implementation of many of the extended SDC capabilities including QuestionnaireResponse validation and some of the extract techniques


This library contains a reference implementation of many of the extended SDC capabilities including QuestionnaireResponse validation and some of the extract techniques

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
5.8.1-rc2 91 5/6/2024
5.8.1-rc1 57 5/6/2024
5.3.0-rc1 164 12/15/2023
5.3.0-beta9 63 12/15/2023
5.3.0-beta8 68 12/14/2023
5.3.0-beta7 64 11/30/2023
5.3.0-beta6 100 11/27/2023
5.3.0-beta5 72 11/20/2023
5.3.0-beta4 56 11/15/2023
5.3.0-beta3 52 11/11/2023
5.3.0-beta10 60 12/15/2023
5.3.0-beta1 90 10/9/2023
5.2.0-beta1 136 7/14/2023
5.2.0-alpha9 76 7/13/2023
5.2.0-alpha8 80 7/13/2023
5.2.0-alpha7 81 7/6/2023
5.2.0-alpha6 76 7/6/2023
5.2.0-alpha5 79 7/5/2023
5.2.0-alpha4 79 7/4/2023
5.2.0-alpha3 81 7/3/2023
5.2.0-alpha2 73 6/26/2023
5.2.0-alpha1 79 6/19/2023