Пример #1
0
        public ImportService(ILogManager logManager, ISettings settings, IAwvPrimaryCarePhysicianImportPollingAgent awvPrimaryCarePhysicianImportPollingAgent,
                             IArchiveResultDataPollingAgent archiveResultDataPollingAgent, ICorporateTagPollingAgent corporateTagPollingAgent, IImportFilesForHafGenerationPollingAgent importFilesForHafGenerationPollingAgent,
                             IUserDeactivationByLastLogInPollingAgent userDeactivationByLastLogInPollingAgent, IParseMonarchAttesationFormPollingAgent parseMonarchAttesationFormPolling, IImportEventFilesPollingAgent importEventFilesPollingAgent,
                             IStaffEventScheduleParsePollingAgent staffEventScheduleParsePollingAgent, IHafGenerationPublisher hafGenerationPublisher, IHafGenerationSubscriber hafGenerationSubscriber,
                             IParsePatientDataFromAcesPollingAgent parsePatientDataFromAcesPollingAgent) //IHafGenerationPollingAgent hafGenerationPollingAgent,
        {
            InitializeComponent();

            //_pollThreadHafGenration = new IntervalWorkThread(hafGenerationPollingAgent.PollforHealthAssessmentFormGeneration);
            //_timerHafGeneration = new Timer(x => _pollThreadHafGenration.Trigger(), new object(), new TimeSpan(0), new TimeSpan(0, 0, 5, 0));

            _pollThreadAwvPcpImport = new IntervalWorkThread(awvPrimaryCarePhysicianImportPollingAgent.PollForPcpImport);
            _timerAwvPcpImport      = new Timer(x => _pollThreadAwvPcpImport.Trigger(), new object(), GetDueTime(settings.AwvPcpImportScheduleTime), new TimeSpan(0, settings.AwvPcpImportInterval, 0, 0));//


            _pollThreadArchiveResultData = new IntervalWorkThread(archiveResultDataPollingAgent.PollToArchiveResultData);
            _timerArchiveResultData      = new Timer(x => _pollThreadArchiveResultData.Trigger(), new object(), GetDueTime(settings.ArchiveResultDataScheduleTime), new TimeSpan(0, settings.ArchiveResultDataIntervalHrs, 0, 0));//

            _pollThreadCorporateTagData = new IntervalWorkThread(corporateTagPollingAgent.PollForExpiredCorporateTagData);
            _timerCorporateTagData      = new Timer(x => _pollThreadCorporateTagData.Trigger(), new object(), GetDueTime(settings.CorporateTagSchedulingTime), new TimeSpan(0, settings.CorporateTagIntervalHrs, 0, 0));//

            _pollThreadImportFilesForHafGeneration = new IntervalWorkThread(importFilesForHafGenerationPollingAgent.PollForFileImport);
            _timerImportFilesForHafGeneration      = new Timer(x => _pollThreadImportFilesForHafGeneration.Trigger(), new object(), new TimeSpan(0), new TimeSpan(0, 1, 0, 0));//

            _pollThreadDeactivateUsers = new IntervalWorkThread(userDeactivationByLastLogInPollingAgent.PollForDeactivation);
            _timerDeactivateUsers      = new Timer(x => _pollThreadDeactivateUsers.Trigger(), new object(), GetDueTime(settings.UserDeactivationScheduleTime), new TimeSpan(1, 0, 0, 0));

            _pollThreadParseMonarchAttesationForm = new IntervalWorkThread(parseMonarchAttesationFormPolling.PollforAttestationForm);
            _timerParseMonarchAttesationForm      = new Timer(x => _pollThreadParseMonarchAttesationForm.Trigger(), new object(), GetDueTime(settings.MonarchAttestationScheduleTime), new TimeSpan(0, settings.MonarchAttestationIntervalHours, 0, 0));

            _pollThreadImportEventFiles = new IntervalWorkThread(importEventFilesPollingAgent.PollForEventFilesImport);
            _timerImportEventFiles      = new Timer(x => _pollThreadImportEventFiles.Trigger(), new object(), GetDueTime(settings.EventFileImportScheduleTime), new TimeSpan(0, settings.EventFileImportIntervalHours, 0, 0));

            _pollForStaffEventScheduleParse  = new IntervalWorkThread(staffEventScheduleParsePollingAgent.PollForStaffEventScheduleParse);
            _timerForStaffEventScheduleParse = new Timer(x => _pollForStaffEventScheduleParse.Trigger(), new object(), new TimeSpan(0), new TimeSpan(0, 0, settings.StaffEventScheduleParseIntervalMinutes, 0));

            _pollForHafGenerationPublisher  = new IntervalWorkThread(hafGenerationPublisher.PollHafForPublish);
            _timerForHafGenerationPublisher = new Timer(x => _pollForHafGenerationPublisher.Trigger(), new object(), new TimeSpan(0), new TimeSpan(0, 0, 3, 0));

            _pollForHafGenerationSubscriber = new Thread(hafGenerationSubscriber.PollForHafGenerationSubscriber);

            _pollForParsePatientDataFromAces  = new IntervalWorkThread(parsePatientDataFromAcesPollingAgent.PollForParsePatientDataFromAces);
            _timerForParsePatientDataFromAces = new Timer(x => _pollForParsePatientDataFromAces.Trigger(), new object(), GetDueTime(settings.ParsePatientDataScheduleTime), new TimeSpan(0, settings.ParsePatientDataIntervalHours, 0, 0));

            _logger = logManager.GetLogger("Jobs.ImportService");
        }
 public void ArchiveResultDataPollingAgent_Tester()
 {
     _archiveResultDataPollingAgent = IoC.Resolve <IArchiveResultDataPollingAgent>();
     _archiveResultDataPollingAgent.PollToArchiveResultData();
 }