修改枚举
parent
817d6e5e9a
commit
fde57c12cb
|
@ -125,7 +125,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
{
|
{
|
||||||
public Guid TrialId { get; set; }
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
public ReadingCategory ReadingCategory { get; set; }
|
public GenerateTaskCategory ReadingCategory { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -154,6 +154,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
|
|
||||||
public List<VisitTaskSimpleDTO> GenerataConsistentTaskList { get; set; }
|
public List<VisitTaskSimpleDTO> GenerataConsistentTaskList { get; set; }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//public class ReReadingApplyGenerateTaskCommand
|
//public class ReReadingApplyGenerateTaskCommand
|
||||||
|
|
|
@ -91,14 +91,23 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
|
|
||||||
public TaskState TaskState { get; set; }
|
public TaskState TaskState { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
//可以不查询
|
||||||
|
public List<VisitTaskSimpleDTO> GlobalVisitTaskList { get; set; }
|
||||||
|
|
||||||
|
//也可以不查询
|
||||||
|
public bool IsHaveGeneratedTask { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public string BlindSubjectCode { get; set; } = string.Empty;
|
||||||
|
public string BlindTrialSiteCode { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public Guid? DoctorUserId { get; set; }
|
public Guid? DoctorUserId { get; set; }
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public Guid? TaskConsistentRuleId { get; set; }
|
public Guid? TaskConsistentRuleId { get; set; }
|
||||||
|
|
||||||
public bool IsHaveGeneratedTask { get; set; }
|
|
||||||
|
|
||||||
public List<VisitTaskSimpleDTO> GlobalVisitTaskList { get; set; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -187,8 +196,12 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
public int IntervalWeeks { get; set; }
|
public int IntervalWeeks { get; set; }
|
||||||
public bool IsHaveReadingPeriod { get; set; }
|
public bool IsHaveReadingPeriod { get; set; }
|
||||||
public bool IsGenerateGlobalTask { get; set; }
|
public bool IsGenerateGlobalTask { get; set; }
|
||||||
|
|
||||||
public Guid AnalysisDoctorUserId { get; set; }
|
public Guid AnalysisDoctorUserId { get; set; }
|
||||||
|
|
||||||
|
public int BlindSubjectNumberOfPlaces { get; set; }
|
||||||
|
public string BlindTrialSiteCode { get; set; } = string.Empty;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -123,14 +123,27 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
foreach (var subject in list)
|
foreach (var subject in list)
|
||||||
{
|
{
|
||||||
subject.VisitTaskList.Take(filterObj.PlanVisitCount).ForEach(t => { t.DoctorUserId = filterObj.AnalysisDoctorUserId; t.TaskConsistentRuleId = filterObj.Id; });
|
//处理 Subject 编号
|
||||||
|
subject.VisitTaskList.Take(filterObj.PlanVisitCount).ForEach(t =>
|
||||||
|
{
|
||||||
|
t.DoctorUserId = filterObj.AnalysisDoctorUserId;
|
||||||
|
t.TaskConsistentRuleId = filterObj.Id;
|
||||||
|
t.BlindTrialSiteCode = filterObj.BlindTrialSiteCode;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
//最后一个访视添加全局
|
||||||
|
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()
|
await _visitTaskCommonService.AddTaskAsync(new GenerateTaskCommand()
|
||||||
{
|
{
|
||||||
TrialId = filterObj.TrialId,
|
TrialId = filterObj.TrialId,
|
||||||
|
|
||||||
ReadingCategory = ReadingCategory.SelfConsistent,
|
ReadingCategory = GenerateTaskCategory.SelfConsistent,
|
||||||
|
|
||||||
|
|
||||||
//产生的过滤掉已经生成的
|
//产生的过滤掉已经生成的
|
||||||
GenerataConsistentTaskList = subject.VisitTaskList.Where(t => t.IsHaveGeneratedTask == false).ToList()
|
GenerataConsistentTaskList = subject.VisitTaskList.Where(t => t.IsHaveGeneratedTask == false).ToList()
|
||||||
|
@ -219,7 +232,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
}).ToList(),
|
}).ToList(),
|
||||||
|
|
||||||
}).ToList()
|
}).OrderBy(t => t.VisitTaskNum).ToList()
|
||||||
});
|
});
|
||||||
|
|
||||||
return query.OrderByDescending(t => t.IsHaveGeneratedTask);
|
return query.OrderByDescending(t => t.IsHaveGeneratedTask);
|
||||||
|
|
|
@ -84,7 +84,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
.WhereIf(inQuery.ReadingCategory != null, t => t.ReadingCategory == inQuery.ReadingCategory)
|
.WhereIf(inQuery.ReadingCategory != null, t => t.ReadingCategory == inQuery.ReadingCategory)
|
||||||
.WhereIf(inQuery.ReadingTaskState != null, t => t.ReadingTaskState == inQuery.ReadingTaskState)
|
.WhereIf(inQuery.ReadingTaskState != null, t => t.ReadingTaskState == inQuery.ReadingTaskState)
|
||||||
.WhereIf(inQuery.IsGeneratedJudge != null, t => t.JudgeVisitTaskId != null)
|
.WhereIf(inQuery.IsGeneratedJudge != null, t => t.JudgeVisitTaskId != null)
|
||||||
//.WhereIf(inQuery.IsGlobalHaveUpdate != null, t => t.JudgeVisitTaskId != null)
|
.WhereIf(inQuery.IsGlobalHaveUpdate != null, t => t.IsGlobalHaveUpdate== inQuery.IsGlobalHaveUpdate)
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.TaskName.Contains(inQuery.TaskName) || t.TaskBlindName.Contains(inQuery.TaskName))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.TaskName.Contains(inQuery.TaskName) || t.TaskBlindName.Contains(inQuery.TaskName))
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.Subject.Code.Contains(inQuery.SubjectCode))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.Subject.Code.Contains(inQuery.SubjectCode))
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
var subjectVisitList = _subjectVisitRepository.Where(t => subjectVisitIdList.Contains(t.Id)).ProjectTo<VisitGenerataTaskDTO>(_mapper.ConfigurationProvider).Distinct().ToList();
|
var subjectVisitList = _subjectVisitRepository.Where(t => subjectVisitIdList.Contains(t.Id)).ProjectTo<VisitGenerataTaskDTO>(_mapper.ConfigurationProvider).Distinct().ToList();
|
||||||
|
|
||||||
|
|
||||||
await AddTaskAsync(new GenerateTaskCommand() { TrialId = trialId, IsAssignSubjectToDoctor = isAssignSubjectToDoctor, VisitGenerataTaskList = subjectVisitList, ReadingCategory = ReadingCategory.Visit });
|
await AddTaskAsync(new GenerateTaskCommand() { TrialId = trialId, IsAssignSubjectToDoctor = isAssignSubjectToDoctor, VisitGenerataTaskList = subjectVisitList, ReadingCategory = GenerateTaskCategory.Visit });
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
switch (generateTaskCommand.ReadingCategory)
|
switch (generateTaskCommand.ReadingCategory)
|
||||||
{
|
{
|
||||||
case ReadingCategory.Visit:
|
case GenerateTaskCategory.Visit:
|
||||||
foreach (var subjectVisit in generateTaskCommand.VisitGenerataTaskList)
|
foreach (var subjectVisit in generateTaskCommand.VisitGenerataTaskList)
|
||||||
{
|
{
|
||||||
var assignConfigList = await _subjectUserRepository.Where(t => t.TrialId == trialId && t.SubjectId == subjectVisit.SubjectId && t.OrignalSubjectUserId == null && t.IsConfirmed).Select(u => new { u.DoctorUserId, u.ArmEnum }).ToListAsync();
|
var assignConfigList = await _subjectUserRepository.Where(t => t.TrialId == trialId && t.SubjectId == subjectVisit.SubjectId && t.OrignalSubjectUserId == null && t.IsConfirmed).Select(u => new { u.DoctorUserId, u.ArmEnum }).ToListAsync();
|
||||||
|
@ -294,7 +294,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
await _subjectVisitRepository.BatchUpdateNoTrackingAsync(t => t.TrialId == trialId && t.Id == subjectVisit.Id, u => new SubjectVisit() { IsVisitTaskGenerated = true });
|
await _subjectVisitRepository.BatchUpdateNoTrackingAsync(t => t.TrialId == trialId && t.Id == subjectVisit.Id, u => new SubjectVisit() { IsVisitTaskGenerated = true });
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ReadingCategory.ReReading:
|
case GenerateTaskCategory.ReReading:
|
||||||
|
|
||||||
var reReadingVisitTask = generateTaskCommand.ReReadingTask;
|
var reReadingVisitTask = generateTaskCommand.ReReadingTask;
|
||||||
|
|
||||||
|
@ -355,8 +355,8 @@ namespace IRaCIS.Core.Application.Service
|
||||||
//}
|
//}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case ReadingCategory.SelfConsistent:
|
case GenerateTaskCategory.SelfConsistent:
|
||||||
case ReadingCategory.GroupConsistent:
|
case GenerateTaskCategory.GroupConsistent:
|
||||||
|
|
||||||
foreach (var task in generateTaskCommand.GenerataConsistentTaskList)
|
foreach (var task in generateTaskCommand.GenerataConsistentTaskList)
|
||||||
{
|
{
|
||||||
|
@ -381,9 +381,11 @@ namespace IRaCIS.Core.Application.Service
|
||||||
TaskAllocationState = TaskAllocationState.Allocated,
|
TaskAllocationState = TaskAllocationState.Allocated,
|
||||||
AllocateTime = DateTime.Now,
|
AllocateTime = DateTime.Now,
|
||||||
|
|
||||||
|
BlindTrialSiteCode=task.BlindTrialSiteCode,
|
||||||
|
BlindSubjectCode=task.BlindSubjectCode,
|
||||||
ConsistentAnalysisOriginalTaskId=task.Id,
|
ConsistentAnalysisOriginalTaskId=task.Id,
|
||||||
|
|
||||||
IsSelfAnalysis= generateTaskCommand.ReadingCategory==ReadingCategory.SelfConsistent,
|
IsSelfAnalysis= generateTaskCommand.ReadingCategory== GenerateTaskCategory.SelfConsistent,
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -396,7 +398,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ReadingCategory.Judge:
|
case GenerateTaskCategory.Judge:
|
||||||
var firstTask = await _visitTaskRepository.Where(x => generateTaskCommand.JudgeVisitTaskIdList.Contains(x.Id)).FirstOrDefaultAsync();
|
var firstTask = await _visitTaskRepository.Where(x => generateTaskCommand.JudgeVisitTaskIdList.Contains(x.Id)).FirstOrDefaultAsync();
|
||||||
|
|
||||||
var subjectUser = await _subjectUserRepository.Where(x => x.SubjectId == firstTask.SubjectId && x.ArmEnum == Arm.JudgeArm).FirstOrDefaultAsync();
|
var subjectUser = await _subjectUserRepository.Where(x => x.SubjectId == firstTask.SubjectId && x.ArmEnum == Arm.JudgeArm).FirstOrDefaultAsync();
|
||||||
|
@ -441,7 +443,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//case ReadingCategory.ReadingPeriod:
|
//case ReadingCategory.ReadingPeriod:
|
||||||
case ReadingCategory.Global:
|
case GenerateTaskCategory.Global:
|
||||||
|
|
||||||
if (trialConfig.ReadingType == ReadingMethod.Double)
|
if (trialConfig.ReadingType == ReadingMethod.Double)
|
||||||
{
|
{
|
||||||
|
@ -507,7 +509,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ReadingCategory.Oncology:
|
case GenerateTaskCategory.Oncology:
|
||||||
foreach (var item in generateTaskCommand.ReadingGenerataTaskList)
|
foreach (var item in generateTaskCommand.ReadingGenerataTaskList)
|
||||||
{
|
{
|
||||||
var singleTask = await _visitTaskRepository.AddAsync(new VisitTask()
|
var singleTask = await _visitTaskRepository.AddAsync(new VisitTask()
|
||||||
|
|
|
@ -1046,7 +1046,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
TrialId = trialId,
|
TrialId = trialId,
|
||||||
|
|
||||||
ReadingCategory = ReadingCategory.ReReading,
|
ReadingCategory = GenerateTaskCategory.ReReading,
|
||||||
|
|
||||||
ReReadingTask = origenalTask,
|
ReReadingTask = origenalTask,
|
||||||
|
|
||||||
|
@ -1178,7 +1178,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
TrialId = trialId,
|
TrialId = trialId,
|
||||||
|
|
||||||
ReadingCategory = ReadingCategory.ReReading,
|
ReadingCategory = GenerateTaskCategory.ReReading,
|
||||||
|
|
||||||
ReReadingTask = origenalTask,
|
ReReadingTask = origenalTask,
|
||||||
|
|
||||||
|
|
|
@ -597,7 +597,7 @@ namespace IRaCIS.Application.Services
|
||||||
await _visitTaskHelpeService.AddTaskAsync(new GenerateTaskCommand()
|
await _visitTaskHelpeService.AddTaskAsync(new GenerateTaskCommand()
|
||||||
{
|
{
|
||||||
|
|
||||||
ReadingCategory = ReadingCategory.Global,
|
ReadingCategory = GenerateTaskCategory.Global,
|
||||||
TrialId = taskInfo.TrialId,
|
TrialId = taskInfo.TrialId,
|
||||||
ReadingGenerataTaskList = needReadList
|
ReadingGenerataTaskList = needReadList
|
||||||
}) ;
|
}) ;
|
||||||
|
@ -619,7 +619,7 @@ namespace IRaCIS.Application.Services
|
||||||
await _visitTaskHelpeService.AddTaskAsync(new GenerateTaskCommand()
|
await _visitTaskHelpeService.AddTaskAsync(new GenerateTaskCommand()
|
||||||
{
|
{
|
||||||
|
|
||||||
ReadingCategory = ReadingCategory.Oncology,
|
ReadingCategory = GenerateTaskCategory.Oncology,
|
||||||
TrialId = taskInfo.TrialId,
|
TrialId = taskInfo.TrialId,
|
||||||
ReadingGenerataTaskList = needReadList
|
ReadingGenerataTaskList = needReadList
|
||||||
});
|
});
|
||||||
|
@ -780,7 +780,7 @@ namespace IRaCIS.Application.Services
|
||||||
await _visitTaskHelpeService.AddTaskAsync(new GenerateTaskCommand()
|
await _visitTaskHelpeService.AddTaskAsync(new GenerateTaskCommand()
|
||||||
{
|
{
|
||||||
JudgeVisitTaskIdList= inDto.VisitTaskIds,
|
JudgeVisitTaskIdList= inDto.VisitTaskIds,
|
||||||
ReadingCategory= ReadingCategory.Judge,
|
ReadingCategory= GenerateTaskCategory.Judge,
|
||||||
TrialId= trialId
|
TrialId= trialId
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,30 @@ namespace IRaCIS.Core.Domain.Share
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum GenerateTaskCategory
|
||||||
|
{
|
||||||
|
//访视
|
||||||
|
Visit = 1,
|
||||||
|
|
||||||
|
////阅片周期
|
||||||
|
//ReadingPeriod = 2,
|
||||||
|
|
||||||
|
//全局
|
||||||
|
Global = 3,
|
||||||
|
|
||||||
|
//裁判
|
||||||
|
Judge = 4,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 肿瘤学
|
||||||
|
/// </summary>
|
||||||
|
Oncology = 5,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//生成任务 额外增加的 前端那边不加
|
//生成任务 额外增加的 前端那边不加
|
||||||
|
|
||||||
ReReading = 6,
|
ReReading = 6,
|
||||||
|
|
|
@ -48,6 +48,8 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
|
|
||||||
|
|
||||||
//public Guid? CompareDoctorUserId { get; set; }
|
//public Guid? CompareDoctorUserId { get; set; }
|
||||||
|
//public User AnalysisDoctorUser { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public bool IsHaveReadingPeriod { get; set; }
|
public bool IsHaveReadingPeriod { get; set; }
|
||||||
|
@ -58,12 +60,12 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
|
|
||||||
public User CompareDoctorUser { get; set; }
|
public User CompareDoctorUser { get; set; }
|
||||||
|
|
||||||
public User AnalysisDoctorUser { get; set; }
|
|
||||||
|
|
||||||
public List<VisitTask> DoctorVisitTaskList { get; set; }
|
public List<VisitTask> DoctorVisitTaskList { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public int BlindSubjectNumberOfPlaces { get; set; }
|
||||||
|
public string BlindTrialSiteCode { get; set; } = string.Empty;
|
||||||
|
|
||||||
//[Projectable]
|
//[Projectable]
|
||||||
//public List<VisitTask> DoctorConsistentTaskList => DoctorVisitTaskList.Where(t => t.IsAnalysisCreate && t.TaskConsistentRuleId == Id).ToList();
|
//public List<VisitTask> DoctorConsistentTaskList => DoctorVisitTaskList.Where(t => t.IsAnalysisCreate && t.TaskConsistentRuleId == Id).ToList();
|
||||||
|
|
|
@ -147,6 +147,11 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime? FirstReadingTime { get; set; }
|
public DateTime? FirstReadingTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 全局是否有更新
|
||||||
|
/// </summary>
|
||||||
|
public bool? IsGlobalHaveUpdate { get; set; }
|
||||||
|
|
||||||
#region 一致性分析的任务特有数据
|
#region 一致性分析的任务特有数据
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -20,7 +20,6 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
{ReadingCategory.Visit, 0 },
|
{ReadingCategory.Visit, 0 },
|
||||||
{ReadingCategory.Global,(decimal) 0.03 },
|
{ReadingCategory.Global,(decimal) 0.03 },
|
||||||
{ReadingCategory.Judge,(decimal) 0.02 },
|
{ReadingCategory.Judge,(decimal) 0.02 },
|
||||||
{ReadingCategory.ReReading, 0 },
|
|
||||||
{ReadingCategory.Oncology, 0 },
|
{ReadingCategory.Oncology, 0 },
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -103,8 +103,6 @@ namespace IRaCIS.Core.Infra.EFCore
|
||||||
|
|
||||||
modelBuilder.Entity<VisitTask>().HasMany(t => t.TaskMedicalReviewList).WithOne(t => t.VisitTask).HasForeignKey(t => t.VisitTaskId);
|
modelBuilder.Entity<VisitTask>().HasMany(t => t.TaskMedicalReviewList).WithOne(t => t.VisitTask).HasForeignKey(t => t.VisitTaskId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
modelBuilder.Entity<VisitTask>().HasOne(t => t.Subject).WithMany(s=>s.SubjectVisitTaskList).HasForeignKey(t => t.SubjectId);
|
modelBuilder.Entity<VisitTask>().HasOne(t => t.Subject).WithMany(s=>s.SubjectVisitTaskList).HasForeignKey(t => t.SubjectId);
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue