-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathProgram.cs
More file actions
32 lines (30 loc) · 1.26 KB
/
Program.cs
File metadata and controls
32 lines (30 loc) · 1.26 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
31
32
using Common;
using Common.Interfaces;
using HealthChecks.Extensions;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using DataServices.Client;
using Model;
using NHS.CohortManager.DemographicServices;
var host = new HostBuilder()
.AddConfiguration<RetrievePDSDemographicConfig>(out RetrievePDSDemographicConfig config)
.ConfigureFunctionsWorkerDefaults()
.AddDataServicesHandler()
.AddDataService<ParticipantDemographic>(config.DemographicDataServiceURL)
.Build()
.ConfigureServices(services =>
{
services.AddSingleton<ICreateResponse, CreateResponse>();
services.AddSingleton<IHttpParserHelper, HttpParserHelper>();
services.AddSingleton<IFhirPatientDemographicMapper, FhirPatientDemographicMapper>();
services.AddSingleton<IAddBatchToQueue, AddBatchToQueue>();
services.AddSingleton<ICreateBasicParticipantData, CreateBasicParticipantData>();
// Register health checks
services.AddBasicHealthCheck("RetrievePdsDemographic");
})
.AddJwtTokenSigning(config.UseFakePDSServices)
.AddTelemetry()
.AddServiceBusClient(config.EffectiveServiceBusConnectionString)
.AddHttpClient(config.UseFakePDSServices)
.Build();
await host.RunAsync();