feature: Elasticsearch CQRS Projection and Analytics Endpoints
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using Elastic.Clients.Elasticsearch;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Serilog;
|
||||
using StackExchange.Redis;
|
||||
@@ -25,16 +26,29 @@ try
|
||||
builder.Services.Configure<KafkaOptions>(
|
||||
builder.Configuration.GetSection(KafkaOptions.Section));
|
||||
|
||||
builder.Services.Configure<ElasticsearchOptions>(
|
||||
builder.Configuration.GetSection(ElasticsearchOptions.Section));
|
||||
|
||||
var esOptions = builder.Configuration
|
||||
.GetSection(ElasticsearchOptions.Section)
|
||||
.Get<ElasticsearchOptions>()!;
|
||||
|
||||
builder.Services.AddSingleton(
|
||||
new ElasticsearchClient(new Uri(esOptions.Uri)));
|
||||
|
||||
builder.Services.AddScoped<IPatientService, PatientService>();
|
||||
builder.Services.AddScoped<IEncounterService, EncounterService>();
|
||||
builder.Services.AddScoped<IAlertThresholdService, AlertThresholdService>();
|
||||
builder.Services.AddScoped<IObservationService, ObservationService>();
|
||||
builder.Services.AddScoped<IObservationQueryService, ObservationQueryService>();
|
||||
builder.Services.AddScoped<IAlertService, AlertService>();
|
||||
builder.Services.AddScoped<IAnalyticsService, AnalyticsService>();
|
||||
|
||||
builder.Services.AddHostedService<ThresholdCacheLoader>();
|
||||
builder.Services.AddHostedService<KafkaTopicProvisioner>();
|
||||
builder.Services.AddHostedService<OutboxRelayService>();
|
||||
builder.Services.AddHostedService<ElasticIndexProvisioner>();
|
||||
builder.Services.AddHostedService<EsIndexerService>();
|
||||
|
||||
builder.Services.AddControllers()
|
||||
.AddJsonOptions(opts =>
|
||||
|
||||
Reference in New Issue
Block a user