From 29a47e7351225dda815ab621a66f3c15cce809d2 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 8 Nov 2023 16:43:52 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=82=AE=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wwwroot/EmailTemplate/TrialDoctorExistJoin.html | 5 ++++- .../wwwroot/EmailTemplate/TrialDoctorExistJoin_US.html | 5 ++++- .../wwwroot/EmailTemplate/TrialUserExistJoin.html | 5 ++++- .../wwwroot/EmailTemplate/TrialUserExistJoin_US.html | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorExistJoin.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorExistJoin.html index 8686d015e..4152662c4 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorExistJoin.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorExistJoin.html @@ -34,7 +34,10 @@ 角色: {5}
- 系统登录地址:{6} + 系统登录地址: + + 点击跳转 +
diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorExistJoin_US.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorExistJoin_US.html index fcea3bd36..5dbc004ee 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorExistJoin_US.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorExistJoin_US.html @@ -34,7 +34,10 @@ Role: {5}
- Login URL: {6} + Login URL: + + click redirect +
diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserExistJoin.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserExistJoin.html index 5020ee521..3b91510ab 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserExistJoin.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserExistJoin.html @@ -34,7 +34,10 @@ 角色: {5}
- 系统登录地址:{6} + 系统登录地址: + + 点击跳转 +
diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserExistJoin_US.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserExistJoin_US.html index 6be54f794..7a3c19868 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserExistJoin_US.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserExistJoin_US.html @@ -34,7 +34,10 @@ Role: {5}
- Login URL: {6} + Login URL: + + click redirect +
From d7e5b3f57cca34e51a4c986689afa551c2a658a5 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 8 Nov 2023 18:27:58 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=BB=BA=E8=AE=AE?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.API/IRaCIS.Core.API.xml | 3 + .../Allocation/VisitTaskHelpeService.cs | 95 +++---------------- 2 files changed, 18 insertions(+), 80 deletions(-) diff --git a/IRaCIS.Core.API/IRaCIS.Core.API.xml b/IRaCIS.Core.API/IRaCIS.Core.API.xml index fe5eb4c96..4d391ccd8 100644 --- a/IRaCIS.Core.API/IRaCIS.Core.API.xml +++ b/IRaCIS.Core.API/IRaCIS.Core.API.xml @@ -226,6 +226,9 @@ + + 通用文件下载 + 上传通用文档 比如一致性核查的 比如导出的excel 模板 diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs index 548987b2b..a5b261a2b 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs @@ -233,83 +233,8 @@ namespace IRaCIS.Core.Application.Service && t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.TaskState == TaskState.Effect && t.SourceSubjectVisitId == subjectVisit.Id).ToList(); - if (trialReadingCriterionConfig.ReadingType == ReadingMethod.Double) - { - - - VisitTask? task1 = existCurrentVisitTaskList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm1); - VisitTask? task2 = existCurrentVisitTaskList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm2); - - if (!existCurrentVisitTaskList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1)) - { - currentMaxCodeInt = currentMaxCodeInt + 1; - - - - - task1 = await _visitTaskRepository.AddAsync(new VisitTask() - { - TrialId = trialId, - SubjectId = subjectVisit.SubjectId, - IsUrgent = subjectVisit.IsUrgent, - TaskBlindName = blindTaskName, - TaskName = subjectVisit.VisitName, - VisitTaskNum = subjectVisit.VisitNum, - TaskUrgentType = taskUrgentType, - IsCanEditUrgentState = isCanEditUrgentState, - //CheckPassedTime = subjectVisit.CheckPassedTime, - ArmEnum = Arm.DoubleReadingArm1,//特殊 - Code = currentMaxCodeInt, - SourceSubjectVisitId = subjectVisit.Id, - TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt, nameof(VisitTask)), - ReadingCategory = ReadingCategory.Visit, - - TrialReadingCriterionId = trialReadingCriterionConfig.TrialReadingCriterionId, - IsNeedClinicalDataSign = isNeedClinicalDataSign, - IsClinicalDataSign = isClinicalDataSign - }); - - } - - if (!existCurrentVisitTaskList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2)) - { - currentMaxCodeInt = currentMaxCodeInt + 1; - - - task2 = await _visitTaskRepository.AddAsync(new VisitTask() - { - TrialId = trialId, - SubjectId = subjectVisit.SubjectId, - IsUrgent = subjectVisit.IsUrgent, - TaskBlindName = blindTaskName, - TaskName = subjectVisit.VisitName, - TaskUrgentType = taskUrgentType, - IsCanEditUrgentState = isCanEditUrgentState, - VisitTaskNum = subjectVisit.VisitNum, - //CheckPassedTime = subjectVisit.CheckPassedTime, - ArmEnum = Arm.DoubleReadingArm2,//特殊 - Code = currentMaxCodeInt, - SourceSubjectVisitId = subjectVisit.Id, - TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt, nameof(VisitTask)), - ReadingCategory = ReadingCategory.Visit, - - TrialReadingCriterionId = trialReadingCriterionConfig.TrialReadingCriterionId, - IsNeedClinicalDataSign = isNeedClinicalDataSign, - IsClinicalDataSign = isClinicalDataSign - }); - - - } - - _provider.Set($"{trialId}_{StaticData.CacheKey.TaskMaxCode}", currentMaxCodeInt, TimeSpan.FromMinutes(30)); - - - - - var defaultState = trialReadingCriterionConfig.FollowVisitAutoAssignDefaultState == TaskAllocateDefaultState.InitAllocated ? TaskAllocationState.InitAllocated : TaskAllocationState.Allocated; - - } - else if (trialReadingCriterionConfig.ReadingType == ReadingMethod.Single) + //只有单重阅片 + if (trialReadingCriterionConfig.ReadingType == ReadingMethod.Single) { VisitTask? singleTask = existCurrentVisitTaskList.FirstOrDefault(t => t.ArmEnum == Arm.SingleReadingArm); @@ -336,8 +261,12 @@ namespace IRaCIS.Core.Application.Service ReadingCategory = ReadingCategory.Visit, TrialReadingCriterionId = trialReadingCriterionConfig.TrialReadingCriterionId, IsNeedClinicalDataSign = isNeedClinicalDataSign, - IsClinicalDataSign = isClinicalDataSign - }); + IsClinicalDataSign = isClinicalDataSign, + + SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget) + + + }); } @@ -681,11 +610,11 @@ namespace IRaCIS.Core.Application.Service //之前有回退到影像上传的访视 那么当前访视一致性核查通过的时候,当前访视生成但是不分配出去(排除失访的) var beforeBackVisitTask = await _visitTaskRepository.Where(t => t.TrialId == trialId && t.SubjectId == subjectVisit.SubjectId && t.TrialReadingCriterionId== trialReadingCriterionId && t.VisitTaskNum < subjectVisit.VisitNum && t.ReadingCategory == ReadingCategory.Visit && t.SourceSubjectVisit.CheckState != CheckStateEnum.CVPassed && t.SourceSubjectVisit.IsLostVisit == false).OrderBy(t => t.VisitTaskNum).FirstOrDefaultAsync(); + singleTask.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget); if (beforeBackVisitTask == null) { - singleTask.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget); var followBackVisitTask = await _visitTaskRepository.Where(t => t.TrialId == trialId && t.SubjectId == subjectVisit.SubjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.VisitTaskNum > subjectVisit.VisitNum && t.ReadingCategory == ReadingCategory.Visit && t.SourceSubjectVisit.CheckState != CheckStateEnum.CVPassed && t.SourceSubjectVisit.IsLostVisit == false).OrderBy(t => t.VisitTaskNum).FirstOrDefaultAsync(); @@ -765,7 +694,11 @@ namespace IRaCIS.Core.Application.Service } + else + { + singleTask.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget); + } #endregion @@ -876,6 +809,8 @@ namespace IRaCIS.Core.Application.Service // AllocateTime = DateTime.Now, //DoctorUserId = reReadingVisitTask.DoctorUserId, + SuggesteFinishedTime= reReadingVisitTask.SuggesteFinishedTime, + }); generateTaskCommand.Action(newTask); From ea95ece331e87adeb13494e82a56a0fd525064ed Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 10 Nov 2023 14:12:40 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E7=BB=93=E6=9E=9C=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/TrialSiteUser/PersonalWorkstation.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs index c0cef017d..b66eb2b02 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs @@ -647,7 +647,7 @@ namespace IRaCIS.Core.Application //待审核通过,统计从已领取到QC提交之间的 已领取 待审核 审核中 (审核完成 领取人就会清理 所以只用查询当前领取人是自己的就好了) ToBeReviewedCount = t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.Id).Count() - }).Where(x => x.UrgentCount > 0); + }).Where(x => x.ToBeClaimedCount+x.ToBeReviewedCount > 0); var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ImageQualityToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc); From cf5a8b20e416a577317bd286a527961a73cf0652 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 10 Nov 2023 15:52:44 +0800 Subject: [PATCH 4/6] =?UTF-8?q?CRC=20=20=E5=BD=B1=E5=83=8F=E8=B4=A8?= =?UTF-8?q?=E7=96=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/TrialSiteUser/PersonalWorkstation.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs index b66eb2b02..37641cd50 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs @@ -461,7 +461,7 @@ namespace IRaCIS.Core.Application ToBeDealedCount = t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id)) .SelectMany(c => c.QCChallengeList) - .Where(u => u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC).Count(), + .Where(u => u.IsClosed == false && (u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC || u.LatestReplyUserId==null)).Count(), }).Where(x => x.ToBeDealedCount > 0); ; From ea5de83364877f948ec29aa7117b4f4533fc31a2 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 10 Nov 2023 17:18:49 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=9F=E8=AE=A103=20-?= =?UTF-8?q?=E9=9C=80=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/TrialSiteUser/PersonalWorkstation.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs index 37641cd50..f369b16a9 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs @@ -587,7 +587,7 @@ namespace IRaCIS.Core.Application TrialCode = t.TrialCode, UrgentCount = t.SubjectVisitList .Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id)) - .Where(u => u.SubmitState == SubmitStateEnum.ToSubmit && u.IsUrgent).Count(), + .Where(u => u.SubmitState == SubmitStateEnum.ToSubmit && (u.IsEnrollmentConfirm ||u.PDState==PDStateEnum.PDProgress || u.Trial.IsUrgent ||u.Subject.IsUrgent)/*u.IsUrgent*/).Count(), ToBeDealedCount = t.SubjectVisitList From 62ac9418b5e16968e85fada576f673e3dc1e3b7d Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 21 Nov 2023 10:50:34 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=9F=E8=AE=A1bug,?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IRaCIS.Core.Application.xml | 6 - .../TaskMedicalReviewRuleService.cs | 113 ------------------ .../ReadingMedicalReviewService.cs | 20 +++- .../TrialSiteUser/PersonalWorkstation.cs | 26 +++- .../Allocation/TaskMedicalReview.cs | 3 + 5 files changed, 40 insertions(+), 128 deletions(-) diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 0e30712ac..24f3fb195 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -100,12 +100,6 @@ 医学审核生成规则 废弃 - - - 产生医学审核 - - - 任务医学审核 diff --git a/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewRuleService.cs b/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewRuleService.cs index 8b27e8f75..1c25af2f0 100644 --- a/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewRuleService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewRuleService.cs @@ -78,120 +78,7 @@ namespace IRaCIS.Core.Application.Service return ResponseOutput.Ok(); } - /// - /// 产生医学审核 - /// - /// - [Obsolete] - public async Task GenerateMedicalReviewTask(GenerateMedicalReviewTaskCommand generateCommand) - { - var trialId = generateCommand.TrialId; - //var mimUserList = await _trialUserRepository.Where(t => t.User.UserTypeEnum == Domain.Share.UserTypeEnum.MIM && t.TrialId == trialId).Select(t => t.User).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); - - - - Guid? defalutMIMUserId = null /*mimUserList.FirstOrDefault()?.UserId*/; - - //获取当前医生数据 已经生成的,和配置的数量 - var taskTaskMedicalReviewRuleList = await _taskMedicalReviewRuleRepository.Where(t => t.TrialId == trialId).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); - - foreach (var item in taskTaskMedicalReviewRuleList) - { - - if (item.IsEnable) - { - - if (item.PlanGlobalCount > item.GeneratedGlobalCount) - { - var needGenerateCount = item.PlanGlobalCount - item.GeneratedGlobalCount; - - var canGenerateCount = item.ActualGlobalCount - item.GeneratedGlobalCount; - - var toGenerateCount = canGenerateCount > needGenerateCount ? needGenerateCount : canGenerateCount; - - //分配给MIM - - if (toGenerateCount > 0) - { - var toGenerateTaskList = item.ActualGlobalTaskList.ExceptBy(item.GeneratedGlobalTaskList.Select(t => t.TaskId), t => t.TaskId).Take(toGenerateCount).ToList(); - - foreach (var toGenerateTask in toGenerateTaskList) - { - await _taskMedicalReviewRepository.AddAsync(new TaskMedicalReview() { DoctorUserId = toGenerateTask.DoctorUserId!.Value, TrialId = toGenerateTask.TrialId, VisitTaskId = toGenerateTask.TaskId, MedicalManagerUserId = defalutMIMUserId }); - } - } - - - } - if (item.PlanJudgeCount > item.GeneratedJudgeCount) - { - var needGenerateCount = item.PlanJudgeCount - item.GeneratedJudgeCount; - - var canGenerateCount = item.ActualJudgeCount - item.GeneratedGlobalCount; - - var toGenerateCount = canGenerateCount > needGenerateCount ? needGenerateCount : canGenerateCount; - - if (toGenerateCount > 0) - { - var toGenerateTaskList = item.ActualJudgeTaskList.ExceptBy(item.GeneratedJudgeTaskList.Select(t => t.TaskId), t => t.TaskId).Take(toGenerateCount).ToList(); - - foreach (var toGenerateTask in toGenerateTaskList) - { - await _taskMedicalReviewRepository.AddAsync(new TaskMedicalReview() { DoctorUserId = toGenerateTask.DoctorUserId!.Value, TrialId = toGenerateTask.TrialId, VisitTaskId = toGenerateTask.TaskId, MedicalManagerUserId = defalutMIMUserId }); - } - } - - } - if (item.PlanTumorCount > item.GeneratedTumorCount) - { - var needGenerateCount = item.PlanTumorCount - item.GeneratedTumorCount; - - var canGenerateCount = item.ActualTumorCount - item.GeneratedGlobalCount; - - var toGenerateCount = canGenerateCount > needGenerateCount ? needGenerateCount : canGenerateCount; - - if (toGenerateCount > 0) - { - var toGenerateTaskList = item.ActualTumorTaskList.ExceptBy(item.GeneratedTumorTaskList.Select(t => t.TaskId), t => t.TaskId).Take(toGenerateCount).ToList(); - - foreach (var toGenerateTask in toGenerateTaskList) - { - await _taskMedicalReviewRepository.AddAsync(new TaskMedicalReview() { DoctorUserId = toGenerateTask.DoctorUserId!.Value, TrialId = toGenerateTask.TrialId, VisitTaskId = toGenerateTask.TaskId, MedicalManagerUserId = defalutMIMUserId }); - } - } - - } - if (item.PlanVisitCount > item.GeneratedVisitCount) - { - var needGenerateCount = item.PlanVisitCount - item.GeneratedVisitCount; - - var canGenerateCount = item.ActualVisitCount - item.GeneratedGlobalCount; - - var toGenerateCount = canGenerateCount > needGenerateCount ? needGenerateCount : canGenerateCount; - - if (toGenerateCount > 0) - { - - var toGenerateTaskList = item.ActualVisitTaskList.ExceptBy(item.GeneratedVisitTaskList.Select(t => t.TaskId), t => t.TaskId).Take(toGenerateCount).ToList(); - - foreach (var toGenerateTask in toGenerateTaskList) - { - await _taskMedicalReviewRepository.AddAsync(new TaskMedicalReview() { DoctorUserId = toGenerateTask.DoctorUserId!.Value, TrialId = toGenerateTask.TrialId, VisitTaskId = toGenerateTask.TaskId, MedicalManagerUserId = defalutMIMUserId }); - } - } - - } - - } - - } - - - await _taskMedicalReviewRepository.SaveChangesAsync(); - return ResponseOutput.Ok(); - - } } diff --git a/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs b/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs index b0815aecd..acd58e956 100644 --- a/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs +++ b/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs @@ -466,8 +466,12 @@ namespace IRaCIS.Core.Application.Service { throw new BusinessValidationFailedException(_localizer["MedicalReview_SaveQuestion"]); } + var medicalReview = await _taskMedicalReviewRepository.Where(x => x.Id == inDto.TaskMedicalReviewId).FirstNotNullAsync(); + await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(inDto.TaskMedicalReviewId, x => new TaskMedicalReview() { + + LatestReplyUserId = (inDto.IsSendDialog && !medicalReview.IsSendMessage && inDto.IsHaveQuestion) ? _userInfo.Id : null, IsHaveQuestion = inDto.IsHaveQuestion, Questioning = inDto.Questioning, IsSendMessage = inDto.IsSendDialog && inDto.IsHaveQuestion, @@ -476,9 +480,8 @@ namespace IRaCIS.Core.Application.Service AuditAdviceEnum = inDto.AuditAdviceEnum, SaveConclusionTime = DateTime.Now, - }); + }); ; - var medicalReview = await _taskMedicalReviewRepository.Where(x => x.Id == inDto.TaskMedicalReviewId).FirstNotNullAsync(); if (inDto.IsSendDialog&& !medicalReview.IsSendMessage && inDto.IsHaveQuestion) { @@ -511,6 +514,7 @@ namespace IRaCIS.Core.Application.Service { await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(inDto.TaskMedicalReviewId, x => new TaskMedicalReview() { + LatestReplyUserId=_userInfo.Id, IsClosedDialog = inDto.IsClosedDialog, MedicalDialogCloseEnum=inDto.MedicalDialogCloseEnum, DialogCloseReason=inDto.DialogCloseReason, @@ -547,6 +551,11 @@ namespace IRaCIS.Core.Application.Service throw new BusinessValidationFailedException(_localizer["MedicalReview_invalid"]); } + await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(inDto.TaskMedicalReviewId, x => new TaskMedicalReview() + { + LatestReplyUserId = _userInfo.Id, + }); + var visitTaskId = await _taskMedicalReviewRepository.Where(x => x.Id == inDto.TaskMedicalReviewId).Select(x => x.VisitTaskId).FirstOrDefaultAsync(); ReadingMedicalReviewDialog dialog = new ReadingMedicalReviewDialog() { @@ -600,6 +609,7 @@ namespace IRaCIS.Core.Application.Service await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(x => !x.IsClosedDialog && x.Id == inDto.TaskMedicalReviewId, x => new TaskMedicalReview() { + LatestReplyUserId=_userInfo.Id, IsClosedDialog = true, MedicalDialogCloseEnum = MedicalDialogClose.IRApplyReReading, @@ -613,6 +623,7 @@ namespace IRaCIS.Core.Application.Service await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(inDto.TaskMedicalReviewId, x => new TaskMedicalReview() { + LatestReplyUserId=_userInfo.Id, DoctorUserIdeaEnum = inDto.DoctorUserIdeaEnum, }); ReadingMedicalReviewDialog dialog = new ReadingMedicalReviewDialog() @@ -740,10 +751,11 @@ namespace IRaCIS.Core.Application.Service await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(inDto.TaskMedicalReviewId, x => new TaskMedicalReview() { + LatestReplyUserId = _userInfo.Id, DoctorUserIdeaEnum = inDto.DoctorUserIdeaEnum, DisagreeReason = inDto.DisagreeReason, - IsApplyHeavyReading=inDto.IsApplyHeavyReading, - }); + IsApplyHeavyReading = inDto.IsApplyHeavyReading, + }); ; var visitTaskId = await _taskMedicalReviewRepository.Where(x => x.Id == inDto.TaskMedicalReviewId).Select(x => x.VisitTaskId).FirstOrDefaultAsync(); await _readingMedicalReviewDialogRepository.AddAsync(new ReadingMedicalReviewDialog() diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs index f369b16a9..5ae34bee3 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs @@ -544,11 +544,11 @@ namespace IRaCIS.Core.Application TrialCode = t.TrialCode, UrgentCount = t.SubjectVisitList .Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id)) - .Where(u => u.SubmitState == SubmitStateEnum.ToSubmit && u.IsUrgent && u.IsPMBackOrReReading).Count(), + .Where(u => u.IsUrgent && ((u.SubmitState == SubmitStateEnum.ToSubmit && u.IsPMBackOrReReading)||u.IsQCConfirmedReupload)).Count(), ToBeReUploadCount = t.SubjectVisitList .Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id)) - .Where(u => u.SubmitState == SubmitStateEnum.ToSubmit && u.IsPMBackOrReReading).Count(), + .Where(u => (u.SubmitState == SubmitStateEnum.ToSubmit && u.IsPMBackOrReReading) ||(u.IsQCConfirmedReupload)).Count(), }).Where(x => x.ToBeReUploadCount > 0); @@ -556,7 +556,7 @@ namespace IRaCIS.Core.Application var toBeDealedCount = _subjectVisitRepository .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) - .Where(u => u.SubmitState == SubmitStateEnum.ToSubmit && u.IsPMBackOrReReading).Count(); + .Where(u => (u.SubmitState == SubmitStateEnum.ToSubmit && u.IsPMBackOrReReading) || (u.IsQCConfirmedReupload)).Count(); return ResponseOutput.Ok(result, new { TotalToBeReUploadCount = toBeDealedCount }); @@ -885,6 +885,14 @@ namespace IRaCIS.Core.Application CriterionName = g.Key.CriterionName, TrialReadingCriterionId = g.Key.TrialReadingCriterionId, + #region 不能对包含聚合或子查询的表达式执行聚合函数 + + + UrgentCount = g.Where(u => u.VisitTask.IsUrgent && u.LatestReplyUser.UserTypeEnum== UserTypeEnum.MIM).Count(), + + ToBeReplyedCount = g.Where(u => u.LatestReplyUser.UserTypeEnum == UserTypeEnum.MIM).Count(), + + #endregion //UrgentCount = g.Where(u => u.VisitTask.IsUrgent //&& u.ReadingMedicalReviewDialogList.OrderByDescending(l => l.CreateTime).First().UserTypeEnumInt == (int)UserTypeEnum.MIM).Count(), @@ -898,7 +906,9 @@ namespace IRaCIS.Core.Application var toBeDealedCount = _taskMedicalReviewRepository .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Where(t => t.IsClosedDialog == false && t.VisitTask.DoctorUserId == _userInfo.Id) - .Where(u => u.ReadingMedicalReviewDialogList.OrderByDescending(l => l.CreateTime).First().UserTypeEnumInt == (int)UserTypeEnum.MIM).Count(); + .Where(u => u.LatestReplyUser.UserTypeEnum == UserTypeEnum.MIM) + //.Where(u => u.ReadingMedicalReviewDialogList.OrderByDescending(l => l.CreateTime).First().UserTypeEnumInt == (int)UserTypeEnum.MIM) + .Count(); return ResponseOutput.Ok(result, new { TotalToBeReplyedCount = toBeDealedCount }); @@ -945,6 +955,10 @@ namespace IRaCIS.Core.Application TrialCode = g.Key.TrialCode, CriterionName = g.Key.CriterionName, + UrgentCount = g.Where(u => u.VisitTask.IsUrgent).Select(u => u.VisitTask.IsUrgent && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IndependentReviewer).Count(), + + ToBeReplyedCount = g.Select(u => u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IndependentReviewer).Count(), + //UrgentCount = g.Where(u => u.VisitTask.IsUrgent).Select(u => u.ReadingMedicalReviewDialogList.OrderByDescending(l => l.CreateTime).First()).Count(t => t.UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer), //ToBeReplyedCount = g.Select(t => t.ReadingMedicalReviewDialogList.OrderByDescending(l => l.CreateTime).First()).Count(t => t.UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer), @@ -962,7 +976,9 @@ namespace IRaCIS.Core.Application var toBeReplyedQuery = _taskMedicalReviewRepository .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Where(t => t.IsClosedDialog == false) - .Where(u => u.ReadingMedicalReviewDialogList.OrderByDescending(l => l.CreateTime).First().UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer); + .Where(u => u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IndependentReviewer); + + //.Where(u => u.ReadingMedicalReviewDialogList.OrderByDescending(l => l.CreateTime).First().UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer); var toBeReplyedCount = toBeReplyedQuery.Count(); diff --git a/IRaCIS.Core.Domain/Allocation/TaskMedicalReview.cs b/IRaCIS.Core.Domain/Allocation/TaskMedicalReview.cs index 901e4c984..83a31484f 100644 --- a/IRaCIS.Core.Domain/Allocation/TaskMedicalReview.cs +++ b/IRaCIS.Core.Domain/Allocation/TaskMedicalReview.cs @@ -19,7 +19,10 @@ namespace IRaCIS.Core.Domain.Models [Table("TaskMedicalReview")] public class TaskMedicalReview : Entity, IAuditUpdate, IAuditAdd { + [JsonIgnore] + public User LatestReplyUser { get; set; } + public Guid? LatestReplyUserId { get; set; } /// /// CreateUserId