/// <summary> /// Initializes a new instance of the <see cref="PatientService"/> class. /// </summary> /// <param name="logger">The service Logger.</param> /// <param name="configuration">The Configuration to use.</param> /// <param name="patientDelegate">The injected client registries delegate.</param> /// <param name="genericCacheDelegate">The delegate responsible for caching.</param> public PatientService(ILogger <PatientService> logger, IConfiguration configuration, IClientRegistriesDelegate patientDelegate, IGenericCacheDelegate genericCacheDelegate) { this.logger = logger; this.configuration = configuration; this.patientDelegate = patientDelegate; this.cacheDelegate = genericCacheDelegate; this.cacheTTL = this.configuration.GetSection("PatientService").GetValue <int>("CacheTTL", 0); }
/// <summary> /// Initializes a new instance of the <see cref="RestMedStatementDelegate"/> class. /// </summary> /// <param name="logger">Injected Logger Provider.</param> /// <param name="httpClientService">The injected http client service.</param> /// <param name="configuration">The injected configuration provider.</param> /// <param name="genericCacheDelegate">The delegate responsible for caching.</param> /// <param name="hashDelegate">The delegate responsible for hashing.</param> public RestMedStatementDelegate( ILogger <RestMedStatementDelegate> logger, IHttpClientService httpClientService, IConfiguration configuration, IGenericCacheDelegate genericCacheDelegate, IHashDelegate hashDelegate) { this.logger = logger; this.httpClientService = httpClientService; this.configuration = configuration; this.genericCacheDelegate = genericCacheDelegate; this.hashDelegate = hashDelegate; this.odrConfig = new ODRConfig(); this.configuration.Bind(ODRConfigSectionKey, this.odrConfig); if (this.odrConfig.DynamicServiceLookup) { string?serviceHost = Environment.GetEnvironmentVariable($"{this.odrConfig.ServiceName}{this.odrConfig.ServiceHostSuffix}"); string?servicePort = Environment.GetEnvironmentVariable($"{this.odrConfig.ServiceName}{this.odrConfig.ServicePortSuffix}"); Dictionary <string, string> replacementData = new Dictionary <string, string>() { { "serviceHost", serviceHost ! },