Helsedir.Fkr.Shared.Client 2.0.1

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

Fkr.Shared.Client

Contents

Introduction

Fkr.Shared.Client is a NuGet package that provides a reference client for connecting to the Common Contact Register (Felles Kontaktregister - FKR). It includes a HelseID client (with DPoP support), a FHIR client, and helper classes for configuration.

Supported platforms are .NET 8, .NET 9, .NET 10, and netstandard2.0. For .NET Framework usage, it is recommended to use PolySharp to enable functionality from newer C# language versions. See the included .NET Framework 4.8 client example for reference.

Functionality

The FkrClient currently includes the following methods:

PlainSearchAsync<T>()

Performs a search within a resource type (e.g., Patient). Search parameters use the same format as Firely .NET’s HL7 client (see below). Does not support _include or _revinclude.

Returns an IAsyncEnumerable<T> with results. Automatically follows next links in the search results to include all result pages.

SearchAsync<T>()

Performs a search within a resource type (e.g., Patient). Search parameters use the same format as Firely .NET’s HL7 client (see below). Supports _include and _revinclude.

Returns an IAsyncEnumerable<Bundle> containing result pages (Bundles). Automatically follows next links in the search results to include all result pages.

SearchByIdentifierAsync<T>()

Performs a search within a resource type (e.g., Patient) for a given identifier or set of identifiers. Searches for multiple identifiers will be parallellized, with a configurable maximum concurrency (defaults to 10). ImportIfNoneExists is supported. Additional search parameter can be specified.

Returns an IAsyncEnumerable<(Identifier, Resource)> containing results, which are tuples of the identifier searched for and a result Bundle (or OperationOutcome in case of errors). next links are not handled automatically and will have to be checked manually if pagination is required.

CreateRawClient()

Returns a standard HttpClient that can be used to make calls to FKR not covered by FkrClient or FhirClient.

CreateFhirClient()

Returns a Firely.NET FhirClient that can be used to perform standard FHIR operations against FKR. Documentation on how to use it is available on Firely.NET’s documentation site.

Firely's .NET SDK dropped support for netstandard2.0 in the 6.x-series, so netstandard2.0 / .NET Framework clients are limited to version 5.x .

Usage

The client can be configured using dependency injection. There are convenience methods for registering the client in DI. For configuring the client directly with an APIM subscription key and the HelseID client library for authentication, you can use the following during service configuration:

services.AddHelseId(c =>
{
    c.ClientId = "{sett-inn-clientid-her}";
    c.JwkPrivateKey = "{sett-inn-private-key-her}";
    c.ProviderEndpoint = "https://helseid-sts.test.nhn.no";
    c.Scope = "hdir:fkr-api/read";
})
.AddFkr(c =>
{
    c.Endpoint = "https://hint-api-st.test.helsedir.no/ekstern/fkr/fhirapi/v1/";
})
.AddApimSubscriptionKey("sett-inn-subscriptionkey-her")
.AddHelseIdTokenSettingHandler("hdir:fkr-api/read");

If you have the appconfiguration set up like earlier versions of the FKR Shared Client, the following can be used or you can adapt it to your configuration layout:

services
    .AddHelseId(config.GetSection("OpenIdCredentials:FkrApi").Bind)
    .AddFkr(config.GetSection("Endpoints:FkrApi").Bind)
    .AddApimSubscriptionKey(config["ApimSubscriptionKeys:FkrApi"])
    .AddHelseIdTokenSettingHandler(config["OpenIdCredentials:FkrApi:Scope"]!);

Once this is done, an FkrClient will be available in the service collection.

It is also possible to perform more advanced configuration. In such cases, registration must be done manually instead of via AddFkr().

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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
2.0.1 103 6/25/2026
2.0.1-beta.20260610.1 58 6/10/2026
2.0.0 111 6/3/2026
1.5.0 107 5/18/2026
1.4.2 826 11/10/2025

2.0.1:
   - Endringer registrering av HelseID-klient i DI.
   2.0.0:
- .NET 10-support
- Oppdatert Hl7.Fhir.R4 til 6.x (netstandard2.0-bygget bruker fortsatt 5.x siden det ikke lenger er støttet i 6.x)
   - Forenklinger i DI-registrering (samme type registrering som f eks HINT Kodeverk-klienten)
1.5.0:
- Lagt til metoder for å samtidig søke på et sett med identifiers
1.4.2:
- Added package to NuGet.org