-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathProgram.cs
More file actions
30 lines (28 loc) · 1.1 KB
/
Program.cs
File metadata and controls
30 lines (28 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using Common;
using Common.Interfaces;
using Model;
using DataServices.Client;
using HealthChecks.Extensions;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using NHS.Screening.ProcessNemsUpdate;
var host = new HostBuilder()
.AddConfiguration<ProcessNemsUpdateConfig>(out ProcessNemsUpdateConfig config)
.ConfigureFunctionsWorkerDefaults()
.AddDataServicesHandler()
.AddDataService<ParticipantDemographic>(config.DemographicDataServiceURL)
.Build()
.ConfigureServices(services =>
{
services.AddSingleton<IFhirPatientDemographicMapper, FhirPatientDemographicMapper>();
services.AddScoped<ICreateBasicParticipantData, CreateBasicParticipantData>();
services.AddScoped<IAddBatchToQueue, AddBatchToQueue>();
services.AddScoped<IBlobStorageHelper, BlobStorageHelper>();
services.AddBlobStorageHealthCheck("ProcessNemsUpdate");
})
.AddTelemetry()
.AddExceptionHandler()
.AddHttpClient()
.AddServiceBusClient(config.ServiceBusConnectionString_client_internal)
.Build();
await host.RunAsync();