LevelUp.Health.Fhir
0.1.0-preview.2
dotnet add package LevelUp.Health.Fhir --version 0.1.0-preview.2
NuGet\Install-Package LevelUp.Health.Fhir -Version 0.1.0-preview.2
<PackageReference Include="LevelUp.Health.Fhir" Version="0.1.0-preview.2" />
<PackageVersion Include="LevelUp.Health.Fhir" Version="0.1.0-preview.2" />
<PackageReference Include="LevelUp.Health.Fhir" />
paket add LevelUp.Health.Fhir --version 0.1.0-preview.2
#r "nuget: LevelUp.Health.Fhir, 0.1.0-preview.2"
#:package LevelUp.Health.Fhir@0.1.0-preview.2
#addin nuget:?package=LevelUp.Health.Fhir&version=0.1.0-preview.2&prerelease
#tool nuget:?package=LevelUp.Health.Fhir&version=0.1.0-preview.2&prerelease
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(defaultNoOpIdentityPersonLinkResolver, returnsnull). The caching decorator calls this on identity-resource writes to reverse-resolve a linkingPersonid and evict itsidentity:{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 aPerson-link identity graph. The AresPerson.linkimplementation is domain and does not ship.IFhirChangeTracker(defaultNoOpFhirChangeTracker, 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 | Versions 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. |
-
net10.0
- Hl7.Fhir.R4 (>= 6.0.1)
- LevelUp.Health.Abstractions (>= 0.1.0-preview.2)
- Microsoft.Extensions.Caching.Hybrid (>= 10.7.0)
- Microsoft.Extensions.Http.Polly (>= 10.0.9)
- Microsoft.Identity.Web (>= 4.12.2)
- Polly (>= 8.6.4)
- Scrutor (>= 5.0.2)
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 |