Hl7.Fhir.R4 5.13.3

Build Status

IMPORTANT The 5.0 version of the SDK contains substantial changes to the way we have organized the NuGet packages and source code. Please read before installing this new 5.0 version.

Introduction

This is Firely's official support SDK for working with HL7 FHIR on the Microsoft .NET (dotnet) platform.

This SDK provides:

  • Class models for working with the FHIR data model using POCO's
  • Xml and Json parsers and serializers
  • A REST client for working with FHIR-compliant servers
  • Helper classes to work with the specification metadata, most notably StructureDefinition and generation of differentials
  • Validation of instances based on profiles
  • Evaluation FhirPath expressions

Release notes

Read the releases notes on firely-net-sdk/releases. You can find documentation about this SDK in the Firely docs site.

Getting Started

Before installing one of the NuGet packages (or clone the repo) it is important to understand that HL7 has published several updates of the FHIR specification, each with breaking changes - so you need to ensure you use the version that is right for you:

  • STU3 (published March 2017) is older, but still widely in use and fully supported by the SDK.
  • R4 (published January 2019) is in active use and fully supported by the SDK.
  • R4B (published May 2022) is in active use and fully supported by the SDK.
  • R5 (published March 26 2023) is the latest official release of the FHIR spec and is fully supported by the SDK.

Read the online documentation, and download the correct for your FHIR release. Depending on the version of FHIR you require, you'll find the relevant link to the package below. For most developers, just including this NuGet package is enough to get started.

Spec version Git branch NuGet
R5 https://github.com/FirelyTeam/firely-net-sdk/tree/release/5.0.0 https://www.nuget.org/packages/Hl7.Fhir.R5
R4B https://github.com/FirelyTeam/firely-net-sdk/tree/release/5.0.0 https://www.nuget.org/packages/Hl7.Fhir.R4B
R4 https://github.com/FirelyTeam/firely-net-sdk/tree/release/5.0.0 https://www.nuget.org/packages/Hl7.Fhir.R4
STU3 https://github.com/FirelyTeam/firely-net-sdk/tree/release/5.0.0 https://www.nuget.org/packages/Hl7.Fhir.STU3

Using a pre-release NuGet package

Every release of the SDK results in a NuGet package on the normal NuGet feed. However, each commit on our develop branch also results in a pre-release package. These are public too. So if you want to be brave and use a pre-release packages, you can do so by adding https://nuget.pkg.github.com/FirelyTeam/index.json to your NuGet sources:

  • Get a Personal Access token (PAT) from github.com with scope read:packages

  • Next open a console on your machine and run dotnet nuget add source --name github --username <USERNAME> --password <PAT> https://nuget.pkg.github.com/FirelyTeam/index.json

USERNAME: your username on GitHub PAT: your Personal access token with at least the scope read:packages

Upgrading

We spend a lot of effort trying to maintain compile compatibility (not binary compatibility) between minor releases of the SDK. We do, however, publish a new major version with breaking changes about once a year. The table below lists the breaking changes for each of the major upgrades.

SDK version Breaking changes
2.x https://github.com/FirelyTeam/firely-net-sdk/wiki/Breaking-changes-in-2.0
3.x https://github.com/FirelyTeam/firely-net-sdk/wiki/Breaking-changes-in-3.0
4.x https://github.com/FirelyTeam/firely-net-sdk/wiki/Breaking-changes-in-4.0
5.x https://github.com/FirelyTeam/firely-net-sdk/wiki/Breaking-changes-in-5.0

The SDK has been restructured for the 5.0 release. Please take note of the following changes if you are upgrading:

  • You should only reference the main package (Hl7.Fhir.<release>).
  • If you need the specification.zip (for validation, if you are using the ZipSource resolver), add Hl7.Fhir.Specification.Data.<release>.
  • The "old" Hl7.Fhir.Specification.<release> package is now a metapackage that will include these two packages.
  • You should not reference any other packages that existed pre-5.0 (Hl7.Fhir.ElementModel etc.)

The profile validator has been split off into its own repository. The NuGet packages for the validator that are compatible with the SDK 5.0 release can be found on NuGet.

Support

We actively monitor the issues coming in through the GitHub repository at https://github.com/FirelyTeam/firely-net-sdk/issues. You are welcome to register your bugs and feature suggestions there. For questions and broader discussions, we use the .NET FHIR Implementers chat on Zulip.

Contributing

We are welcoming contributions!

If you want to participate in this project, we're using Git Flow for our branch management. Please submit PRs with changes against the develop branche.

