Uat_Study
hang 2022-07-08 16:33:51 +08:00
parent a522599eca
commit 30e7addc3b
1 changed files with 35 additions and 29 deletions

View File

@ -164,20 +164,20 @@ namespace IRaCIS.Core.Application.Service
/// <summary>
/// 组间一致性分析 选择Subejct 列表
/// </summary>
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<DoctorSelfConsistentSubjectView>> GetGroupConsistentRuleSubjectList(GroupConsistentQuery inQuery)
{
var filterObj = await _taskConsistentRuleRepository.FirstOrDefaultAsync(t => t.TrialId == inQuery.TrialId && t.IsSelfAnalysis==false);
///// <summary>
///// 组间一致性分析 选择Subejct 列表
///// </summary>
///// <param name="inQuery"></param>
///// <returns></returns>
//[HttpPost]
//public async Task<PageOutput<DoctorSelfConsistentSubjectView>> GetGroupConsistentRuleSubjectList(GroupConsistentQuery inQuery)
//{
// var filterObj = await _taskConsistentRuleRepository.FirstOrDefaultAsync(t => t.TrialId == inQuery.TrialId && t.IsSelfAnalysis==false);
var pagedList = await GetIQueryableDoctorSelfConsistentSubjectView(filterObj).ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(DoctorSelfConsistentSubjectView.SubjectCode) : inQuery.SortField, inQuery.Asc);
// var pagedList = await GetIQueryableDoctorSelfConsistentSubjectView(filterObj).ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(DoctorSelfConsistentSubjectView.SubjectCode) : inQuery.SortField, inQuery.Asc);
return pagedList;
}
// return pagedList;
//}
@ -210,10 +210,10 @@ namespace IRaCIS.Core.Application.Service
//最后一个访视添加全局
var globalTask = (subject.VisitTaskList[filterObj.PlanVisitCount - 1]).Clone();
globalTask.ReadingCategory = ReadingCategory.Global;
globalTask.VisitTaskNum += ReadingCommon.TaskNumDic[ReadingCategory.Global];
subject.VisitTaskList.Add(globalTask);
//var globalTask = (subject.VisitTaskList[filterObj.PlanVisitCount - 1]).Clone();
//globalTask.ReadingCategory = ReadingCategory.Global;
//globalTask.VisitTaskNum += ReadingCommon.TaskNumDic[ReadingCategory.Global];
//subject.VisitTaskList.Add(globalTask);
await _visitTaskCommonService.AddTaskAsync(new GenerateTaskCommand()
{
@ -235,8 +235,14 @@ namespace IRaCIS.Core.Application.Service
}
private IQueryable<DoctorSelfConsistentSubjectView> GetIQueryableDoctorSelfConsistentSubjectView(TaskConsistentRule filterObj, Guid? doctorUserId=null, List<Guid>? subejctIdList = null)
/// <summary>
/// 仅仅组内一致性时使用(
/// </summary>
/// <param name="filterObj"></param>
/// <param name="doctorUserId"></param>
/// <param name="subejctIdList"></param>
/// <returns></returns>
private IQueryable<DoctorSelfConsistentSubjectView> GetIQueryableDoctorSelfConsistentSubjectView(TaskConsistentRule filterObj, Guid doctorUserId, List<Guid>? subejctIdList = null)
{
var trialId = filterObj.TrialId;
@ -250,16 +256,16 @@ namespace IRaCIS.Core.Application.Service
Expression<Func<VisitTask, bool>> subjectIsHaveGeneratedTaskFilter = c => c.IsAnalysisCreate;
//组间一致性
if (doctorUserId == null)
{
subjectIsHaveGeneratedTaskFilter = subjectIsHaveGeneratedTaskFilter.And(c => c.IsSelfAnalysis == false);
}
//组内
else
{
subjectIsHaveGeneratedTaskFilter = subjectIsHaveGeneratedTaskFilter.And(c => c.DoctorUserId == doctorUserId && c.IsSelfAnalysis == true);
}
////组间一致性
//if (doctorUserId == null)
//{
// subjectIsHaveGeneratedTaskFilter = subjectIsHaveGeneratedTaskFilter.And(c => c.IsSelfAnalysis == false);
//}
////组内
//else
//{
// subjectIsHaveGeneratedTaskFilter = subjectIsHaveGeneratedTaskFilter.And(c => c.DoctorUserId == doctorUserId && c.IsSelfAnalysis == true);
//}
if (subejctIdList != null && subejctIdList?.Count > 0)
{
@ -288,7 +294,7 @@ namespace IRaCIS.Core.Application.Service
BlindSubjectCode=t.SubjectVisitTaskList.Where(t=>t.IsAnalysisCreate).OrderByDescending(t=>t.BlindSubjectCode).Select(t=>t.BlindSubjectCode).FirstOrDefault(),
IsHaveGeneratedTask = t.SubjectVisitTaskList.AsQueryable().Any(subjectIsHaveGeneratedTaskFilter),
IsHaveGeneratedTask = t.SubjectVisitTaskList.Any(c => c.DoctorUserId == doctorUserId && c.IsSelfAnalysis == true),
ValidVisitCount = t.SubjectVisitTaskList.AsQueryable().Where(visitTaskFilter).Count(),