修改一致性分析
parent
47d16257f2
commit
f7fa1bf41d
File diff suppressed because it is too large
Load Diff
|
@ -69,6 +69,8 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
public int? ValidVisitCount => VisitTaskList.Select(t => t.TaskName).Distinct().Count();
|
public int? ValidVisitCount => VisitTaskList.Select(t => t.TaskName).Distinct().Count();
|
||||||
|
|
||||||
public List<VisitTaskSimpleView> VisitTaskList { get; set; }
|
public List<VisitTaskSimpleView> VisitTaskList { get; set; }
|
||||||
|
|
||||||
|
//public List<UserSimpleInfo> HistoryDoctorUserList => VisitTaskList.Select(t => t.DoctorUser).Distinct().ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public class VisitTaskSimpleView
|
public class VisitTaskSimpleView
|
||||||
|
@ -89,33 +91,24 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
|
|
||||||
public ReadingCategory ReadingCategory { get; set; }
|
public ReadingCategory ReadingCategory { get; set; }
|
||||||
|
|
||||||
|
//任务阅片状态
|
||||||
|
public ReadingTaskState ReadingTaskState { get; set; }
|
||||||
|
|
||||||
public TaskState TaskState { get; set; }
|
public TaskState TaskState { get; set; }
|
||||||
|
|
||||||
public String TrialSiteCode { get; set; } = String.Empty;
|
public String TrialSiteCode { get; set; } = String.Empty;
|
||||||
public string SubjectCode { get; set; } = String.Empty;
|
public string SubjectCode { get; set; } = String.Empty;
|
||||||
|
|
||||||
|
//public UserSimpleInfo DoctorUser { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public Guid? DoctorUserId { get; set; }
|
public Guid? DoctorUserId { get; set; }
|
||||||
|
[JsonIgnore]
|
||||||
|
public Guid? TaskConsistentRuleId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class SelfConsistentView
|
|
||||||
{
|
|
||||||
public Guid TrialId { get; set; }
|
|
||||||
public Guid SiteId { get; set; }
|
|
||||||
|
|
||||||
public String TrialSiteCode => VisitTaskList.Select(t => t.TrialSiteCode).First();
|
|
||||||
public string SubjectCode => VisitTaskList.Select(t => t.TrialSiteCode).First();
|
|
||||||
|
|
||||||
public Guid SubjectId { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public int? VisitValidTaskCount { get; set; }
|
|
||||||
|
|
||||||
public int? VisitValidCount => VisitTaskList.Select(t => t.TaskName).Distinct().Count();
|
|
||||||
|
|
||||||
public List<VisitTaskSimpleView> VisitTaskList { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
///<summary>TaskConsistentRuleQuery 列表查询参数模型</summary>
|
///<summary>TaskConsistentRuleQuery 列表查询参数模型</summary>
|
||||||
public class TaskConsistentRuleQuery
|
public class TaskConsistentRuleQuery
|
||||||
|
|
|
@ -78,7 +78,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
bool isSelfAnalysis = filterObj.CompareDoctorUserId == null;
|
bool isSelfAnalysis = filterObj.CompareDoctorUserId == null;
|
||||||
|
|
||||||
IQueryable<Guid> subjectfilter = default;
|
IQueryable<Guid> subjectfilter = null;
|
||||||
|
|
||||||
if (isSelfAnalysis == false)
|
if (isSelfAnalysis == false)
|
||||||
{
|
{
|
||||||
|
@ -94,16 +94,16 @@ namespace IRaCIS.Core.Application.Service
|
||||||
// 自身一致性分析
|
// 自身一致性分析
|
||||||
.WhereIf(isSelfAnalysis, t => t.DoctorUserId == filterObj.AnalysisDoctorUserId)
|
.WhereIf(isSelfAnalysis, t => t.DoctorUserId == filterObj.AnalysisDoctorUserId)
|
||||||
// 组内一致性分析
|
// 组内一致性分析
|
||||||
.WhereIf(isSelfAnalysis == false, t => t.DoctorUserId == filterObj.AnalysisDoctorUserId && subjectfilter.Contains(t.SubjectId))
|
.WhereIf(isSelfAnalysis == false && subjectfilter !=null, t => t.DoctorUserId == filterObj.AnalysisDoctorUserId && subjectfilter.Contains(t.SubjectId))
|
||||||
.Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect)
|
.Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect)
|
||||||
.Where(t => t.SignTime!.Value.AddDays(filterObj.IntervalWeeks * 7 + 1) > DateTime.Now)
|
.Where(t => t.SignTime!.Value.AddDays(filterObj.IntervalWeeks * 7 + 1) > DateTime.Now)
|
||||||
//重阅产生的访视任务 要把之前的访视任务去除
|
//重阅产生的访视任务 要把之前的访视任务去除
|
||||||
.Where(t => t.ReReadingApplyState != ReReadingApplyState.Agree)
|
.Where(t => t.ReReadingApplyState == ReReadingApplyState.Default || t.ReReadingApplyState == ReReadingApplyState.Reject)
|
||||||
|
|
||||||
.WhereIf(filterObj.IsHaveReadingPeriod == false, t => t.ReadingCategory == ReadingCategory.Visit)
|
.WhereIf(filterObj.IsHaveReadingPeriod == false, t => t.ReadingCategory == ReadingCategory.Visit)
|
||||||
.WhereIf(filterObj.IsHaveReadingPeriod == true, t => t.ReadingCategory == ReadingCategory.Visit || t.ReadingCategory == ReadingCategory.Global)
|
.WhereIf(filterObj.IsHaveReadingPeriod == true, t => t.ReadingCategory == ReadingCategory.Visit || t.ReadingCategory == ReadingCategory.Global)
|
||||||
.GroupBy(t => t.SubjectId)
|
.GroupBy(t => t.SubjectId)
|
||||||
.Where(g => g.Count() > filterObj.PlanVisitCount);
|
.Where(g => g.Count() >= filterObj.PlanVisitCount);
|
||||||
|
|
||||||
var query = group.Select(g => new DoctorConsistentRuleSubjectView()
|
var query = group.Select(g => new DoctorConsistentRuleSubjectView()
|
||||||
{
|
{
|
||||||
|
@ -111,10 +111,13 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
IsHaveGeneratedTask = g.Any(t => t.IsAnalysisCreate && t.SubjectId == g.Key && t.DoctorUserId == doctorUserId && t.TaskConsistentRuleId == filterObj.Id),
|
IsHaveGeneratedTask = g.Any(t => t.IsAnalysisCreate && t.SubjectId == g.Key && t.DoctorUserId == doctorUserId && t.TaskConsistentRuleId == filterObj.Id),
|
||||||
|
|
||||||
VisitTaskList = g.Where(t => t.IsAnalysisCreate == false).OrderBy(t => t.VisitTaskNum).Select(c => new VisitTaskSimpleView()
|
VisitTaskList = g.Where(t => t.IsAnalysisCreate == false).OrderBy(t => t.VisitTaskNum)
|
||||||
|
|
||||||
|
.Select(c => new VisitTaskSimpleView()
|
||||||
{
|
{
|
||||||
Id = c.Id,
|
Id = c.Id,
|
||||||
ReadingCategory = c.ReadingCategory,
|
ReadingCategory = c.ReadingCategory,
|
||||||
|
ReadingTaskState=c.ReadingTaskState,
|
||||||
TaskBlindName = c.TaskBlindName,
|
TaskBlindName = c.TaskBlindName,
|
||||||
TaskCode = c.TaskCode,
|
TaskCode = c.TaskCode,
|
||||||
TaskName = c.TaskName,
|
TaskName = c.TaskName,
|
||||||
|
@ -122,8 +125,17 @@ namespace IRaCIS.Core.Application.Service
|
||||||
ArmEnum = c.ArmEnum,
|
ArmEnum = c.ArmEnum,
|
||||||
SubjectId = c.SubjectId,
|
SubjectId = c.SubjectId,
|
||||||
TrialId = c.TrialId,
|
TrialId = c.TrialId,
|
||||||
|
SiteId = c.Subject.SiteId,
|
||||||
SubjectCode = c.Subject.Code,
|
SubjectCode = c.Subject.Code,
|
||||||
TrialSiteCode = c.Subject.TrialSite.TrialSiteCode,
|
TrialSiteCode = c.Subject.TrialSite.TrialSiteCode,
|
||||||
|
|
||||||
|
//DoctorUser=new UserSimpleInfo()
|
||||||
|
//{
|
||||||
|
// FullName=c.DoctorUser.FullName,
|
||||||
|
// UserCode=c.DoctorUser.UserCode,
|
||||||
|
// UserId=c.DoctorUser.Id,
|
||||||
|
// UserName=c.DoctorUser.UserName
|
||||||
|
//}
|
||||||
}).ToList(),
|
}).ToList(),
|
||||||
|
|
||||||
ValidTaskCount = g.Count()
|
ValidTaskCount = g.Count()
|
||||||
|
@ -177,16 +189,16 @@ namespace IRaCIS.Core.Application.Service
|
||||||
// 自身一致性分析
|
// 自身一致性分析
|
||||||
.WhereIf(isSelfAnalysis, t => t.DoctorUserId == filterObj.AnalysisDoctorUserId)
|
.WhereIf(isSelfAnalysis, t => t.DoctorUserId == filterObj.AnalysisDoctorUserId)
|
||||||
// 组内一致性分析
|
// 组内一致性分析
|
||||||
.WhereIf(isSelfAnalysis == false, t => t.DoctorUserId == filterObj.AnalysisDoctorUserId && subjectfilter.Contains(t.SubjectId))
|
.WhereIf(isSelfAnalysis == false && subjectfilter != null, t => t.DoctorUserId == filterObj.AnalysisDoctorUserId && subjectfilter.Contains(t.SubjectId))
|
||||||
.Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect)
|
.Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect)
|
||||||
.Where(t => t.SignTime!.Value.AddDays(filterObj.IntervalWeeks * 7 + 1) > DateTime.Now)
|
.Where(t => t.SignTime!.Value.AddDays(filterObj.IntervalWeeks * 7 + 1) > DateTime.Now)
|
||||||
//重阅产生的访视任务 要把之前的访视任务去除
|
//重阅产生的访视任务 要把之前的访视任务去除
|
||||||
.Where(t => t.ReReadingApplyState != ReReadingApplyState.Agree)
|
.Where(t => t.ReReadingApplyState == ReReadingApplyState.Default || t.ReReadingApplyState == ReReadingApplyState.Reject)
|
||||||
|
|
||||||
.WhereIf(filterObj.IsHaveReadingPeriod == false, t => t.ReadingCategory == ReadingCategory.Visit)
|
.WhereIf(filterObj.IsHaveReadingPeriod == false, t => t.ReadingCategory == ReadingCategory.Visit)
|
||||||
.WhereIf(filterObj.IsHaveReadingPeriod == true, t => t.ReadingCategory == ReadingCategory.Visit || t.ReadingCategory == ReadingCategory.Global)
|
.WhereIf(filterObj.IsHaveReadingPeriod == true, t => t.ReadingCategory == ReadingCategory.Visit || t.ReadingCategory == ReadingCategory.Global)
|
||||||
.GroupBy(t => t.SubjectId)
|
.GroupBy(t => t.SubjectId)
|
||||||
.Where(g => g.Count() > filterObj.PlanVisitCount);
|
.Where(g => g.Count() >= filterObj.PlanVisitCount);
|
||||||
|
|
||||||
|
|
||||||
var query = group.Select(g => new DoctorConsistentRuleSubjectView()
|
var query = group.Select(g => new DoctorConsistentRuleSubjectView()
|
||||||
|
@ -205,6 +217,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
TaskState = c.TaskState,
|
TaskState = c.TaskState,
|
||||||
ArmEnum = c.ArmEnum,
|
ArmEnum = c.ArmEnum,
|
||||||
SubjectId = c.SubjectId,
|
SubjectId = c.SubjectId,
|
||||||
|
SiteId=c.Subject.SiteId,
|
||||||
TrialId = c.TrialId,
|
TrialId = c.TrialId,
|
||||||
SubjectCode = c.Subject.Code,
|
SubjectCode = c.Subject.Code,
|
||||||
TrialSiteCode = c.Subject.TrialSite.TrialSiteCode,
|
TrialSiteCode = c.Subject.TrialSite.TrialSiteCode,
|
||||||
|
@ -218,11 +231,12 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
foreach (var subject in list)
|
foreach (var subject in list)
|
||||||
{
|
{
|
||||||
subject.VisitTaskList.ForEach(t => t.DoctorUserId = doctorUserId);
|
subject.VisitTaskList.ForEach(t => { t.DoctorUserId = doctorUserId; t.TaskConsistentRuleId = filterObj.Id; });
|
||||||
|
|
||||||
|
|
||||||
await _visitTaskCommonService.AddTaskAsync(new GenerateTaskCommand()
|
await _visitTaskCommonService.AddTaskAsync(new GenerateTaskCommand()
|
||||||
{
|
{
|
||||||
|
TrialId= filterObj.TrialId,
|
||||||
ReadingCategory = ReadingCategory.Consistent,
|
ReadingCategory = ReadingCategory.Consistent,
|
||||||
GenerataConsistentTaskList = subject.VisitTaskList
|
GenerataConsistentTaskList = subject.VisitTaskList
|
||||||
});
|
});
|
||||||
|
|
|
@ -370,7 +370,8 @@ namespace IRaCIS.Core.Application.Service
|
||||||
VisitTaskNum = task.VisitTaskNum,
|
VisitTaskNum = task.VisitTaskNum,
|
||||||
ReadingCategory = task.ReadingCategory,
|
ReadingCategory = task.ReadingCategory,
|
||||||
|
|
||||||
IsReReadingCreate = true,
|
IsAnalysisCreate = true,
|
||||||
|
TaskConsistentRuleId=task.TaskConsistentRuleId,
|
||||||
TaskState = TaskState.Effect,
|
TaskState = TaskState.Effect,
|
||||||
Code = currentMaxCodeInt + 1,
|
Code = currentMaxCodeInt + 1,
|
||||||
TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)),
|
TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)),
|
||||||
|
|
|
@ -190,8 +190,9 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
|
|
||||||
CreateMap<VisitTask, VisitTaskSimpleView>()
|
CreateMap<VisitTask, VisitTaskSimpleView>()
|
||||||
|
//.ForMember(o => o.DoctorUser, t => t.MapFrom(u => u.DoctorUser))
|
||||||
.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.Subject.TrialSite.TrialSiteCode))
|
.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.Subject.TrialSite.TrialSiteCode))
|
||||||
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.Subject.Code));
|
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.Subject.Code));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue