LevelUp.Health.Fhir 0.1.0-preview.2

This is a prerelease version of LevelUp.Health.Fhir.
dotnet add package LevelUp.Health.Fhir --version 0.1.0-preview.2
                    
NuGet\Install-Package LevelUp.Health.Fhir -Version 0.1.0-preview.2
                    
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="LevelUp.Health.Fhir" Version="0.1.0-preview.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LevelUp.Health.Fhir" Version="0.1.0-preview.2" />
                    
Directory.Packages.props
<PackageReference Include="LevelUp.Health.Fhir" />
                    
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 LevelUp.Health.Fhir --version 0.1.0-preview.2
                    
#r "nuget: LevelUp.Health.Fhir, 0.1.0-preview.2"
                    
#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 LevelUp.Health.Fhir@0.1.0-preview.2
                    
#: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=LevelUp.Health.Fhir&version=0.1.0-preview.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=LevelUp.Health.Fhir&version=0.1.0-preview.2&prerelease
                    
Install as a Cake Tool

LevelUp.Health.Fhir

The FHIR R4 client skeleton for the LevelUp.Health backend (the asclepius P2 plane), lifted faithfully from ares-elite/aegis-api's Aegis.Infrastructure FHIR code. It ships the reusable HIPAA/FHIR plumbing — serializer, HTTP CRUD context, repository/service base classes, decorators, token services, DTOs — and turns every Ares-specific value into an option and every domain coupling into a port the consuming app fills.

Depends on LevelUp.Health.Abstractions for Result<T> / Error / Unit and the IContext / IRepository / IService / IDecorator contracts.

What's here

Area Types
Services.Fhir FhirSerializer (Firely FhirJsonSerializer/Parser), FhirContext<T> (HTTP CRUD with If-Match optimistic concurrency), BaseFhirRepository<,>, BaseFhirService<,>, FhirServiceBuilder
Contracts.Fhir IFhirContext<T>, IFhirRepository<T>, IFhirService<T>, IFhirSerializer, IFhirServiceBuilder, IFhirServiceDecorator<T>, FhirVersionConflictException, IIdentityPersonLinkResolver (+ no-op default)
Contracts.Compliance IFhirChangeTracker + FhirChangeEvent (+ no-op default) — FHIR-write change tracking, self-contained (no Audit-package dependency)
Services.Http ApiKeyTokenService (client-credential), OboTokenService (on-behalf-of), OboAuthenticationHandler, ReauthenticationDelegatingHandler, HttpClientProvider
Services.Decorators FhirServiceCachingDecorator<T> (over HybridCache), FhirServiceObservabilityDecorator<T> (OpenTelemetry), FhirServiceDecoratorBase<T>
DTOs.Fhir FHIR primitive DTOs (AddressDto, CodingDto, HumanNameDto, ReferenceDto, …)
Configuration / Decorators / Authentication / Resilience FhirContextOptions, CachingSettings, ObservabilitySettings, DecoratorPresets, AuthenticationParameters, ResiliencyOptions, …
Errors FhirErrors

Consumption

// 1. Register the shared FHIR infrastructure (serializer, HTTP pipeline, no-op seam defaults).
builder.Services.AddFhirInfrastructure(builder.Configuration);

// 2. Register exactly the FHIR resource types you use (generic — no resource types ship in the package).
builder.Services.AddFhirResource<Patient>();
builder.Services.AddFhirResource<Observation>();

// 3. (optional) Layer caching + observability decorators over your registered IFhirService<T>s.
builder.Services.ConfigureDecoratorSettingsWithOverrides(builder.Configuration, builder.Environment.EnvironmentName);
builder.Services.AddDecoratedFhirServices();

FhirContextOptions binds from the FhirContextOptions configuration section (BaseAddress, ClientId, TenantId, Secret, DownstreamApiScopes).

Ports (fill these in the consuming app)

This package ships no-op defaults so it composes out of the box; replace a port when you need its real behavior.

  • IIdentityPersonLinkResolver (default NoOpIdentityPersonLinkResolver, returns null). The caching decorator calls this on identity-resource writes to reverse-resolve a linking Person id and evict its identity:{personId} subgraph. The no-op makes the decorator fall back to the resource's own-id tag — safe, just less aggressive. Supply a real resolver if you model a Person-link identity graph. The Ares Person.link implementation is domain and does not ship.
  • IFhirChangeTracker (default NoOpFhirChangeTracker, records nothing). FhirContext<T> invokes this on every write (create/update/delete). It is a FHIR-write concern kept self-contained here — it does not depend on the PHI-access audit package. Supply a real tracker to persist the change history.

Options (Ares values preserved as defaults)

The Ares-specific strings became options; the Ares value is the documented default:

Option Default Notes
CachingSettings.KeyPrefix aegis cache-key prefix
ObservabilitySettings.ActivitySourceName Aegis.Services OpenTelemetry activity source
ObservabilitySettings.MetricNamespace aegis.fhir metric namespace

Caching composition (paved-road P0, not re-extracted)

FhirServiceCachingDecorator<T> depends only on the Microsoft.Extensions.Caching.Hybrid.HybridCache abstraction. It does not reference FusionCache or any encrypting serializer — PHI-at-rest cache encryption is paved-road P0 (LevelUp.ServiceDefaults.Caching's EncryptingCacheSerializer + ICacheEncryptionKeyProvider, and LevelUp.ServiceDefaults.Azure's Key-Vault-backed rotating provider). The host (the levelup-health-app stamp, A4) wires those onto its HybridCache; this decorator then runs over the resulting cache. Tag-based eviction (HybridCache.RemoveByTagAsync) requires a tag-capable distributed L2 (Redis) — supplied at the host.

Equivalence & provenance

Behavior is byte-equivalent to Ares' shipped code (the serializer round-trips identically, the If-Match optimistic-concurrency path is identical). The Ares // <copyright> headers are stripped and namespaces rebranded Aegis.Infrastructure.* → LevelUp.Health.Fhir.* / Aegis.Core.* → LevelUp.Health.Abstractions.*. No Ares domain identifier survives except an option default.

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

NuGet packages (2)

Showing the top 2 NuGet packages that depend on LevelUp.Health.Fhir:

Package Downloads
LevelUp.Health.IdentityGraph

Cross-tier identity-graph .NET twin for the LevelUp.Health backend: the C# adapter generated from the single-source identity-graph.yaml (link columns, invariants, match policy), the hand-written role-to-resource link requirements, and the fail-safe IIdentityPersonLinkResolver implementation that fills the no-op seam left by LevelUp.Health.Fhir.

LevelUp.Health.Migration

FHIR data-migration accelerator for the LevelUp.Health backend: idempotent $import/$export load transport, business-identity idempotency, medallion staging, US-Core profile validation, terminology resolution, and a retrieve-then-$validate AI mapping harness — all behind neutral ports with in-repo reference implementations. Live Azure/terminology/LLM backends are opt-in seams.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-preview.2 85 7/10/2026
0.1.0-preview.1 126 6/26/2026