From f9277de9efa416bf467dcb7383f0ab659cbe314c Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 5 May 2023 14:18:48 +0800 Subject: [PATCH] =?UTF-8?q?IR=20=E7=94=B3=E8=AF=B7=E9=87=8D=E9=98=85?= =?UTF-8?q?=EF=BC=8C=E4=BB=85=E4=BB=85=E7=94=9F=E6=95=88=E7=9A=84=E8=AE=BF?= =?UTF-8?q?=E8=A7=86=E4=BB=BB=E5=8A=A1=EF=BC=8CPM=E5=90=8C=E6=84=8F?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E6=89=8D=E7=94=9F=E6=88=90?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Allocation/VisitTaskService.cs | 8 +++++--- .../Service/ImageAndDoc/DicomArchiveService.cs | 6 +++--- .../SiteSurvey/TrialSiteSurveyService.cs | 18 +++++++++--------- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index 6108b46bf..d2d3ce0b7 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -1854,6 +1854,8 @@ namespace IRaCIS.Core.Application.Service.Allocation foreach (var influenceTask in influenceTaskList) { + var beforeTaskState = influenceTask.TaskState; + //已签名的任务 设置转变后的标志 if (criterionConfig.CriterionType == CriterionType.IRECIST1Point1 && influenceTask.ReadingTaskState == ReadingTaskState.HaveSigned) { @@ -1879,7 +1881,7 @@ namespace IRaCIS.Core.Application.Service.Allocation } - var beforeTaskState = influenceTask.TaskState; + if (influenceTask.ReadingTaskState == ReadingTaskState.HaveSigned) { @@ -1895,7 +1897,7 @@ namespace IRaCIS.Core.Application.Service.Allocation } // 影响的任务 仅仅访视类别的才生成 或者就是IR 申请的任务 - if (influenceTask.ReadingCategory == ReadingCategory.Visit || influenceTask.Id == origenalTask.Id) + if ((beforeTaskState==TaskState.Effect && influenceTask.ReadingCategory == ReadingCategory.Visit) || influenceTask.Id == origenalTask.Id) { @@ -1907,7 +1909,7 @@ namespace IRaCIS.Core.Application.Service.Allocation } - //当前任务是转变任务,并且影响列表里有转变之前的任务 那么该访视任务就不生成 + // i1.1标准 当前任务是转变任务,并且影响列表里有转变之前的任务 那么该访视任务就不生成 if (criterionConfig.CriterionType == CriterionType.IRECIST1Point1 && influenceTask.BeforeConvertedTaskId != null && influenceTaskList.Any(t => t.Id == influenceTask.BeforeConvertedTaskId)) { continue; diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DicomArchiveService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DicomArchiveService.cs index 0af64f1d0..f797c8ca4 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DicomArchiveService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DicomArchiveService.cs @@ -393,9 +393,9 @@ namespace IRaCIS.Core.Application.Services ProtocolName = dataset.GetSingleValueOrDefault(DicomTag.ProtocolName, string.Empty), ImagerPixelSpacing = dataset.GetSingleValueOrDefault(DicomTag.ImagerPixelSpacing, string.Empty), - AcquisitionTime = dataset.GetSingleValueOrDefault(DicomTag.ImagerPixelSpacing, string.Empty), - AcquisitionNumber = dataset.GetSingleValueOrDefault(DicomTag.ImagerPixelSpacing, string.Empty), - TriggerTime = dataset.GetSingleValueOrDefault(DicomTag.ImagerPixelSpacing, string.Empty), + AcquisitionTime = dataset.GetSingleValueOrDefault(DicomTag.AcquisitionTime, string.Empty), + AcquisitionNumber = dataset.GetSingleValueOrDefault(DicomTag.AcquisitionNumber, string.Empty), + TriggerTime = dataset.GetSingleValueOrDefault(DicomTag.TriggerTime, string.Empty), SiteId = dicomStudy.SiteId, TrialId = dicomStudy.TrialId, diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs index d54842b95..cba0db1e8 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs @@ -872,16 +872,16 @@ namespace IRaCIS.Core.Application.Contracts //判断TrialUser中是否存在 不存在就插入 if (!await _trialUserRepository.AnyAsync(t => t.TrialId == trialId && t.UserId == userId, true)) { - - await _repository.AddAsync(new TrialUser() { TrialId = trialId, UserId = userId, JoinTime = DateTime.Now }); - - await _repository.AddAsync(new TrialSiteUser() { TrialId = trialId, SiteId = siteId, UserId = userId }); - - await _userRepository.BatchUpdateNoTrackingAsync(t => t.Id == userId, u => new User() { Status = UserStateEnum.Enable }); - - await _trialSiteUserSurveyRepository.UpdatePartialFromQueryAsync(t => t.Id == userInfo.Id, u => new TrialSiteUserSurvey() { IsJoin = true }); - + await _repository.AddAsync(new TrialUser() { TrialId = trialId, UserId = userId, JoinTime = DateTime.Now }); } + if (!await _repository.AnyAsync(t => t.TrialId == trialId && t.UserId == userId && t.SiteId==siteId, true)) + { + await _repository.AddAsync(new TrialSiteUser() { TrialId = trialId, SiteId = siteId, UserId = userId }); + } + + await _userRepository.BatchUpdateNoTrackingAsync(t => t.Id == userId, u => new User() { Status = UserStateEnum.Enable }); + + await _trialSiteUserSurveyRepository.UpdatePartialFromQueryAsync(t => t.Id == userInfo.Id, u => new TrialSiteUserSurvey() { IsJoin = true }); await _mailVerificationService.SiteSurveyUserJoinEmail(trialId, userId, joinCommand.BaseUrl, joinCommand.RouteUrl);