修改bug
parent
134531cf9f
commit
cb5f3c00bd
|
@ -247,6 +247,10 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
public ReReadingApplyState? ReReadingApplyState { get; set; }
|
||||
|
||||
|
||||
public bool? IsSelfAnalysis { get; set; }
|
||||
|
||||
public Arm? ArmEnum { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -60,6 +60,9 @@ namespace IRaCIS.Core.Application.Service
|
|||
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.ReadingCategory == queryVisitTask.ReadingCategory)
|
||||
.WhereIf(queryVisitTask.ReadingTaskState != null, t => t.ReadingTaskState == queryVisitTask.ReadingTaskState)
|
||||
.WhereIf(queryVisitTask.TaskAllocationState != null, t => t.TaskAllocationState == queryVisitTask.TaskAllocationState)
|
||||
.WhereIf(queryVisitTask.IsSelfAnalysis != null, t => t.IsSelfAnalysis == queryVisitTask.IsSelfAnalysis)
|
||||
.WhereIf(queryVisitTask.ArmEnum != null, t => t.ArmEnum == queryVisitTask.ArmEnum)
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TrialSiteCode), t => (t.BlindTrialSiteCode.Contains(queryVisitTask.TrialSiteCode) && t.IsAnalysisCreate) || (t.Subject.TrialSite.TrialSiteCode.Contains(queryVisitTask.TrialSiteCode) && t.IsAnalysisCreate == false))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => t.Subject.Code.Contains(queryVisitTask.SubjectCode))
|
||||
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate)
|
||||
|
@ -147,12 +150,30 @@ namespace IRaCIS.Core.Application.Service
|
|||
//最后一个访视添加全局
|
||||
if (filterObj.IsGenerateGlobalTask)
|
||||
{
|
||||
var globalTask = (subject.VisitTaskList.Take(filterObj.PlanVisitCount).Last()).Clone();
|
||||
globalTask.TaskName = (int)globalTask.VisitTaskNum + "Global";
|
||||
globalTask.TaskBlindName = (int)globalTask.VisitTaskNum + "Global";
|
||||
globalTask.ReadingCategory = ReadingCategory.Global;
|
||||
globalTask.VisitTaskNum += ReadingCommon.TaskNumDic[ReadingCategory.Global];
|
||||
subject.VisitTaskList.Add(globalTask);
|
||||
var lastTask = (subject.VisitTaskList.Take(filterObj.PlanVisitCount).Last()).Clone();
|
||||
|
||||
var existGlobal = _visitTaskRepository.Where(t => t.SubjectId == lastTask.SubjectId && t.TaskState == TaskState.Effect && t.ReadingCategory == ReadingCategory.Global && t.VisitTaskNum == lastTask.VisitTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Global]).ProjectTo<VisitTaskSimpleDTO>(_mapper.ConfigurationProvider).FirstOrDefault();
|
||||
|
||||
|
||||
if (existGlobal == null)
|
||||
{
|
||||
existGlobal = new VisitTaskSimpleDTO()
|
||||
{
|
||||
SubjectId = lastTask.SubjectId,
|
||||
TrialId = lastTask.TrialId,
|
||||
BlindSubjectCode = lastTask.BlindSubjectCode,
|
||||
BlindTrialSiteCode = lastTask.BlindTrialSiteCode,
|
||||
ArmEnum = lastTask.ArmEnum,
|
||||
ReadingCategory = ReadingCategory.Global
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
existGlobal.TaskName = (int)existGlobal.VisitTaskNum + "Global";
|
||||
existGlobal.TaskBlindName = (int)existGlobal.VisitTaskNum + "Global";
|
||||
|
||||
subject.VisitTaskList.Add(existGlobal);
|
||||
}
|
||||
|
||||
|
||||
|
@ -354,7 +375,9 @@ namespace IRaCIS.Core.Application.Service
|
|||
VisitTaskNum = task.VisitTaskNum,
|
||||
TrialId = task.TrialId,
|
||||
DoctorUserId = needAddDoctorUserId,
|
||||
ArmEnum = Arm.GroupConsistentArm
|
||||
ArmEnum = Arm.GroupConsistentArm,
|
||||
SouceReadModuleId = task.SouceReadModuleId,
|
||||
SourceSubjectVisitId=task.SourceSubjectVisitId,
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -363,13 +386,28 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
if (filterObj.IsGenerateGlobalTask)
|
||||
{
|
||||
var globalTask = (subjectAddTaskList.Take(filterObj.PlanVisitCount).Last()).Clone();
|
||||
globalTask.TaskName = (int)globalTask.VisitTaskNum + "Global";
|
||||
globalTask.TaskBlindName = (int)globalTask.VisitTaskNum + "Global";
|
||||
globalTask.ReadingCategory = ReadingCategory.Global;
|
||||
globalTask.VisitTaskNum += ReadingCommon.TaskNumDic[ReadingCategory.Global];
|
||||
globalTask.DoctorUserId =needAddDoctorUserId;
|
||||
subjectAddTaskList.Add(globalTask);
|
||||
var lastTask = (subjectAddTaskList.Take(filterObj.PlanVisitCount).Last()).Clone();
|
||||
|
||||
|
||||
var existGlobal = _visitTaskRepository.Where(t => t.SubjectId == lastTask.SubjectId && t.TaskState == TaskState.Effect && t.ReadingCategory == ReadingCategory.Global && t.VisitTaskNum == lastTask.VisitTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Global]).ProjectTo<VisitTaskGroupSimpleDTO>(_mapper.ConfigurationProvider).FirstOrDefault();
|
||||
|
||||
|
||||
if (existGlobal == null)
|
||||
{
|
||||
existGlobal = new VisitTaskSimpleDTO()
|
||||
{
|
||||
SubjectId = lastTask.SubjectId,
|
||||
TrialId = lastTask.TrialId,
|
||||
ArmEnum = lastTask.ArmEnum,
|
||||
ReadingCategory = ReadingCategory.Global
|
||||
};
|
||||
}
|
||||
|
||||
existGlobal.TaskName = (int)existGlobal.VisitTaskNum + "Global";
|
||||
existGlobal.TaskBlindName = (int)existGlobal.VisitTaskNum + "Global";
|
||||
existGlobal.DoctorUserId = needAddDoctorUserId;
|
||||
|
||||
subjectAddTaskList.Add(existGlobal);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -456,7 +494,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
ValidVisitCount = t.SubjectVisitTaskList.AsQueryable().Where(visitTaskFilter).Count(),
|
||||
|
||||
VisitTaskList = t.SubjectVisitTaskList.AsQueryable().Where(visitTaskFilter).Select(c => new VisitTaskSimpleDTO()
|
||||
VisitTaskList = t.SubjectVisitTaskList.AsQueryable().Where(visitTaskFilter).OrderBy(t => t.VisitTaskNum).Select(c => new VisitTaskSimpleDTO()
|
||||
{
|
||||
Id = c.Id,
|
||||
ReadingCategory = c.ReadingCategory,
|
||||
|
@ -492,7 +530,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
SouceReadModuleId = c.SouceReadModuleId,
|
||||
}).ToList(),
|
||||
|
||||
}).OrderBy(t => t.VisitTaskNum).ToList()
|
||||
}).ToList()
|
||||
});
|
||||
|
||||
return query.OrderByDescending(t => t.IsHaveGeneratedTask);
|
||||
|
|
|
@ -95,7 +95,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||
|
||||
|
||||
|
||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.SubjectId == subjectId && t.ArmEnum == doctorArm.ArmEnum && t.TrialId == command.TrialId && t.TaskAllocationState == TaskAllocationState.NotAllocate && t.TaskState == TaskState.Effect,
|
||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.SubjectId == subjectId && t.ArmEnum == doctorArm.ArmEnum && t.TrialId == command.TrialId && t.TaskAllocationState == TaskAllocationState.NotAllocate && t.TaskState == TaskState.Effect && t.IsAnalysisCreate == false,
|
||||
u => new VisitTask()
|
||||
{
|
||||
AllocateTime = DateTime.Now,
|
||||
|
@ -169,7 +169,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||
|
||||
await _subjectUserRepository.DeleteFromQueryAsync(t => t.Id == command.Id);
|
||||
|
||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.SubjectId == command.SubjectId && t.DoctorUserId == command.DoctorUserId && t.ArmEnum == command.ArmEnum && t.ReadingTaskState == ReadingTaskState.WaitReading && t.TaskState == TaskState.Effect, u => new VisitTask()
|
||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.SubjectId == command.SubjectId && t.DoctorUserId == command.DoctorUserId && t.ArmEnum == command.ArmEnum && t.ReadingTaskState == ReadingTaskState.WaitReading && t.TaskState == TaskState.Effect && t.IsAnalysisCreate==false, u => new VisitTask()
|
||||
{
|
||||
AllocateTime = null,
|
||||
DoctorUserId = null,
|
||||
|
|
|
@ -192,8 +192,14 @@ namespace IRaCIS.Core.Application.Service
|
|||
.ForMember(o => o.MedicalNo, t => t.MapFrom(u => u.Subject.MedicalNo))
|
||||
.ForMember(o => o.IsGeneratedJudge, t => t.MapFrom(u => u.JudgeVisitTaskId != null))
|
||||
.ForMember(o => o.ReadingDurationTimeSpan, t => t.MapFrom(u => u.SignTime - u.FirstReadingTime))
|
||||
|
||||
|
||||
;
|
||||
|
||||
CreateMap<VisitTask, VisitTaskGroupSimpleDTO>();
|
||||
CreateMap<VisitTask, VisitTaskSimpleDTO>();
|
||||
|
||||
|
||||
|
||||
CreateMap<User, UserSimpleInfo>()
|
||||
|
||||
|
|
Loading…
Reference in New Issue