diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index f711bc7d..6f31a0dc 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -54,12 +54,6 @@ - - - 获取访视任务 应用Subject后 医生比率情况 - - - 获取项目下 医生账户信息下拉 @@ -68,6 +62,12 @@ + + + 获取访视任务 应用Subject后 医生比率情况 + + + 一致性分析配置表 diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskAllocationRuleViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskAllocationRuleViewModel.cs index 6cade703..328e2624 100644 --- a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskAllocationRuleViewModel.cs +++ b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskAllocationRuleViewModel.cs @@ -101,20 +101,20 @@ namespace IRaCIS.Core.Application.ViewModel public UserSimpleInfo DoctorUser { get; set; } - //public List ReadingCategoryList { get; set; } + public List ReadingCategoryList { get; set; } - public List TrialReadingCriterionList { get; set; } + //public List TrialReadingCriterionList { get; set; } - public List CriterionReadingCategoryList { get; set; } + //public List CriterionReadingCategoryList { get; set; } - public List CriterionCategoryList => + //public List CriterionCategoryList => - TrialReadingCriterionList.Select(t => - new CriterionReadingCategory() { - EnrollId = EnrollId, - TrialReadingCriterionId = t.TrialReadingCriterionId, - ReadingCategorys = CriterionReadingCategoryList.Where(c => c.TrialReadingCriterionId == t.TrialReadingCriterionId).Select(t => t.ReadingCategory).OrderBy(c => c).ToList() - }).ToList(); + // TrialReadingCriterionList.Select(t => + // new CriterionReadingCategory() { + // EnrollId = EnrollId, + // TrialReadingCriterionId = t.TrialReadingCriterionId, + // ReadingCategorys = CriterionReadingCategoryList.Where(c => c.TrialReadingCriterionId == t.TrialReadingCriterionId).Select(t => t.ReadingCategory).OrderBy(c => c).ToList() + // }).ToList(); @@ -131,7 +131,9 @@ namespace IRaCIS.Core.Application.ViewModel [NotDefault] public Guid TrialId { get; set; } - public ReadingCategory? ReadingCategory { get; set; } + public ReadingCategory? ReadingCategory { get; set; } + + public Guid? TrialReadingCriterionId { get; set; } } diff --git a/IRaCIS.Core.Application/Service/Allocation/TaskAllocationRuleService.cs b/IRaCIS.Core.Application/Service/Allocation/TaskAllocationRuleService.cs index 89fa7cda..6aea5302 100644 --- a/IRaCIS.Core.Application/Service/Allocation/TaskAllocationRuleService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/TaskAllocationRuleService.cs @@ -120,34 +120,6 @@ namespace IRaCIS.Core.Application.Service - /// - /// 获取访视任务 应用Subject后 医生比率情况 - /// - /// - [HttpPost] - [Obsolete] - public async Task> GetSubjectApplyDoctorTaskStatList(ApplySubjectCommand assignConfirmCommand) - { - var taskAllocationRuleQueryable = _taskAllocationRuleRepository.Where(t => t.TrialId == assignConfirmCommand.TrialId && t.IsJudgeDoctor == assignConfirmCommand.IsJudgeDoctor) - .ProjectTo(_mapper.ConfigurationProvider, new { subjectIdList = assignConfirmCommand.SubjectIdList, isJudgeDoctor = assignConfirmCommand.IsJudgeDoctor }); - - return await taskAllocationRuleQueryable.ToListAsync(); - } - - - - [HttpPost] - [Obsolete] - public async Task> GetTaskAllocationRuleList(TaskAllocationRuleQuery queryTaskAllocationRule) - { - var taskAllocationRuleQueryable = _taskAllocationRuleRepository.Where(t => t.TrialId == queryTaskAllocationRule.TrialId /*&& t.IsJudgeDoctor == queryTaskAllocationRule.IsJudgeDoctor*/) - .ProjectTo(_mapper.ConfigurationProvider); - - - //var trialTaskConfig = _trialRepository.Where(t => t.Id == queryTaskAllocationRule.TrialId).ProjectTo(_mapper.ConfigurationProvider, new { isJudgeDoctor = queryTaskAllocationRule.IsJudgeDoctor }).FirstOrDefault(); - - return await taskAllocationRuleQueryable.ToListAsync(); - } /// @@ -183,11 +155,11 @@ namespace IRaCIS.Core.Application.Service { var query = from allocationRule in _taskAllocationRuleRepository.Where(t => t.TrialId == selectQuery.TrialId && t.IsEnable) .WhereIf(selectQuery.ReadingCategory != null, t => t.Enroll.EnrollReadingCategoryList.Any(t => t.ReadingCategory == selectQuery.ReadingCategory)) + .WhereIf(selectQuery.TrialReadingCriterionId != null, t => t.Enroll.EnrollReadingCategoryList.Any(t => t.TrialReadingCriterionId == selectQuery.TrialReadingCriterionId)) join user in _userRepository.AsQueryable() on allocationRule.DoctorUserId equals user.Id select new TrialDoctorUserSelectView() { TrialId = allocationRule.TrialId, - //ReadingType = allocationRule.Trial.ReadingType, DoctorUserId = user.Id, FullName = user.FullName, UserCode = user.UserCode, @@ -200,5 +172,36 @@ namespace IRaCIS.Core.Application.Service } + + + /// + /// 获取访视任务 应用Subject后 医生比率情况 + /// + /// + [HttpPost] + [Obsolete] + public async Task> GetSubjectApplyDoctorTaskStatList(ApplySubjectCommand assignConfirmCommand) + { + var taskAllocationRuleQueryable = _taskAllocationRuleRepository.Where(t => t.TrialId == assignConfirmCommand.TrialId && t.IsJudgeDoctor == assignConfirmCommand.IsJudgeDoctor) + .ProjectTo(_mapper.ConfigurationProvider, new { subjectIdList = assignConfirmCommand.SubjectIdList, isJudgeDoctor = assignConfirmCommand.IsJudgeDoctor }); + + return await taskAllocationRuleQueryable.ToListAsync(); + } + + + + [HttpPost] + [Obsolete] + public async Task> GetTaskAllocationRuleList(TaskAllocationRuleQuery queryTaskAllocationRule) + { + var taskAllocationRuleQueryable = _taskAllocationRuleRepository.Where(t => t.TrialId == queryTaskAllocationRule.TrialId /*&& t.IsJudgeDoctor == queryTaskAllocationRule.IsJudgeDoctor*/) + .ProjectTo(_mapper.ConfigurationProvider); + + + //var trialTaskConfig = _trialRepository.Where(t => t.Id == queryTaskAllocationRule.TrialId).ProjectTo(_mapper.ConfigurationProvider, new { isJudgeDoctor = queryTaskAllocationRule.IsJudgeDoctor }).FirstOrDefault(); + + return await taskAllocationRuleQueryable.ToListAsync(); + } + } } diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index f0ae826a..b07f238f 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -176,7 +176,9 @@ namespace IRaCIS.Core.Application.Service.Allocation /// public async Task<(List,object)> GetDoctorSubjectStat(Guid trialId, Guid trialReadingCriterionId ) { - var list = await _taskAllocationRuleRepository.Where(t => t.TrialId == trialId).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + var list = await _taskAllocationRuleRepository.Where(t => t.TrialId == trialId) + .Where( t => t.Enroll.EnrollReadingCategoryList.Any(t => t.TrialReadingCriterionId == trialReadingCriterionId)) + .ProjectTo(_mapper.ConfigurationProvider,new { trialReadingCriterionId= trialReadingCriterionId }).ToListAsync(); var criterionConfig = (await _trialReadingCriterionRepository.Where(x => x.Id == trialReadingCriterionId).Select(x => new { x.ReadingTool, x.IsReadingTaskViewInOrder,x.ReadingType }).FirstOrDefaultAsync()).IfNullThrowException(); diff --git a/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs b/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs index d9e7b68b..47e5a48e 100644 --- a/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs @@ -65,11 +65,12 @@ namespace IRaCIS.Core.Application.Service ; + var trialReadingCriterionId = Guid.Empty; CreateMap() .ForMember(o => o.DoctorUser, t => t.MapFrom(u => u.Enroll.DoctorUser)) - .ForMember(o => o.CriterionReadingCategoryList, t => t.MapFrom(u => u.Enroll.EnrollReadingCategoryList.Select(t => new TrialCriterionReadingCategory() { EnrollId = t.EnrollId, ReadingCategory = t.ReadingCategory, TrialReadingCriterionId = t.TrialReadingCriterionId }))) - .ForMember(o => o.TrialReadingCriterionList, t => t.MapFrom(u => u.Trial.ReadingQuestionCriterionTrialList.Where(t => t.IsConfirm).Select(t => new TrialReadingCriterionDto() { TrialReadingCriterionId = t.Id, TrialReadingCriterionName = t.CriterionName }))) - //.ForMember(o => o.ReadingCategoryList, t => t.MapFrom(u => u.Enroll.EnrollReadingCategoryList.OrderBy(t => t.ReadingCategory).Select(t => t.ReadingCategory).ToList())) + //.ForMember(o => o.CriterionReadingCategoryList, t => t.MapFrom(u => u.Enroll.EnrollReadingCategoryList.Select(t => new TrialCriterionReadingCategory() { EnrollId = t.EnrollId, ReadingCategory = t.ReadingCategory, TrialReadingCriterionId = t.TrialReadingCriterionId }))) + //.ForMember(o => o.TrialReadingCriterionList, t => t.MapFrom(u => u.Trial.ReadingQuestionCriterionTrialList.Where(t => t.IsConfirm).Select(t => new TrialReadingCriterionDto() { TrialReadingCriterionId = t.Id, TrialReadingCriterionName = t.CriterionName }))) + .ForMember(o => o.ReadingCategoryList, t => t.MapFrom(u => u.Enroll.EnrollReadingCategoryList.Where(t=>t.TrialReadingCriterionId== trialReadingCriterionId).OrderBy(t => t.ReadingCategory).Select(t => t.ReadingCategory).ToList())) ; CreateMap().IncludeBase() @@ -78,7 +79,6 @@ namespace IRaCIS.Core.Application.Service .ForMember(o => o.WaitDealAllTaskCount, t => t.MapFrom(u => u.DoctorUser.VisitTaskList.Where(t => t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect).Count())); - Guid trialReadingCriterionId = Guid.Empty; CreateMap() .ForMember(o => o.SubjectId, t => t.MapFrom(u => u.Id)) diff --git a/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs b/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs index 5001aa49..be16cfbb 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs @@ -164,6 +164,7 @@ namespace IRaCIS.Application.Services var stakeholderIds = new List(); var subjectVisit =await _subjectVisitRepository.FirstOrDefaultAsync(x => x.Id == readModule.SubjectVisitId); + switch (readModule.Status) { case ReadingStatusEnum.ImageNotSubmit: @@ -211,10 +212,10 @@ namespace IRaCIS.Application.Services public async Task> GetSubjectReadVisitList(GetSubjectReadVisitsInDto inDto) { //增加标准 - var maxReadVisit = await _readModuleRepository.Where(x => x.SubjectId == inDto.SubjectId&&x.ReadingSetType==inDto.ReadingSetType && x.TrialReadingCriterionId==inDto.TrialReadingCriterionId).OrderByDescending(x=>x.VisitNum).FirstOrDefaultAsync(); + var maxReadVisit = await _readModuleRepository.Where(x => x.SubjectId == inDto.SubjectId && x.ReadingSetType==inDto.ReadingSetType && x.TrialReadingCriterionId==inDto.TrialReadingCriterionId).OrderByDescending(x=>x.VisitNum).FirstOrDefaultAsync(); var maxReadVisitNum= maxReadVisit==null?-1:maxReadVisit.VisitNum; - var visitQuery = _subjectVisitRepository.Where(x => x.SubjectId == inDto.SubjectId && x.LatestScanDate != null&&!x.IsLostVisit); + var visitQuery = _subjectVisitRepository.Where(x => x.SubjectId == inDto.SubjectId && x.LatestScanDate != null && !x.IsLostVisit); var finalVisitNum = await visitQuery.Where(x => x.IsFinalVisit).Select(x => x.VisitNum).FirstOrDefaultAsync(); //增加标准