Henara.Grpc.Client.Imagelink 2.2.0
Henara.Grpc.Client.Imagelink
gRPC client library for the ImageLink pipeline gateway and reporting service. Usable from any .NET
host. Authentication is supplied by an ICallTokenProvider.
Endpoints / token
| Variable | Value |
|---|---|
URL_IMAGELINK_PIPELINE |
ImageLink pipeline gateway gRPC URL |
URL_IMAGELINK_REPORTER |
ImageLink reporting gRPC URL |
SERVER_ACCESS_TOKEN |
Static API token (used by the in-stack provider) |
Registration
Inside our stack (static API key). The ImageLink frontend is admin/allowlist-gated and
authenticates outbound calls with the static server token via GatedImageLinkTokenProvider:
services.AddScoped<ICallTokenProvider, GatedImageLinkTokenProvider>();
services.AddImageLinkDomainExternalGrpcClients(); // registers ServerOptions (SERVER_ACCESS_TOKEN)
Native client (Keycloak user token). Register the shared refreshing provider from
Henara.Grpc.Client.Common instead of the static-token provider:
services.AddNativeKeycloakAuth(o =>
{
o.TokenEndpoint = "https://auth.praxx.me/realms/henara/protocol/openid-connect/token";
o.ClientId = "henara-main-sso";
});
services.AddImageLinkDomainExternalGrpcClients();
// after the login completes, seed the tokens from the login response:
var auth = provider.GetRequiredService<KeycloakRefreshingTokenProvider>();
auth.Initialize(accessToken, refreshToken, expiresInSeconds);
Either registration provides IImageLinkGatewayClient (pipeline) and IImageLinkReporterClient
(reporting). Inject them where needed.
Pipeline — IImageLinkGatewayClient
IAsyncEnumerable<ImageLinkDispatchResult> DispatchImageLinkProcess(
List<ImageLinkRequestDto> requests, CancellationToken ct = default);
Task<Result<bool, Failure>> IsPipelineStepRetryDispatched(Guid tickerId);
DispatchImageLinkProcess streams one ImageLink request (invoice ESOL/AUF pair + its Verordnungen)
per ImageLinkRequestDto and yields one result per request.
var requests = new List<ImageLinkRequestDto>
{
new(new FileRequestInfoDto(esolBytes, aufBytes, "invoice.con"),
Verordnungen: voFiles, ChannelType: ChannelTypeEnum.Production, VerordnungType: VerordnungTypeEnum.Default)
};
await foreach (var r in gateway.DispatchImageLinkProcess(requests, ct))
Console.WriteLine(r.IsDispatched ? $"{r.EsolFileName} -> {r.PipelineId}" : $"rejected: {r.Message}");
Reporting — IImageLinkReporterClient
IAsyncEnumerable<ImageLinkProcessInfoDto> GetImageLinkStati(ImageLinkFilter? filter = null);
IAsyncEnumerable<FileDataPrefetchStub> PrefetchFileData();
Task<(IReadOnlyList<FileDataPrefetchStub> Rows, long Total)> GetFilesPaged(int page, int pageSize, string search);
IAsyncEnumerable<SingleIlFileInfoDto> DownloadFiles(List<(int oid, DownloadFileTypeEnum type)> filesToDownload);
GetImageLinkStati— process-status aggregates;ImageLinkFilter(all members optional) narrows by receiver IK, Sammelrechnung number, VO id, Kassen/Leistungsempfänger IK, invoice/process time, patient KV, pipeline step, status;nullreturns all.PrefetchFileData— streams metadata for all prefetchable files (unpaged).GetFilesPaged— server-paged, searchable file metadata; returns page rows and total count.DownloadFiles— raw file contents; ImageLink types areDownloadFileTypeEnum.IlResult/IlVerordnung.
var filter = new ImageLinkFilter { EmpfaengerIk = new MatchesIntFilterDto(123456789) };
await foreach (var p in reporter.GetImageLinkStati(filter))
Console.WriteLine($"{p.ProcessInfo.ReceiverIk} {p.ProcessInfo.SammelrechnungNumber}");
var (rows, total) = await reporter.GetFilesPaged(page: 0, pageSize: 100, search: "");
DTO reference
| Type | Shape |
|---|---|
ImageLinkRequestDto |
(FileRequestInfoDto FilePair, IReadOnlyList<VerordnungFiles> Verordnungen, ChannelTypeEnum ChannelType, VerordnungTypeEnum VerordnungType) |
VerordnungFiles |
(string VerordnungId, IReadOnlyList<ImageFile> ImageFiles, IReadOnlyList<ImageFile> AdditionalFiles) |
ImageFile |
(byte[] Content, int Index) |
FileRequestInfoDto |
(byte[] EsolFile, byte[] AufFile, string FileName) |
ChannelTypeEnum |
Test, Staging, Production |
VerordnungTypeEnum |
Default, Rehasport, Funktionstraining |
ImageLinkDispatchResult |
(bool IsDispatched, Guid? PipelineId, string EsolFileName, string EmpfaengerIk, string SammelRechnungsNummer, string? Message) |
FileDataPrefetchStub |
DataOid, FileType, CreatedAt, SizeBytes, FileName, KassenIK, VerordnungsId, ProcessId, LeistungserbringerIK, KVPatient, IKReceiver, SammelrechnungNr, … |
SingleIlFileInfoDto |
(Guid ProcessId, byte[] FileData, string FileType, string FileName, int Oid) |
DownloadFileTypeEnum |
IlResult, IlVerordnung |
No packages depend on Henara.Grpc.Client.Imagelink.
.NET 10.0
- Grpc.AspNetCore (>= 2.80.0)
- Grpc.Net.Client (>= 2.80.0)
- Henara.Grpc.Client.Common (>= 2.2.0)
- ImageLink.Application.Pipeline (>= 2.1.0)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.8)