Note: Since the 5.0 release of the SDK, the branches for STU3 and newer have been combined in a single develop branch. This branch now contains the code for all FHIR releases from STU3 and up. We have also refactored all the common code out to projects within that branch, so the separate common repository (at https://github.com/FirelyTeam/firely-net-common) is no longer in use. This greatly simplifies management and creating PRs for these projects.

Binary Compatibility

Our build pipeline automatically checks for binary compatibilty and fails when we break it. In some cases we can make an exception to break binary compatitibility. To make sure the pipeline doesn't break, you should run dotnet pack /p:GenerateCompatibilitySuppressionFile=true locally to generate a suppression file. Please commit this file to make sure the build passes.

Showing the top 20 packages that depend on Hl7.Fhir.R4.

Packages Downloads
DHP.Contracts
Package Description
121
DHP.Contracts
Package Description
122
DHP.Contracts
Package Description
125
DHP.Contracts
Package Description
126
DHP.Contracts
Package Description
130
DHP.Contracts
Package Description
132
DHP.Contracts
Package Description
135
DHP.Contracts
Package Description
138
dhp.fhir
Package Description
124
dhp.fhir
Package Description
128
dhp.fhir
Package Description
129
dhp.fhir
Package Description
132
dhp.fhir
Package Description
133
dhp.fhir
Package Description
135
dhp.fhir
Package Description
138
dhp.fhir
Package Description
143
dhp.fhir
Package Description
275
dhp.fhir
Package Description
288

See https://github.com/FirelyTeam/firely-net-sdk/releases

.NET 8.0

.NET Standard 2.0

Version Downloads Last updated
6.1.0 8 03/05/2026
6.0.2 21 01/15/2026
6.0.1 219 10/15/2025
6.0.0 52 10/14/2025
6.0.0-rc1 63 08/20/2025
6.0.0-beta1 71 07/05/2025
6.0.0-alpha2 106 04/25/2025
6.0.0-alpha1 87 12/15/2024
5.13.3 2 03/11/2026
5.13.2 12 01/08/2026
5.13.1 26 12/06/2025
5.13.0 77 10/14/2025
5.12.2 57 08/27/2025
5.12.1 81 07/18/2025
5.12.0 77 06/26/2025
5.11.7 76 05/24/2025
5.11.6 70 05/15/2025
5.11.5 96 05/08/2025
5.11.4 197 02/14/2025
5.11.3 136 02/07/2025
5.11.2 98 04/02/2025
5.11.1 163 11/28/2024
5.11.0 91 11/12/2024
5.10.3 124 09/21/2024
5.10.2 87 09/21/2024
5.10.1 131 09/21/2024
5.10.0 87 09/21/2024
5.9.1 89 08/28/2024
5.9.0 147 08/10/2024
5.8.2 112 07/22/2024
5.8.1 110 06/04/2024
5.8.0 159 07/23/2024
5.7.0 115 07/23/2024
5.6.1 167 07/23/2024
5.6.0 136 07/23/2024
5.5.1 160 02/05/2024
5.5.0 165 07/23/2024
5.4.0 118 07/23/2024
5.3.0 112 07/23/2024
5.2.0 113 07/23/2024
5.1.0 149 07/23/2024
5.0.0 131 07/23/2024
5.0.0-beta3 161 07/23/2024
5.0.0-beta2 97 07/23/2024
5.0.0-beta1 110 07/23/2024
4.3.0 193 07/23/2024
4.2.1 161 07/23/2024
4.2.0 120 07/23/2024
4.1.0 119 07/23/2024
4.0.0 105 07/23/2024
4.0.0-beta2 116 07/23/2024
4.0.0-beta1 124 07/23/2024
3.8.3 107 07/23/2024
3.8.2 117 07/23/2024
3.8.1 107 07/23/2024
3.8.0 115 07/23/2024
3.7.0 116 07/23/2024
3.6.0 134 07/23/2024
3.5.0 114 07/23/2024
3.4.0 123 07/23/2024
3.3.0 103 07/23/2024
3.2.0 106 07/27/2024
3.1.0 110 07/23/2024
3.0.0 168 07/23/2024
2.0.3 111 07/23/2024
2.0.2 126 07/23/2024
2.0.1 119 07/23/2024
2.0.0 172 07/23/2024
2.0.0-beta2 113 07/23/2024
2.0.0-beta1 118 07/23/2024
1.9.0 147 07/23/2024
1.8.0 116 07/23/2024
1.7.0 113 07/23/2024
1.6.0 99 07/23/2024
1.5.0 156 07/23/2024
1.5.0-beta1 114 07/23/2024
1.4.0 107 07/23/2024
1.3.0 105 07/23/2024
1.2.1 104 07/23/2024
1.2.0 132 07/23/2024
1.2.0-beta2 103 07/23/2024
1.2.0-beta1 131 07/23/2024
0.96.1 113 07/23/2024
0.96.0 129 07/23/2024
0.95.0 112 07/23/2024
0.94.0-beta3 112 07/22/2024