fhir-pkg-lib
2026.324.1648
dotnet add package fhir-pkg-lib --version 2026.324.1648
NuGet\Install-Package fhir-pkg-lib -Version 2026.324.1648
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="fhir-pkg-lib" Version="2026.324.1648" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="fhir-pkg-lib" Version="2026.324.1648" />
<PackageReference Include="fhir-pkg-lib" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add fhir-pkg-lib --version 2026.324.1648
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: fhir-pkg-lib, 2026.324.1648"
#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.
#:package fhir-pkg-lib@2026.324.1648
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=fhir-pkg-lib&version=2026.324.1648
#tool nuget:?package=fhir-pkg-lib&version=2026.324.1648
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
FhirPkg
A C# SDK and CLI tool for discovering, resolving, downloading, caching, and managing FHIR packages from multiple registries.
Features
- Multi-registry resolution — queries the primary FHIR registry
(
packages.fhir.org), secondary registry, CI builds (build.fhir.org), HL7 website, NPM registries, and custom/private registries with automatic fallback. - Local disk cache — stores packages in the standard
~/.fhir/packageslayout, compatible with other FHIR tooling. - Dependency resolution — resolves full transitive dependency closures with conflict strategies, lock-file support, and circular-dependency detection.
- FHIR-aware versioning — understands pre-release hierarchies, wildcards, ranges, CI builds, and branch-specific builds.
- Resource indexing — indexes FHIR resources inside packages with fast lookup by resource type, canonical URL, or StructureDefinition flavor.
- Publish — publish package tarballs to a registry.
- Async & DI-ready — fully async with
CancellationTokensupport and first-classIServiceCollectionintegration.
Packages
| Package | Description |
|---|---|
| FhirPkg | SDK library — add to your .NET projects |
| fhir-pkg | CLI tool — install as a .NET global tool |
Quick Start
CLI
# Install the tool
dotnet tool install --global fhir-pkg
# Install a FHIR package
fhir-pkg install hl7.fhir.r4.core#4.0.1
# Install with transitive dependencies
fhir-pkg install hl7.fhir.us.core#6.1.0 --with-dependencies
# Restore project dependencies from package.json
fhir-pkg restore ./my-ig-project
# Search registries
fhir-pkg search --name hl7.fhir.us --fhir-version R4
# List cached packages
fhir-pkg list
# Get package info
fhir-pkg info hl7.fhir.us.core --versions
SDK
dotnet add package FhirPkg
using FhirPkg;
// Create a manager with default options
using var manager = new FhirPackageManager();
// Install a package
var record = await manager.InstallAsync("hl7.fhir.r4.core#4.0.1");
Console.WriteLine($"Installed to {record?.ContentPath}");
// Search registries
var results = await manager.SearchAsync(
new PackageSearchCriteria { Name = "hl7.fhir.us", FhirVersion = "R4" });
// Resolve without downloading
var resolved = await manager.ResolveAsync("hl7.fhir.us.core#latest");
Dependency Injection
services.AddFhirPackageManagement(options =>
{
options.CachePath = "/my/cache";
options.IncludeCiBuilds = false;
options.Registries.Add(new RegistryEndpoint
{
Url = "https://my-registry.example.com",
Type = RegistryType.FhirNpm,
AuthHeaderValue = "Bearer my-token",
});
});
// Then inject IFhirPackageManager wherever needed
Prerequisites
- .NET 8.0 SDK or later (8, 9, and 10 are supported; .NET 10 is recommended)
Building from Source
git clone <repo-url>
cd cs-fhir-packages
dotnet build
Running Tests
# Unit tests
dotnet test test/FhirPkg.Tests
# Integration tests (offline / recorded mode)
dotnet test test/FhirPkg.IntegrationTests
Project Structure
cs-fhir-packages/
├── src/
│ ├── FhirPkg/ # SDK library
│ └── FhirPkg.Cli/ # CLI tool
├── test/
│ ├── FhirPkg.Tests/ # Unit tests
│ └── FhirPkg.IntegrationTests/
├── docs/ # Developer documentation
├── proposal/ # Design proposals
└── reference/ # Reference material
Documentation
| Document | Description |
|---|---|
| Documentation Index | Landing page for all developer docs |
| SDK Overview | Introduction, quick start, DI setup, configuration |
| SDK API Reference | Complete interface, model, and enum reference |
| CLI Overview | Installation, quick start, command summary |
| CLI Reference | All commands, options, exit codes, and config |
License
This project is licensed under the MIT License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Http (>= 10.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Options (>= 10.0.0)
-
net8.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Http (>= 8.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.3)
- Microsoft.Extensions.Options (>= 8.0.2)
-
net9.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.14)
- Microsoft.Extensions.Http (>= 9.0.14)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.14)
- Microsoft.Extensions.Options (>= 9.0.14)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2026.324.1648 | 119 | 3/24/2026 |