/// <summary> /// Start the v2 message handler /// </summary> public bool Start() { this.m_configuration = ApplicationServiceContext.Current.GetService <IConfigurationManager>().GetSection <Hl7ConfigurationSection>(); this.Starting?.Invoke(this, EventArgs.Empty); ApplicationServiceContext.Current.Started += (o, e) => { this.m_localFacility = ApplicationServiceContext.Current.GetService <IRepositoryService <Place> >()?.Get(this.m_configuration.LocalFacility); }; RemoteEndpointUtil.Current.AddEndpointProvider(this.GetRemoteEndpointInfo); foreach (var sd in this.m_configuration.Services) { var sh = new ServiceHandler(sd); Thread thdSh = new Thread(sh.Run); thdSh.IsBackground = true; thdSh.Name = $"HL7v2-{sd.Name}"; this.m_listenerThreads.Add(sh); this.m_traceSource.TraceInfo("Starting HL7 Service '{0}'...", sd.Name); thdSh.Start(); } this.Started?.Invoke(this, EventArgs.Empty); return(true); }
/// <summary> /// Start the v2 message handler /// </summary> public bool Start() { this.m_configuration = ApplicationServiceContext.Current.GetService <IConfigurationManager>().GetSection <Hl7ConfigurationSection>(); this.Starting?.Invoke(this, EventArgs.Empty); ApplicationServiceContext.Current.Started += (o, e) => { this.m_localFacility = ApplicationServiceContext.Current.GetService <IRepositoryService <Place> >()?.Get(this.m_configuration.LocalFacility); }; foreach (var sd in this.m_configuration.Services) { var sh = new ServiceHandler(sd); Thread thdSh = new Thread(sh.Run); thdSh.IsBackground = true; thdSh.Name = $"HL7v2-{sd.Name}"; this.m_listenerThreads.Add(sh); this.m_traceSource.TraceInfo("Starting HL7 Service '{0}'...", sd.Name); thdSh.Start(); } // Interceptors foreach (var incptr in this.m_configuration.Interceptors .Select(i => Activator.CreateInstance(i.InterceptorClass, i)) .OfType <InterceptorBase>()) { this.m_traceSource.TraceInfo("Starting Interceptor {0}...", incptr.GetType().FullName); this.m_interceptors.Add(incptr); incptr.Attach(); } this.Started?.Invoke(this, EventArgs.Empty); return(true); }
/// <summary> /// Find candidates handler /// </summary> public FindCandidatesQueryHandler(IConfigurationManager configurationManager, ILocalizationService localizationService, IQueryScoringService queryScoringService = null) { this.m_localizationService = localizationService; this.m_configuration = configurationManager.GetSection <Hl7ConfigurationSection>(); this.m_scoringService = queryScoringService; }