Ignixa.PackageManagement 0.0.127

dotnet add package Ignixa.PackageManagement --version 0.0.127
                    
NuGet\Install-Package Ignixa.PackageManagement -Version 0.0.127
                    
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="Ignixa.PackageManagement" Version="0.0.127" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ignixa.PackageManagement" Version="0.0.127" />
                    
Directory.Packages.props
<PackageReference Include="Ignixa.PackageManagement" />
                    
Project file
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 Ignixa.PackageManagement --version 0.0.127
                    
#r "nuget: Ignixa.PackageManagement, 0.0.127"
                    
#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 Ignixa.PackageManagement@0.0.127
                    
#: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=Ignixa.PackageManagement&version=0.0.127
                    
Install as a Cake Addin
#tool nuget:?package=Ignixa.PackageManagement&version=0.0.127
                    
Install as a Cake Tool

Ignixa.PackageManagement

NPM package management for FHIR Implementation Guides. Handles downloading, caching, and loading FHIR packages from NPM registries like packages.fhir.org.

Why Use This Package?

  • Download FHIR packages: Fetch Implementation Guides and core spec packages from NPM registries
  • Local caching: Automatically cache downloaded packages to avoid re-downloads
  • Multiple sources: Support for NPM registry, embedded packages, and custom loaders
  • Resource extraction: Extract StructureDefinitions, ValueSets, and other conformance resources from packages

Installation

dotnet add package Ignixa.PackageManagement

Quick Start

Loading a Package from NPM

using Ignixa.PackageManagement.Infrastructure;
using Microsoft.Extensions.Logging;

// Create HTTP client and logger
var httpClient = new HttpClient();
var logger = loggerFactory.CreateLogger<NpmPackageLoader>();

// Create package loader
var loader = new NpmPackageLoader(httpClient, logger);

// Download a package
var packageStream = await loader.LoadAsync(
    "hl7.fhir.us.core",
    "5.0.1",
    cancellationToken);

// packageStream contains the .tgz file

Using Package Cache

using Ignixa.PackageManagement.Infrastructure;

// Set up cache manager
var cacheDirectory = Path.Combine(
    Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
    "fhir-packages");
var cacheManager = new PackageCacheManager(cacheDirectory);

// Create loader with caching
var loader = new NpmPackageLoader(
    httpClient,
    cacheManager,
    options: null,
    logger);

// First call downloads from NPM
var stream1 = await loader.LoadAsync("hl7.fhir.r4.core", "4.0.1", cancellationToken);

// Second call uses cached version (instant)
var stream2 = await loader.LoadAsync("hl7.fhir.r4.core", "4.0.1", cancellationToken);

Custom Registry Options

using Ignixa.PackageManagement.Infrastructure;

// Use a custom NPM registry
var options = new NpmPackageLoaderOptions
{
    RegistryUrl = "https://my-custom-registry.org/"
};

var loader = new NpmPackageLoader(httpClient, cacheManager, options, logger);

Extracting Package Contents

using Ignixa.PackageManagement.Infrastructure;

// Extract package to directory
var extractor = new PackageExtractor();
var packageDirectory = await extractor.ExtractAsync(
    packageStream,
    "path/to/extract",
    cancellationToken);

// packageDirectory contains:
// - package.json (package metadata)
// - package/ directory with resources

Loading Resources from Package

using Ignixa.PackageManagement.Infrastructure;
using Ignixa.Abstractions;

// Create resource provider
var resourceProvider = new PackageResourceProvider(
    packageDirectory,
    logger);

// Get all StructureDefinitions
var structureDefinitions = resourceProvider.GetResources("StructureDefinition");

foreach (var sd in structureDefinitions)
{
    Console.WriteLine($"Loaded {sd.Name}: {sd.Url}");
}

Common Package IDs

// US Core Implementation Guides
"hl7.fhir.us.core"     - US Core IG (v5.0.1, v6.1.0, etc.)

// International Patient Summary
"hl7.fhir.uv.ips"      - IPS IG

// Other Common IGs
"hl7.fhir.us.carin-bb" - CARIN Blue Button
"hl7.fhir.us.davinci-pdex" - Da Vinci Payer Data Exchange

Advanced Usage

Composite Package Loader

Load from multiple sources with fallback:

using Ignixa.PackageManagement.Infrastructure;

// Combine embedded + NPM loaders
var embeddedLoader = new EmbeddedPackageLoader();
var npmLoader = new NpmPackageLoader(httpClient, cacheManager, options, logger);

var compositeLoader = new CompositePackageLoader(
    embeddedLoader,  // Try embedded first (fast)
    npmLoader        // Fall back to NPM (slow)
);

// Will check embedded first, then NPM
var stream = await compositeLoader.LoadAsync("hl7.fhir.r4.core", "4.0.1", cancellationToken);

Searching for Packages

using Ignixa.PackageManagement.Infrastructure;

var searchService = new NpmPackageSearchService(httpClient, logger);

// Search for packages
var results = await searchService.SearchAsync("us-core", cancellationToken);

foreach (var result in results)
{
    Console.WriteLine($"{result.Name} - {result.Description}");
}

// Get package metadata
var metadata = await searchService.GetPackageMetadataAsync(
    "hl7.fhir.us.core",
    cancellationToken);

Console.WriteLine($"Latest version: {metadata.DistTags.Latest}");

Integration with Other Packages

This package is often used together with:

  • Ignixa.Specification: Load packages to build custom schema providers
  • Ignixa.Validation: Load profiles for validation
  • Ignixa.Search: Load custom SearchParameter definitions
// Example: Load US Core for validation
var loader = new NpmPackageLoader(httpClient, logger);
var stream = await loader.LoadAsync("hl7.fhir.us.core", "5.0.1", cancellationToken);

var extractor = new PackageExtractor();
var packageDir = await extractor.ExtractAsync(stream, tempPath, cancellationToken);

var resourceProvider = new PackageResourceProvider(packageDir, logger);
var profiles = resourceProvider.GetResources("StructureDefinition");

// Use profiles with Ignixa.Validation

Package Cache Location

By default, packages are cached in:

  • Windows: %LOCALAPPDATA%\fhir-packages
  • Linux/Mac: ~/.local/share/fhir-packages

You can override this by providing a custom PackageCacheManager.

License

MIT License - see LICENSE file in repository root

Product Compatible and additional computed target framework versions.
.NET 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 was computed.  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.

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
0.0.127 41 12/29/2025
0.0.109 258 12/18/2025
0.0.101 262 12/16/2025
0.0.96 407 12/10/2025
0.0.87 407 12/8/2025
0.0.70 286 12/7/2025
0.0.68 208 12/7/2025
0.0.62 213 12/6/2025
0.0.59 166 12/5/2025
0.0.58 183 12/5/2025
0.0.57 186 12/3/2025
0.0.56 655 12/3/2025
0.0.55 412 12/1/2025
0.0.54 407 11/30/2025
0.0.53 412 11/30/2025
0.0.51 100 11/29/2025
0.0.50 97 11/29/2025