diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs index 984170174..1e1de0f7f 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs @@ -1382,24 +1382,22 @@ namespace IRaCIS.Core.Application .Where(c => c.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.Id && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect) // 前序 不存在 未一致性核查未通过的 .Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum)) - //前序 不存在 未生成任务的访视 - //.WhereIf(g.Key.IsAutoCreate == false, t => !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum)) + .Where(t => c.IsAutoCreate ? !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum) : true) .Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)) .Count() > 0).CountAsync() : 0, - IR_MedicalReviewCount = isIR ? await _taskMedicalReviewRepository - .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) + IR_MedicalReviewCount = isIR ? await _taskMedicalReviewRepository.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.Id) .GroupBy(t => t.TrialId) - .Select(g => new MedicalCommentsToBeDoneDto() + .Select(g => new { TrialId = g.Key, ToBeReplyedCount = g.Where(u => u.LatestReplyUser.UserTypeEnum == UserTypeEnum.MIM && u.AuditState == MedicalReviewAuditState.Auditing).Count(), - }).Where(t => t.ToBeReviewedCount + t.ToBeReplyedCount > 0).CountAsync() : 0, + }).Where(t => t.ToBeReplyedCount > 0).CountAsync() : 0, #endregion @@ -1409,7 +1407,7 @@ namespace IRaCIS.Core.Application .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.Id) .GroupBy(t => t.TrialId) - .Select(g => new MedicalCommentsToBeDoneDto() + .Select(g => new { TrialId = g.Key,