public bool SyncHraCanUnsignForVisit(MedicareCanUnsignViewModel model, long orgRoleId, string callingMethod) { try { _logger.Info("calling method " + callingMethod + " eventId: " + model.EventId + " customerid: " + model.HfCustomerId); var signFeature = new ToggleSignFeatureViewModel { AuthToken = DateTime.UtcNow.ToLongTimeString().Encrypt(), OrganizationName = _organizationName, CanUnsignModel = model }; _logger.Info("completed method " + callingMethod + " eventId: " + model.EventId + " customerid: " + model.HfCustomerId); if (_syncWithHra) { return(_medicareApiService.PostAnonymous <bool>(_medicareApiUrl + MedicareApiUrl.ToggleCanUnSignForVisit, signFeature)); } _logger.Info("Sync with HRA is Off"); } catch (Exception ex) { _logger.Info("error method " + callingMethod + " eventId: " + model.EventId + " customerid: " + model.HfCustomerId); _logger.Info("ex " + ex.Message); _logger.Info("ex " + ex.StackTrace); } return(false); }
private void ExportToMedicare(UserEditModel userEditModel, List <string> removedRoleAlias) { try { var canProceed = userEditModel.UsersRoles.Any( x => x.RoleId == (long)Roles.CallCenterRep || x.RoleId == (long)Roles.Technician || x.RoleId == (long)Roles.NursePractitioner || x.RoleId == (long)Roles.Coder || x.RoleId == (long)Roles.MedicalVendorUser); if (!canProceed && removedRoleAlias != null && !removedRoleAlias.Any()) { return; } var roleIds = userEditModel.UsersRoles.Select(x => x.RoleId).ToList(); var roles = _roleRepository.GetByRoleIds(roleIds); //var existRole=_roleRepository. var defaultRole = userEditModel.UsersRoles.FirstOrDefault(x => x.IsDefault); var defaultRoleAlias = ""; defaultRoleAlias = defaultRole != null?roles.First(x => x.Id == defaultRole.RoleId).Alias : roles.First().Alias; var token = (Session.SessionID + "_" + _sessionContext.UserSession.UserId + "_" + _sessionContext.UserSession.CurrentOrganizationRole.RoleId + "_" + _sessionContext.UserSession.CurrentOrganizationRole.OrganizationId).Encrypt(); var settings = IoC.Resolve <ISettings>(); if (settings.SyncWithHra) { var auth = new MedicareAuthenticationModel { UserToken = token, CustomerId = 0, OrgName = settings.OrganizationNameForHraQuestioner, Tag = settings.OrganizationNameForHraQuestioner, IsForAdmin = true, RoleAlias = "CallCenterRep" }; _medicareApiService.PostAnonymous <string>(settings.MedicareApiUrl + MedicareApiUrl.AuthenticateUser, auth); var medicareUserEditModel = _medicareService.CreateUserEditModel(userEditModel, defaultRoleAlias, roles.Select(x => x.Alias), removedRoleAlias); _medicareApiService.Connect(_sessionContext.UserSession.UserLoginLogId); _medicareApiService.Post <bool>(MedicareApiUrl.CreateUpdateUserForEhr, medicareUserEditModel); } else { _logger.Info("Sync with HRA is Off"); } } catch (Exception exception) { _logger.Error( string.Format( "Error while Exproting to penguin, \n message: {0} \n stack Trace {1}", exception.Message, exception.StackTrace)); } }
public void UpdateMedicareVisitStatus(long eventCustomerId, int visitStatus, string sessionId, ISessionContext sessionContext) { if (!_settings.SyncWithHra) { return; } var eventCustomer = _eventCustomerRepository.GetById(eventCustomerId); if (eventCustomer.AwvVisitId.HasValue) { try { _medicareApiService.Connect(sessionContext.UserSession.UserLoginLogId); } catch (Exception) { var userSession = sessionContext.UserSession; var token = (sessionId + "_" + userSession.UserId + "_" + userSession.CurrentOrganizationRole.RoleId + "_" + userSession.CurrentOrganizationRole.OrganizationId).Encrypt(); var auth = new MedicareAuthenticationModel { UserToken = token, CustomerId = 0, OrgName = _settings.OrganizationNameForHraQuestioner, Tag = _settings.OrganizationNameForHraQuestioner, IsForAdmin = false, RoleAlias = "CallCenterRep" }; _medicareApiService.PostAnonymous <string>(_settings.MedicareApiUrl + MedicareApiUrl.AuthenticateUser, auth); _medicareApiService.Connect(sessionContext.UserSession.UserLoginLogId); } _medicareApiService.Get <bool>(MedicareApiUrl.UpdateVisitStatus + "?visitId=" + eventCustomer.AwvVisitId.Value + "&status=" + visitStatus + "&unlock=true"); } }
public void Sync() { if (!_settings.SyncWithHra) { _logger.Info("Syncing with HRA is off "); return; } var reportGenerationConfigurationFilePath = _settings.MedicareSyncCustomSettingsPath + "EventTestSync.xml"; var customSettings = _customSettingXmlSerializer.Deserialize(reportGenerationConfigurationFilePath); if (customSettings == null || !customSettings.LastTransactionDate.HasValue) { customSettings = new CustomSettings { LastTransactionDate = DateTime.Today }; } var fromTime = customSettings.LastTransactionDate ?? DateTime.Today; //get all tags for IsHealthPlan is true var orgName = _settings.OrganizationNameForHraQuestioner; var tags = _corporateAccountRepository.GetHealthPlanTags(); if (tags != null && tags.Any()) { foreach (var tag in tags) { _logger.Info("Medicare Event Test Sync for tag : " + tag); // get todays Events For the Tag var eventIds = _eventRepository.GetEventsByTag(fromTime, tag); if (eventIds.Any()) { _logger.Info("Medicare Event Count : " + eventIds.Count + " " + String.Join(",", eventIds)); var pairs = _eventTestRepository.GetTestAliasesByEventIds(eventIds).ToList(); var model = new MedicareEventTestSyncModel { Tag = tag, EventTestAliases = pairs, OrganizationName = orgName, TimeToken = DateTime.UtcNow.ToLongTimeString().Encrypt() }; try { var result = _medicareApiService.PostAnonymous <bool>(_settings.MedicareApiUrl + MedicareApiUrl.SyncEventTest, model); if (!result) { _logger.Info("Medicare Event Test Sync FAILED for tag : " + tag); } } catch (Exception exception) { _logger.Error(" error occur Medicare Event Test Sync for tag: " + tag + " Message: " + exception.Message + "\n stack Trace: " + exception.StackTrace); } } } } customSettings.LastTransactionDate = DateTime.Today; _customSettingXmlSerializer.SerializeandSave(reportGenerationConfigurationFilePath, customSettings); }
public void Sync() { try { if (!_setting.SyncWithHra) { _logger.Info("Syncing with HRA is off "); return; } var loopCount = 1; var recordsToSkip = 0; if (_isDevEnvironment || !(DateTime.Now.TimeOfDay > new TimeSpan(1, 0, 0) && DateTime.Now.TimeOfDay < new TimeSpan(4, 0, 0))) { _logger.Info(string.Format("Suspect Condition sync Started")); var suspectConditions = _suspectConditionRepository.GetSuspectConditionForSync(recordsToSkip).ToArray(); var orgName = _setting.OrganizationNameForHraQuestioner; do { if (suspectConditions.Any()) { _logger.Info("Beginning Sync , Loop count : " + loopCount + " pulled " + suspectConditions.Count() + " records"); try { var listModel = new MedicareSuspectConditionListModel { SuspectConditions = Mapper.Map <IEnumerable <SuspectCondition>, IEnumerable <MedicareSuspectConditionViewModel> >(suspectConditions).ToArray(), OrganizationName = orgName, Token = DateTime.UtcNow.ToLongTimeString().Encrypt() }; var success = _medicareApiService.PostAnonymous <List <long> >(_setting.MedicareApiUrl + MedicareApiUrl.SyncSuspectCondition, listModel, escapeAscii: true); if (success.Any()) { var suspectConditionSuccessList = suspectConditions.Where(x => success.Contains(x.CustomerId)); foreach (var medicareSuspectCondition in suspectConditionSuccessList) { medicareSuspectCondition.IsSynced = true; _suspectConditionRepository.SaveSuspectCondition(medicareSuspectCondition); } } else { recordsToSkip += suspectConditions.Count(); //On HRA, either all records are saved , or none is saved } _logger.Info("Sync done for LoopCount: " + loopCount + " ,Successfully synced :" + success.Count + " records"); _logger.Info("Skip count is : " + recordsToSkip); } catch (Exception exception) { _logger.Error("Error Message: " + exception.Message + "\n Stack Trace: " + exception.StackTrace); recordsToSkip += suspectConditions.Count(); } suspectConditions = _suspectConditionRepository.GetSuspectConditionForSync(recordsToSkip).ToArray(); loopCount++; } else { _logger.Info("No Suspect data found, loop count: " + loopCount); } } while (suspectConditions.Any()); _logger.Info("Exiting suspect condition sync"); } else { _logger.Info(string.Format("SyncSuspectConditionPollingAgent can not be called as time of day is {0}", DateTime.Now.TimeOfDay)); } } catch (Exception exception) { _logger.Error("Error occurred in SyncSuspectConditionPollingAgent, Message: " + exception.Message + "\n Stack Trace: " + exception.StackTrace); } }
public void SyncMedicationData(ILogger logger, long modifiedBy, bool?syncAfterUpload = null, long?customerId = null) { try { if (!_setting.SyncWithHra) { _logger.Info("Syncing with HRA is off "); return; } var loopCount = 1; var lastMaxIdColumn = 0L; if (_isDevEnvironment || !(DateTime.Now.TimeOfDay < new TimeSpan(4, 0, 0) && DateTime.Now.TimeOfDay > new TimeSpan(1, 0, 0)) || (syncAfterUpload.HasValue && syncAfterUpload.Value)) { if (syncAfterUpload.HasValue && syncAfterUpload.Value) { logger.Info("Beginning medication sync to HRA"); } else if (syncAfterUpload.HasValue && !syncAfterUpload.Value) { logger.Info("Beginning Live sync to HRA for CustomerId: " + customerId); } var medicationForSync = _medicationRepository.GetMedicationForSync(lastMaxIdColumn, customerId); do { var pulledRecordsCount = medicationForSync.Count(); if (medicationForSync.Any()) { try { lastMaxIdColumn = medicationForSync.Max(x => x.Id); _logger.Info("Begining Sync " + pulledRecordsCount + " records , Loop count: " + loopCount); var listModel = new MedicareMedicationListModel { Medication = Mapper.Map <IEnumerable <Medication>, IEnumerable <MedicareMedicationViewModel> >(medicationForSync).ToArray(), AuthToken = DateTime.UtcNow.ToLongTimeString().Encrypt(), OrganizationName = _setting.OrganizationNameForHraQuestioner }; var successCustomerIds = _medicareApiService.PostAnonymous <List <long> >(_setting.MedicareApiUrl + MedicareApiUrl.SyncMedication, listModel); var successCount = 0; if (successCustomerIds.Any()) { //easy way to find matching list in a list foreach (var cid in successCustomerIds.Distinct()) { foreach (var medication in medicationForSync) { if (cid == medication.CustomerId) { medication.DateModified = DateTime.Now; medication.ModifiedBy = modifiedBy; medication.IsSynced = true; _medicationRepository.SaveMedication(medication); successCount++; } } } } _logger.Info("Sync done for LoopCount: " + loopCount + " , successfully synced " + successCount + " records"); _logger.Info("Last max Id column is : " + lastMaxIdColumn); } catch (Exception ex) { logger.Error("Error Message: " + ex.Message + "\n\t Stack Trace: " + ex.StackTrace); } medicationForSync = _medicationRepository.GetMedicationForSync(lastMaxIdColumn, customerId); loopCount++; } } while (medicationForSync.Any()); if (syncAfterUpload.HasValue && syncAfterUpload.Value) { logger.Info("Exiting medication sync to HRA"); } else if (syncAfterUpload.HasValue && !syncAfterUpload.Value) { logger.Info("Exiting Live sync to HRA"); } } else { logger.Info(string.Format("SyncMedicationPollingAgent can not be called as time of day is {0}", DateTime.Now.TimeOfDay)); } } catch (Exception ex) { logger.Error("Exception occurred , Message: " + ex.Message + "\n\t Stack Trace: " + ex.StackTrace); } }
public void SaveCheckListAnswer(CheckListAnswerEditModel model, long orgUserId, long userLoginLogId, string token) { if (model.Answers.IsNullOrEmpty()) { return; } var eventCustomer = ((IUniqueItemRepository <EventCustomer>)_eventCustomerRepository).GetById(model.EventCustomerId); var lastestVersion = model.Version; if (model.Version == 0) { lastestVersion = _checkListAnswerRepository.GetLatestVersion(model.EventCustomerId); } if (model.Answers.IsNullOrEmpty()) { return; } var checklistAnswer = new List <CheckListAnswer>(); foreach (var answer in model.Answers) { checklistAnswer.Add(new CheckListAnswer { Answer = answer.Answer, QuestionId = answer.QuestionId, Version = lastestVersion + 1, Id = model.EventCustomerId, IsActive = true, DataRecorderMetaData = new DataRecorderMetaData(orgUserId, DateTime.Now, null), Type = (long)CheckListType.CheckList }); } _checkListAnswerRepository.SaveAnswer(checklistAnswer); try { var result = _eventCustomerResultRepository.GetById(model.EventCustomerId); if (token != "" && (result == null || result.ResultState < (long)TestResultStateNumber.PreAudit)) { var questionIds = model.Answers.Where(x => TestQuestionList.Contains(x.QuestionId)).Select(x => x.QuestionId); if (!questionIds.IsNullOrEmpty()) { var testIdsToBeUpdated = GetStandingOrderTest(questionIds); if (!testIdsToBeUpdated.IsNullOrEmpty()) { UpdateCustomerOrder(eventCustomer.EventId, eventCustomer.CustomerId, testIdsToBeUpdated, orgUserId); } } } } catch (Exception ex) { _logger.Error(string.Format("Some Error Occurred While Customer Updating Order. Exception Message {0} \t\n Stack Trace: {1}", ex.Message, ex.StackTrace)); } if (_settings.SyncWithHra) { if (token != "") { try { var visitId = _eventCustomerRepository.GetById(model.EventCustomerId).AwvVisitId; if (visitId.HasValue) { var answers = new MedicareStandingOrderViewModel { PatientVisitId = visitId.Value, Version = lastestVersion + 1, IsSync = true, Questions = model.Answers.Select(answer => new MedicareCheckListQuestionViewModel { Answer = answer.Answer, QuestionId = answer.QuestionId }).ToList() }; try { _medicareApiService.Connect(userLoginLogId); } catch (Exception) { var auth = new MedicareAuthenticationModel { UserToken = token, CustomerId = 0, OrgName = _settings.OrganizationNameForHraQuestioner, Tag = _settings.OrganizationNameForHraQuestioner, IsForAdmin = false, RoleAlias = "CallCenterRep" }; _medicareApiService.PostAnonymous <string>(_settings.MedicareApiUrl + MedicareApiUrl.AuthenticateUser, auth); _medicareApiService.Connect(userLoginLogId); } _medicareApiService.Post <bool>(MedicareApiUrl.SaveCheckList, answers); } } catch (Exception ex) { _logger.Error(string.Format("Some Error Occured Whicle Saving Checklist Answer To MEDICARE\n Exception Message {0} \t\n Stack Trace: {1}", ex.Message, ex.StackTrace)); } } } else { _logger.Info("Syncing with HRA is off "); } }
/// <summary> /// This can be rerun any time. The service updates the last run time and will continue /// </summary> public void Sync() { if (!_setting.SyncWithHra) { _logger.Info("Syncing with HRA is off "); return; } _logger.Info(string.Format("SyncRapsPollingAgent Started")); var skipCount = 0; var loopCount = 0; var timer = new Stopwatch(); try { if (_isDevEnvironment || !(DateTime.Now.TimeOfDay > new TimeSpan(6, 0, 0) && DateTime.Now.TimeOfDay < new TimeSpan(20, 0, 0))) { var raps = _rapsRepository.GetRapsForSync(skipCount).ToArray(); do { if (raps.Any()) { var recordsPulled = raps.Count(); _logger.Info(string.Format("Loop Count: {0} Skip Count: {1} #Records pulled for Sync: {2}", ++loopCount, skipCount, recordsPulled)); var orgName = _setting.OrganizationNameForHraQuestioner; try { var listModel = new MedicareRapsListModel() { Raps = Mapper.Map <IEnumerable <Raps>, IEnumerable <MedicareRapsViewModel> >(raps).ToArray(), OrganizationName = orgName, TimeToken = DateTime.UtcNow.ToLongTimeString().Encrypt() }; _logger.Info("Syncing Raps to HRA."); timer.Start(); var success = _medicareApiService.PostAnonymous <List <long> >(_setting.MedicareApiUrl + MedicareApiUrl.SyncRaps, listModel); timer.Stop(); _logger.Info("Sync to Hra complete, time taken: " + timer.ElapsedMilliseconds); timer.Reset(); if (success.Any()) { foreach (var medicareRapsViewModel in raps.Where(x => success.Contains(x.CustomerId))) { medicareRapsViewModel.IsSynced = true; _rapsRepository.SaveRaps(medicareRapsViewModel); } skipCount += recordsPulled - raps.Count(x => success.Contains(x.CustomerId)); } else { skipCount += recordsPulled; } } catch (Exception exception) { skipCount += recordsPulled; _logger.Error("Error Message: " + exception.Message + "\n\tStack Trace: " + exception.StackTrace); } raps = _rapsRepository.GetRapsForSync(skipCount).ToArray(); } } while (raps.Any()); } else { _logger.Info(string.Format("SyncRapsPollingAgent can not be called as time of day is {0}", DateTime.Now.TimeOfDay)); } } catch (Exception exception) { _logger.Error("Error occured in SyncRapsPollingAgent , Message: " + exception.Message + "\n\tStack Trace: " + exception.StackTrace); } _logger.Info("Sync Raps complete, Exiting..."); }
/// <summary> /// This can be rerun any time. The service updates the last run time and will continue /// </summary> public void Sync() { try { if (!_setting.SyncWithHra) { _logger.Info("Syncing with HRA is off "); return; } //get all tags for IsHealthPlan is true var tags = _corporateAccountRepository.GetHealthPlanTags(); if (tags != null && tags.Any()) { foreach (var tag in tags) { var newLastTransactionDate = DateTime.Now; // use the time when exporting for this tag starts, as start date for next day. _logger.Info("Medicare Customer Sync for tag : " + tag); var path = _medicareSyncCustomSettingsPath + "MedicareCustomerSync" + tag + ".xml"; var customSettings = _customSettingManager.Deserialize(path); if (customSettings == null || !customSettings.LastTransactionDate.HasValue) { customSettings = new CustomSettings { LastTransactionDate = DateTime.Now.AddMonths(-3) }; } if (customSettings.LastTransactionDate != null) { try { var exportFromTime = customSettings.LastTransactionDate.Value; var customerIds = _customerRepository.GetCustomerForMedicareSync(exportFromTime, tag); foreach (var customerId in customerIds) { var model = _medicareService.GetCustomerDetails(customerId); model.Tag = tag; model.IsRequestUpdateOnly = true; try { var result = _medicareApiService.PostAnonymous <MedicareCustomerSetupViewModel>( _setting.MedicareApiUrl + MedicareApiUrl.CreateUpdateCustomer, model); if (result != null) { _logger.Info("Medicare Customer Sync for tag: " + tag + " Customer : " + customerId); } } catch (Exception exception) { _logger.Error(" error occur Medicare Customer Sync for tag: " + tag + " Customer : " + customerId + " Message: " + exception.Message + "\n stack Trace: " + exception.StackTrace); } } } catch (Exception exception) { _logger.Error(" error occur SyncCustomerPollingAgent: " + tag + " exportFromTime : " + customSettings.LastTransactionDate.Value + " Message: " + exception.Message + "\n stack Trace: " + exception.StackTrace); } } _customSettingManager.SerializeandSave(path, new CustomSettings { LastTransactionDate = newLastTransactionDate }); } } } catch (Exception exception) { _logger.Error("Error occurred for SyncCustomerPollingAgent Message: " + exception.Message + "\n stack Trace: " + exception.StackTrace); } }
/// <summary> /// This can be rerun any time. The service updates the last run time and will continue /// </summary> public void Sync() { try { if (!_setting.SyncWithHra) { _logger.Info("Syncing with HRA is off "); return; } var newLastTransactionDate = DateTime.Now.AddMinutes(-1); // use the time when exporting for this tag starts, as start date for next day. _logger.Info("Medicare SyncUserCredentials : " + newLastTransactionDate.ToLongDateString()); var path = _medicareSyncCustomSettingsPath + "UserCredentialsSync.xml"; var customSettings = _customSettingManager.Deserialize(path); if (customSettings == null || !customSettings.LastTransactionDate.HasValue) { customSettings = new CustomSettings { LastTransactionDate = DateTime.Today.AddDays(-1) }; } var failed = false; if (customSettings.LastTransactionDate != null) { var exportFromTime = customSettings.LastTransactionDate.Value; var userCredentials = _userLoginRepository.GetUserForMedicareSync(exportFromTime); if (!userCredentials.Any()) { _logger.Info("No Data found for Sync: FromTime:" + exportFromTime); return; } const int pageSize = 25; var count = userCredentials.Count(); var totalPages = Math.Ceiling((double)(count) / pageSize); for (int i = 0; i < totalPages; i++) { _logger.Info("Page: " + i + 1 + ", No Of Entries to sync: " + count); var listModel = new MedicareUserCredentialListModel(); listModel.UserCredentials = userCredentials.Skip(i * pageSize).Take(pageSize).ToList(); //bind Npi and Credential to MedicareUserCredentialListModel var npiInfo = _userNpiInfoRepository.GetByUserIds(listModel.UserCredentials.Select(x => x.Id)); listModel.UserCredentials.ForEach(x => { var tempNpiCredentialInfo = npiInfo.FirstOrDefault(y => y.UserId == x.Id); x.Npi = tempNpiCredentialInfo == null ? null : tempNpiCredentialInfo.Npi; x.Credential = tempNpiCredentialInfo == null ? null : tempNpiCredentialInfo.Credential; }); try { _medicareApiService.PostAnonymous <bool>(_setting.MedicareApiUrl + MedicareApiUrl.SyncUserCredentials, listModel); } catch (Exception exception) { failed = true; _logger.Error("Error occur Medicare Customer Sync for Page : " + (i + 1) + " Message: " + exception.Message + "\nStack Trace: " + exception.StackTrace); } } } if (!failed) { _logger.Info("Xml updated with Value : " + newLastTransactionDate); _customSettingManager.SerializeandSave(path, new CustomSettings { LastTransactionDate = newLastTransactionDate }); } _logger.Info("Exiting Polling Agent"); } catch (Exception exception) { _logger.Error("Error occured SyncUserCredentialsPollingAgent , Message: " + exception.Message + "\n stack Trace: " + exception.StackTrace); } }
/// <summary> /// This can be rerun any time. The service updates the last run time and will continue /// </summary> public void Sync() { try { if (!_settings.SyncWithHra) { _logger.Info("Syncing with HRA is off "); return; } //get all tags for IsHealthPlan is true var tags = _organizationRepository.GetMedicareSites().Where(x => x.ShowHraQuestionnaire); if (tags != null && tags.Any()) { foreach (var tag in tags) { var newLastTransactionDate = DateTime.Now; // use the time when exporting for this tag starts, as start date for next day. _logger.Info("Medicare CustomerResult Sync for tag : " + tag.Alias); var path = _medicareSyncCustomSettingsPath + "MedicareCustomerResultSync" + tag.Alias + ".xml"; var customSettings = _customSettingManager.Deserialize(path); if (customSettings == null || !customSettings.LastTransactionDate.HasValue) { customSettings = new CustomSettings { LastTransactionDate = DateTime.Now.AddHours(-2) }; } if (customSettings.LastTransactionDate != null) { var exportFromTime = customSettings.LastTransactionDate.Value; var customerIds = _customerRepository.GetRecentResultUpdatedForMedicareSync(exportFromTime, tag.Alias).ToArray(); if (customerIds.Any()) { var events = customerIds.Select(x => x.EventId).Distinct().ToArray(); var eventIdsWithMammogramTest = _customerRepository.GetEventWithTest(events, tag.Alias, (long)TestType.Mammogram).ToArray(); var eventIdsWithEchocardiogram = _customerRepository.GetEventWithTest(events, tag.Alias, (long)TestType.AwvEcho).ToArray(); var eventIdsWithAwvLipid = _customerRepository.GetEventWithTest(events, tag.Alias, (long)TestType.AwvLipid).ToArray(); var eventIdsWithAwvSpiro = _customerRepository.GetEventWithTest(events, tag.Alias, (long)TestType.AwvSpiro).ToArray(); var eventIdsWithDiabeticRetinopathy = _customerRepository.GetEventWithTest(events, tag.Alias, (long)TestType.DiabeticRetinopathy).ToArray(); var eventIdsWithUrineMicroalbumin = _customerRepository.GetEventWithTest(events, tag.Alias, (long)TestType.UrineMicroalbumin).ToArray(); var eventIdsWithAwvEkg = _customerRepository.GetEventWithTest(events, tag.Alias, (long)TestType.AwvEkg).ToArray(); var eventIdsWithAwvHba1C = _customerRepository.GetEventWithTest(events, tag.Alias, (long)TestType.AwvHBA1C).ToArray(); var eventIdsWithAwvAaa = _customerRepository.GetEventWithTest(events, tag.Alias, (long)TestType.AwvAAA).ToArray(); var eventIdsWithAwvAbi = _customerRepository.GetEventWithTest(events, tag.Alias, (long)TestType.AwvABI).ToArray(); var eventIdsWithQuantaFloAbi = _customerRepository.GetEventWithTest(events, tag.Alias, (long)TestType.QuantaFloABI).ToArray(); var eventIdsWithLead = _customerRepository.GetEventWithTest(events, tag.Alias, (long)TestType.Lead).ToArray(); var eventIdsWithBp = _customerRepository.GetEventWithTest(events, tag.Alias, (long)TestType.Hypertension).ToArray(); var eventList = _eventRepository.GetEvents(events).ToArray(); //var eventIdsWithMonoFilament = _customerRepository.GetEventWithTest(events, tag.Alias, (long)TestType.Monofilament).ToArray(); const int pageSize = 25; var totalPages = Math.Ceiling((double)(customerIds.Count()) / pageSize); for (int i = 0; i < totalPages; i++) { var currentList = customerIds.Skip(i * pageSize).Take(pageSize).ToArray(); try { foreach (var medicareResultEditModel in currentList) { var eventData = eventList.First(e => e.Id == medicareResultEditModel.EventId); var isNewResultFlow = eventData.EventDate >= _settings.ResultFlowChangeDate; var evaluatingPhysicians = _physicianEvaluationRepsoitory.GetPhysicianEvaluation(medicareResultEditModel.EventCustomerId); if (evaluatingPhysicians != null) { var primaryEvalRecord = evaluatingPhysicians != null?evaluatingPhysicians.Where(p => p.IsPrimaryEvaluator).OrderByDescending(p => p.EvaluationEndTime ?? p.EvaluationStartTime).FirstOrDefault() : null; var primaryPhysicianId = primaryEvalRecord != null ? primaryEvalRecord.PhysicianId : 0; var overreadPhysicianId = primaryEvalRecord != null?evaluatingPhysicians.Where(p => !p.IsPrimaryEvaluator && p.EvaluationStartTime > primaryEvalRecord.EvaluationStartTime).OrderByDescending( p => p.EvaluationEndTime ?? p.EvaluationStartTime).Select(p => p.PhysicianId).FirstOrDefault() : 0; medicareResultEditModel.PhysicianOruId = overreadPhysicianId > 0 ? overreadPhysicianId : primaryPhysicianId; } if (eventIdsWithBp.Contains(medicareResultEditModel.EventId)) //1 { // Blood Pressure Evaluation Test or Hypertension var testResultRepository = new HypertensionTestRepository(); var aaaTestResult = testResultRepository.GetTestResults(medicareResultEditModel.CustomerId, medicareResultEditModel.EventId, isNewResultFlow); var aaaTest = ((Core.Medical.Domain.HypertensionTestResult)aaaTestResult); if (aaaTest != null && aaaTest.TestNotPerformed == null && aaaTest.UnableScreenReason == null) { medicareResultEditModel.BpReading = new MedicareResultEditModel.Bp(); medicareResultEditModel.BpReading.Systolic = aaaTest.Systolic != null ? aaaTest.Systolic.Reading : null; medicareResultEditModel.BpReading.Diastolic = aaaTest.Diastolic != null ? aaaTest.Diastolic.Reading : null; } } if (eventIdsWithAwvAaa.Contains(medicareResultEditModel.EventId)) //1 { // Update the AAA result var testResultRepository = new AwvAaaTestRepository(); var aaaTestResult = testResultRepository.GetTestResults(medicareResultEditModel.CustomerId, medicareResultEditModel.EventId, isNewResultFlow); var aaaTest = ((Core.Medical.Domain.AwvAaaTestResult)aaaTestResult); if (aaaTest != null && aaaTest.Finding != null && aaaTest.TestNotPerformed == null && aaaTest.UnableScreenReason == null) { medicareResultEditModel.AaaResult = new MedicareResultEditModel.AaaReadings(); medicareResultEditModel.AaaResult.AortaSize = aaaTest.Finding != null ? aaaTest.Finding.Label : null; medicareResultEditModel.AaaResult.AorticDissection = aaaTest.AorticDissection != null && aaaTest.AorticDissection.Reading; medicareResultEditModel.AaaResult.Plaque = aaaTest.Plaque != null && aaaTest.Plaque.Reading; medicareResultEditModel.AaaResult.Thrombus = aaaTest.Thrombus != null && aaaTest.Thrombus.Reading; if (aaaTest.IncidentalFindings != null) { foreach (var standardFinding in aaaTest.IncidentalFindings) { if (standardFinding.Label == "Aortic Stenosis") { medicareResultEditModel.AaaResult.AorticStenosis = true; } } } } } if (eventIdsWithAwvAbi.Contains(medicareResultEditModel.EventId))//2 { // AwvAbi var testResultRepository = new AwvAbiTestRepository(); var padTestResult = testResultRepository.GetTestResults(medicareResultEditModel.CustomerId, medicareResultEditModel.EventId, isNewResultFlow); var aaaTest = ((Core.Medical.Domain.AwvAbiTestResult)padTestResult); if (aaaTest != null && aaaTest.Finding != null && aaaTest.TestNotPerformed == null && aaaTest.UnableScreenReason == null) { medicareResultEditModel.PadReading = new MedicareResultEditModel.PadTestReadings(); medicareResultEditModel.PadReading.Finding = aaaTest.Finding.Label; } } if (eventIdsWithQuantaFloAbi.Contains(medicareResultEditModel.EventId))//3 { // QuantaFlo Abi var testResultRepository = new QuantaFloABITestRepository(); var padTestResult = testResultRepository.GetTestResults(medicareResultEditModel.CustomerId, medicareResultEditModel.EventId, isNewResultFlow); var aaaTest = ((Core.Medical.Domain.QuantaFloABITestResult)padTestResult); if (aaaTest != null && aaaTest.Finding != null && aaaTest.TestNotPerformed == null && aaaTest.UnableScreenReason == null) { medicareResultEditModel.QuantaFloReading = new MedicareResultEditModel.QuantaFloReadings(); medicareResultEditModel.QuantaFloReading.Finding = aaaTest.Finding.Label; } } if (eventIdsWithLead.Contains(medicareResultEditModel.EventId))//5 { // Lead var testResultRepository = new LeadTestRepository(); var leadTestResult = testResultRepository.GetTestResults(medicareResultEditModel.CustomerId, medicareResultEditModel.EventId, isNewResultFlow); var leadTest = ((Core.Medical.Domain.LeadTestResult)leadTestResult); if (leadTest != null && leadTest.TestNotPerformed == null && leadTest.UnableScreenReason == null) { medicareResultEditModel.LeadReading = new MedicareResultEditModel.LeadReadings(); if (leadTest.LeftResultReadings != null) { medicareResultEditModel.LeadReading.LNoVisualPlaque = leadTest.LeftResultReadings.NoVisualPlaque != null && leadTest.LeftResultReadings.NoVisualPlaque.Reading.HasValue && leadTest.LeftResultReadings.NoVisualPlaque.Reading.Value; medicareResultEditModel.LeadReading.LVisuallyDemonstratedPlaque = leadTest.LeftResultReadings.VisuallyDemonstratedPlaque != null && leadTest.LeftResultReadings.VisuallyDemonstratedPlaque.Reading.HasValue && leadTest.LeftResultReadings.VisuallyDemonstratedPlaque.Reading.Value; medicareResultEditModel.LeadReading.LModerateStenosis = leadTest.LeftResultReadings.ModerateStenosis != null && leadTest.LeftResultReadings.ModerateStenosis.Reading.HasValue && leadTest.LeftResultReadings.ModerateStenosis.Reading.Value; medicareResultEditModel.LeadReading.LPossibleOcclusion = leadTest.LeftResultReadings.PossibleOcclusion != null && leadTest.LeftResultReadings.PossibleOcclusion.Reading.HasValue && leadTest.LeftResultReadings.PossibleOcclusion.Reading.Value; } if (leadTest.LowVelocityLeft != null) { medicareResultEditModel.LeadReading.LowVelocityLeft = true; } if (leadTest.RightResultReadings != null) { medicareResultEditModel.LeadReading.RNoVisualPlaque = leadTest.RightResultReadings.NoVisualPlaque != null && leadTest.RightResultReadings.NoVisualPlaque.Reading.HasValue && leadTest.RightResultReadings.NoVisualPlaque.Reading.Value; medicareResultEditModel.LeadReading.RVisuallyDemonstratedPlaque = leadTest.RightResultReadings.VisuallyDemonstratedPlaque != null && leadTest.RightResultReadings.VisuallyDemonstratedPlaque.Reading.HasValue && leadTest.RightResultReadings.VisuallyDemonstratedPlaque.Reading.Value; medicareResultEditModel.LeadReading.RModerateStenosis = leadTest.RightResultReadings.ModerateStenosis != null && leadTest.RightResultReadings.ModerateStenosis.Reading.HasValue && leadTest.RightResultReadings.ModerateStenosis.Reading.Value; medicareResultEditModel.LeadReading.RPossibleOcclusion = leadTest.RightResultReadings.PossibleOcclusion != null && leadTest.RightResultReadings.PossibleOcclusion.Reading.HasValue && leadTest.RightResultReadings.PossibleOcclusion.Reading.Value; } if (leadTest.LowVelocityRight != null) { medicareResultEditModel.LeadReading.LowVelocityRight = true; } } } if (eventIdsWithMammogramTest.Contains(medicareResultEditModel.EventId)) { // Update the mammogram result var testResultRepository = new MammogramTestRepository(); var mammogramTestResult = testResultRepository.GetTestResults(medicareResultEditModel.CustomerId, medicareResultEditModel.EventId, isNewResultFlow); var mamoTest = ((Core.Medical.Domain.MammogramTestResult)mammogramTestResult); if (mamoTest != null && mamoTest.Finding != null && mamoTest.TestNotPerformed == null && mamoTest.UnableScreenReason == null) { medicareResultEditModel.MammogramReading = mamoTest.Finding.Label; } } if (eventIdsWithAwvSpiro.Contains(medicareResultEditModel.EventId)) { var testResultRepository = new AwvSpiroTestRepository(); var awvSpiroTestResult = testResultRepository.GetTestResults(medicareResultEditModel.CustomerId, medicareResultEditModel.EventId, isNewResultFlow); if (awvSpiroTestResult != null && awvSpiroTestResult.TestNotPerformed == null && awvSpiroTestResult.UnableScreenReason == null) { if (awvSpiroTestResult.ResultStatus != null) { medicareResultEditModel.AwvSpiroStateNumber = (int)awvSpiroTestResult.ResultStatus.StateNumber; } var spirotest = ((Core.Medical.Domain.AwvSpiroTestResult)awvSpiroTestResult); if (spirotest.Finding != null) { medicareResultEditModel.AwvSpiroFindingLabel = spirotest.Finding.Label; } if (spirotest.Obstructive != null) { medicareResultEditModel.AwvSpiroObstructiveLabel = spirotest.Obstructive.Label.ToString(); } } } //if (eventIdsWithMonoFilament.Contains(medicareResultEditModel.EventId)) //{ // var testResultRepository = new MonofilamentTestRepository(); // var monoTestResult = testResultRepository.GetTestResults(medicareResultEditModel.CustomerId, medicareResultEditModel.EventId); // if (monoTestResult != null && monoTestResult.ResultStatus != null) // { // medicareResultEditModel.MonoFilamentStateNumber = (int)monoTestResult.ResultStatus.StateNumber; // } //} if (eventIdsWithEchocardiogram.Contains(medicareResultEditModel.EventId)) { var testResultRepository = new AwvEchocardiogramTestRepository(); var awvEchoTestResult = testResultRepository.GetTestResults(medicareResultEditModel.CustomerId, medicareResultEditModel.EventId, isNewResultFlow); if (awvEchoTestResult != null && awvEchoTestResult.TestNotPerformed == null && awvEchoTestResult.UnableScreenReason == null) { try { if (awvEchoTestResult != null && awvEchoTestResult.ResultStatus != null) { medicareResultEditModel.AwvEchoStateNumber = (int)awvEchoTestResult.ResultStatus.StateNumber; } var echocartest = ((Core.Medical.Domain.AwvEchocardiogramTestResult)awvEchoTestResult); medicareResultEditModel.AwvEchoFindingLabel = echocartest.EstimatedEjactionFraction != null ? echocartest.EstimatedEjactionFraction.Label : null; medicareResultEditModel.EchocardiogramReading = new MedicareResultEditModel.EchocardiogramReadings(); if (echocartest.EstimatedEjactionFraction != null) { medicareResultEditModel.EchocardiogramReading.EstimatedEjactionFractionMin = echocartest.EstimatedEjactionFraction.MinValue; medicareResultEditModel.EchocardiogramReading.EstimatedEjactionFractionMax = echocartest.EstimatedEjactionFraction.MaxValue; } //Aortic medicareResultEditModel.EchocardiogramReading.Aortic = echocartest.Aortic != null && echocartest.Aortic.Reading; if (echocartest.AorticMorphology != null) { foreach (var standardFinding in echocartest.AorticMorphology) { if (standardFinding.Label == "Stenosis") { medicareResultEditModel.EchocardiogramReading.AorticStenosis = true; } } } var aorticRegurgitation = echocartest.AorticRegurgitation != null ? echocartest.AorticRegurgitation.Label : null; medicareResultEditModel.EchocardiogramReading.AorticRegurgitation = aorticRegurgitation != null ? (aorticRegurgitation == "Mod" ? "Moderate" : aorticRegurgitation) : null; //Mitral medicareResultEditModel.EchocardiogramReading.Mitral = echocartest.Mitral != null && echocartest.Mitral.Reading; if (echocartest.MitralMorphology != null) { foreach (var standardFinding in echocartest.MitralMorphology) { if (standardFinding.Label == "Stenosis") { medicareResultEditModel.EchocardiogramReading.MitralStenosis = true; } if (standardFinding.Label == "Mitral Prolapse") { medicareResultEditModel.EchocardiogramReading.MitralProlapse = true; } } } var mitralRegurgitation = echocartest.MitralRegurgitation != null ? echocartest.MitralRegurgitation.Label : null; medicareResultEditModel.EchocardiogramReading.MitralRegurgitation = mitralRegurgitation != null ? (mitralRegurgitation == "Mod" ? "Moderate" : mitralRegurgitation) : null; //Pulmonic medicareResultEditModel.EchocardiogramReading.Pulmonic = echocartest.Pulmonic != null && echocartest.Pulmonic.Reading; var pulmonicRegurgitation = echocartest.PulmonicRegurgitation != null ? echocartest.PulmonicRegurgitation.Label : null; medicareResultEditModel.EchocardiogramReading.PulmonicRegurgitation = pulmonicRegurgitation != null ? (pulmonicRegurgitation == "Mod" ? "Moderate" : pulmonicRegurgitation) : null; //Tricuspid medicareResultEditModel.EchocardiogramReading.Tricuspid = echocartest.Tricuspid != null && echocartest.Tricuspid.Reading; medicareResultEditModel.EchocardiogramReading.HighOrGreater = echocartest.MorphologyTricuspidHighOrGreater != null && echocartest.MorphologyTricuspidHighOrGreater.Reading; medicareResultEditModel.EchocardiogramReading.TricuspidPap = echocartest.TricuspidPap != null ? echocartest.TricuspidPap.Reading : null; var tricuspidRegurgitation = echocartest.TricuspidRegurgitation != null ? echocartest.TricuspidRegurgitation.Label : null; medicareResultEditModel.EchocardiogramReading.TricuspidRegurgitation = tricuspidRegurgitation != null ? (tricuspidRegurgitation == "Mod" ? "Moderate" : tricuspidRegurgitation) : null; //DiastolicDysfunction medicareResultEditModel.EchocardiogramReading.DiastolicDysfunction = echocartest.DiastolicDysfunction != null && echocartest.DiastolicDysfunction.Reading; medicareResultEditModel.EchocardiogramReading.DistolicDysfunctionFinding = echocartest.DistolicDysfunctionFinding != null ? echocartest.DistolicDysfunctionFinding.Label : null; medicareResultEditModel.EchocardiogramReading.DiastolicDysfunctionEeRatio = echocartest.DiastolicDysfunctionEeRatio != null ? echocartest.DiastolicDysfunctionEeRatio.Reading : null; medicareResultEditModel.EchocardiogramReading.AorticRoot = echocartest.AorticRoot != null && echocartest.AorticRoot.Reading; medicareResultEditModel.EchocardiogramReading.Sclerotic = echocartest.Sclerotic != null && echocartest.Sclerotic.Reading; medicareResultEditModel.EchocardiogramReading.Atherosclerosis = echocartest.Atherosclerosis != null && echocartest.Atherosclerosis.Reading; medicareResultEditModel.EchocardiogramReading.VentricularHypertrophy = echocartest.VentricularHypertrophy != null && echocartest.VentricularHypertrophy.Reading; medicareResultEditModel.EchocardiogramReading.Arrythmia = echocartest.Arrythmia != null && echocartest.Arrythmia.Reading; medicareResultEditModel.EchocardiogramReading.AFib = echocartest.AFib != null && echocartest.AFib.Reading; medicareResultEditModel.EchocardiogramReading.AFlutter = echocartest.AFlutter != null && echocartest.AFlutter.Reading; } catch (Exception ex) { _logger.Error(" error EchocardiogramReading Customer : " + medicareResultEditModel.CustomerId + " Message: " + ex.Message + "\n stack Trace: " + ex.StackTrace); } } } if (eventIdsWithUrineMicroalbumin.Contains(medicareResultEditModel.EventId)) { var testResultRepository = new UrineMicroalbuminTestRepository(); var awvUrinTestResult = testResultRepository.GetTestResults(medicareResultEditModel.CustomerId, medicareResultEditModel.EventId, isNewResultFlow); if (awvUrinTestResult != null && awvUrinTestResult.ResultStatus != null && awvUrinTestResult.TestNotPerformed == null && awvUrinTestResult.UnableScreenReason == null) { medicareResultEditModel.AwvUrinStateNumber = (int)awvUrinTestResult.ResultStatus.StateNumber; var urintest = ((Core.Medical.Domain.UrineMicroalbuminTestResult)awvUrinTestResult); if (urintest != null && urintest.Finding != null) { medicareResultEditModel.AwvUrinFindingLabel = urintest.Finding.Label; } } } if (eventIdsWithAwvLipid.Contains(medicareResultEditModel.EventId)) { var testResultRepository = new AwvLipidTestRepository(); var awvLipidTestResult = testResultRepository.GetTestResults(medicareResultEditModel.CustomerId, medicareResultEditModel.EventId, isNewResultFlow); if (awvLipidTestResult != null && awvLipidTestResult.ResultStatus != null && awvLipidTestResult.TestNotPerformed == null && awvLipidTestResult.UnableScreenReason == null) { medicareResultEditModel.AwvLipidStateNumber = (int)awvLipidTestResult.ResultStatus.StateNumber; var awvLipid = ((Core.Medical.Domain.AwvLipidTestResult)awvLipidTestResult); if (awvLipid != null) { medicareResultEditModel.LipidReading = new MedicareResultEditModel.Lipid(); if (awvLipid.TotalCholestrol != null && awvLipid.TotalCholestrol.Finding != null) { medicareResultEditModel.AwvLipidTotalCholestrol = awvLipid.TotalCholestrol.Reading; medicareResultEditModel.LipidReading.Tc = awvLipid.TotalCholestrol.Reading; } if (awvLipid.HDL != null && awvLipid.HDL.Finding != null) { medicareResultEditModel.LipidReading.Hdl = awvLipid.HDL.Reading; } if (awvLipid.LDL != null && awvLipid.LDL.Finding != null) { medicareResultEditModel.LipidReading.Ldl = awvLipid.LDL.Reading; } if (awvLipid.TriGlycerides != null && awvLipid.TriGlycerides.Finding != null) { medicareResultEditModel.LipidReading.Trig = awvLipid.TriGlycerides.Reading; } } } } if (eventIdsWithDiabeticRetinopathy.Contains(medicareResultEditModel.EventId)) { var testResultRepository = new DiabeticRetinopathyTestRepository(); var awvDrsTestResult = testResultRepository.GetTestResults(medicareResultEditModel.CustomerId, medicareResultEditModel.EventId, isNewResultFlow); if (awvDrsTestResult != null && awvDrsTestResult.ResultStatus != null && awvDrsTestResult.TestNotPerformed == null && awvDrsTestResult.UnableScreenReason == null) { medicareResultEditModel.AwvDrsStateNumber = (int)awvDrsTestResult.ResultStatus.StateNumber; } } if (eventIdsWithAwvEkg.Contains(medicareResultEditModel.EventId)) { var testResultRepository = new AwvEkgTestRepository(); var awvEkgTestResult = testResultRepository.GetTestResults(medicareResultEditModel.CustomerId, medicareResultEditModel.EventId, isNewResultFlow); if (awvEkgTestResult != null && awvEkgTestResult.ResultStatus != null && awvEkgTestResult.TestNotPerformed == null && awvEkgTestResult.UnableScreenReason == null) { medicareResultEditModel.AwvEkgStateNumber = (int)awvEkgTestResult.ResultStatus.StateNumber; } } if (eventIdsWithAwvHba1C.Contains(medicareResultEditModel.EventId)) { var testResultRepository = new AwvHemaglobinTestRepository(); var awvHba1CTestResult = testResultRepository.GetTestResults(medicareResultEditModel.CustomerId, medicareResultEditModel.EventId, isNewResultFlow); if (awvHba1CTestResult != null && awvHba1CTestResult.ResultStatus != null && awvHba1CTestResult.TestNotPerformed == null && awvHba1CTestResult.UnableScreenReason == null) { medicareResultEditModel.AwvHbA1CStateNumber = (int)awvHba1CTestResult.ResultStatus.StateNumber; } } } _logger.Info("Medicare Customer Sync Starting for tag: " + tag.Alias + " Page : " + (i + 1)); var phyids = currentList.Where(x => x.PhysicianOruId > 0).Select(x => x.PhysicianOruId).ToArray(); var names = _organizationRoleUserRepository.GetNameIdPairofUsers(phyids); if (names.Any()) { foreach (var medicareResultEditModel in currentList.Where(x => x.PhysicianOruId > 0)) { var n = names.FirstOrDefault(x => x.FirstValue == medicareResultEditModel.PhysicianOruId); if (n != null) { medicareResultEditModel.PhysicianName = n.SecondValue; } } } var model = new MedicareResultListmodel { EhrResultEditmodels = currentList.ToList() }; var result = _medicareApiService.PostAnonymous <bool>(_settings.MedicareApiUrl + MedicareApiUrl.UpdateCustomerResult, model); if (result) { _logger.Info("Medicare Customer Sync for tag: " + tag.Alias + " Page : " + (i + 1)); } } catch (Exception exception) { _logger.Error(" error occur Medicare Customer Sync for tag: " + tag.Alias + " Customer : " + (i + 1) + " Message: " + exception.Message + "\n stack Trace: " + exception.StackTrace); } } } var kynCustomerIds = _kyaLabValuesRepository.GetRecentKynLabValuesForMedicareSync(exportFromTime, tag.Alias).ToArray(); if (kynCustomerIds.Any()) { const int pageSize = 25; var totalPages = Math.Ceiling((double)(kynCustomerIds.Count()) / pageSize); for (var i = 0; i < totalPages; i++) { var currentList = kynCustomerIds.Skip(i * pageSize).Take(pageSize).ToArray(); try { _logger.Info("Medicare Customer Sync Starting for tag: " + tag.Alias + " Page : " + (i + 1)); var model = new MedicareKynResultListmodel() { EhrResultEditmodels = currentList.ToList() }; var result = _medicareApiService.PostAnonymous <bool>(_settings.MedicareApiUrl + MedicareApiUrl.UpdateCustomerKynResult, model); if (result) { _logger.Info("Medicare Customer Sync for tag: " + tag.Alias + " Page : " + (i + 1)); } } catch (Exception exception) { _logger.Error(" error occur Medicare Customer Sync for tag: " + tag.Alias + " Customer : " + (i + 1) + " Message: " + exception.Message + "\n stack Trace: " + exception.StackTrace); } } } } _customSettingManager.SerializeandSave(path, new CustomSettings { LastTransactionDate = newLastTransactionDate }); } } } catch (Exception exception) { _logger.Error("Error occurred for SyncCustomerResultPollingAgent Message: " + exception.Message + "\n stack Trace: " + exception.StackTrace); } }