Test.EIImageViewer
he 2023-02-24 13:41:04 +08:00
parent 078fff447c
commit 700f6488aa
2 changed files with 112 additions and 36 deletions

View File

@ -143,6 +143,21 @@ namespace IRaCIS.Core.Application.Service
//每个访视 根据项目配置生成任务 双审生成两个
TaskUrgentType? taskUrgentType = null;
if (subjectVisit.PDState == PDStateEnum.PDProgress)
{
taskUrgentType = TaskUrgentType.PDProgress;
}
else if (subjectVisit.IsEnrollmentConfirm)
{
taskUrgentType = TaskUrgentType.EnrollmentConfirm;
}
else if (subjectVisit.IsUrgent)
{
taskUrgentType = TaskUrgentType.VisitUrgent;
}
if (trialReadingCriterionConfig.ReadingType == ReadingMethod.Double)
{
//未防止脏数据 这里也多判断一次
@ -152,26 +167,13 @@ namespace IRaCIS.Core.Application.Service
VisitTask? task1 = null;
VisitTask? task2 = null;
if (!existCurrentVisitTaskList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1))
{
currentMaxCodeInt = currentMaxCodeInt + 1;
TaskUrgentType? taskUrgentType = null;
if (subjectVisit.PDState == PDStateEnum.PDProgress)
{
taskUrgentType = TaskUrgentType.PDProgress;
}
else if (subjectVisit.IsEnrollmentConfirm)
{
taskUrgentType = TaskUrgentType.EnrollmentConfirm;
}
else if (subjectVisit.IsUrgent)
{
taskUrgentType = TaskUrgentType.VisitUrgent;
}
task1 = await _visitTaskRepository.AddAsync(new VisitTask()
{
@ -208,6 +210,7 @@ namespace IRaCIS.Core.Application.Service
IsUrgent = subjectVisit.IsUrgent,
TaskBlindName = blindTaskName,
TaskName = subjectVisit.VisitName,
TaskUrgentType = taskUrgentType,
VisitTaskNum = subjectVisit.VisitNum,
//CheckPassedTime = subjectVisit.CheckPassedTime,
ArmEnum = Arm.DoubleReadingArm2,//特殊
@ -261,6 +264,7 @@ namespace IRaCIS.Core.Application.Service
TaskBlindName = blindTaskName,
TaskName = subjectVisit.VisitName,
VisitTaskNum = subjectVisit.VisitNum,
TaskUrgentType = taskUrgentType,
//CheckPassedTime = subjectVisit.CheckPassedTime,
ArmEnum = Arm.SingleReadingArm, //特殊
Code = currentMaxCodeInt + 1,
@ -435,7 +439,7 @@ namespace IRaCIS.Core.Application.Service
int currentMaxCodeInt = cacheMaxCodeInt > dbMaxCode ? cacheMaxCodeInt : dbMaxCode;
switch (generateTaskCommand.ReadingCategory)
@ -451,6 +455,29 @@ namespace IRaCIS.Core.Application.Service
foreach (var subjectVisit in subjectGroup.SubjectVisitList)
{
var subjectVisitInfo = await _subjectVisitRepository.Where(x => x.Id == subjectVisit.Id).Select(x => new
{
x.PDState,
x.IsEnrollmentConfirm,
x.IsUrgent,
}).FirstNotNullAsync();
TaskUrgentType? taskUrgentType = null;
if (subjectVisitInfo.PDState == PDStateEnum.PDProgress)
{
taskUrgentType = TaskUrgentType.PDProgress;
}
else if (subjectVisitInfo.IsEnrollmentConfirm)
{
taskUrgentType = TaskUrgentType.EnrollmentConfirm;
}
else if (subjectVisitInfo.IsUrgent)
{
taskUrgentType = TaskUrgentType.VisitUrgent;
}
var visitNumList = _subjectVisitRepository.Where(t => t.SubjectId == subjectGroup.SubjectId && t.IsLostVisit == false).OrderBy(t => t.VisitNum).Select(t => t.VisitNum).ToList();
@ -507,6 +534,8 @@ namespace IRaCIS.Core.Application.Service
SubjectId = subjectVisit.SubjectId,
IsUrgent = subjectVisit.IsUrgent,
TaskBlindName = blindTaskName,
TaskUrgentType = taskUrgentType,
TaskName = subjectVisit.VisitName,
VisitTaskNum = subjectVisit.VisitNum,
//CheckPassedTime = subjectVisit.CheckPassedTime,
@ -532,6 +561,7 @@ namespace IRaCIS.Core.Application.Service
IsUrgent = subjectVisit.IsUrgent,
TaskBlindName = blindTaskName,
TaskName = subjectVisit.VisitName,
TaskUrgentType = taskUrgentType,
VisitTaskNum = subjectVisit.VisitNum,
//CheckPassedTime = subjectVisit.CheckPassedTime,
ArmEnum = Arm.DoubleReadingArm2,//特殊
@ -814,6 +844,7 @@ namespace IRaCIS.Core.Application.Service
IsUrgent = subjectVisit.IsUrgent,
TaskBlindName = blindTaskName,
TaskName = subjectVisit.VisitName,
TaskUrgentType = taskUrgentType,
VisitTaskNum = subjectVisit.VisitNum,
//CheckPassedTime = subjectVisit.CheckPassedTime,
ArmEnum = Arm.SingleReadingArm, //特殊
@ -935,7 +966,7 @@ namespace IRaCIS.Core.Application.Service
Code = currentMaxCodeInt + 1,
TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)),
ReadingCategory = ReadingCategory.Visit,
TaskUrgentType = latestTask.TaskUrgentType,
SourceSubjectVisitId = latestTask.SourceSubjectVisitId,
VisitTaskNum = latestTask.VisitTaskNum,
TaskBlindName = visitBlindConfig.BlindFollowUpPrefix + " " + visitNumList.IndexOf(latestTask.VisitTaskNum),
@ -1036,7 +1067,30 @@ namespace IRaCIS.Core.Application.Service
var reReadingVisitTask = generateTaskCommand.ReReadingTask;
var subjectVisitUrgent = _subjectVisitRepository.Where(t => t.Id == reReadingVisitTask.SourceSubjectVisitId).Select(t=>t.IsUrgent).FirstOrDefault();
var subjectVisitUrgentInfo = await _subjectVisitRepository.Where(x => x.Id == reReadingVisitTask.SourceSubjectVisitId).Select(x => new
{
x.PDState,
x.IsEnrollmentConfirm,
x.IsUrgent,
}).FirstNotNullAsync();
TaskUrgentType? taskUrgent = null;
if (subjectVisitUrgentInfo.PDState == PDStateEnum.PDProgress)
{
taskUrgent = TaskUrgentType.PDProgress;
}
else if (subjectVisitUrgentInfo.IsEnrollmentConfirm)
{
taskUrgent = TaskUrgentType.EnrollmentConfirm;
}
else if (subjectVisitUrgentInfo.IsUrgent)
{
taskUrgent = TaskUrgentType.VisitUrgent;
}
var newTask = await _visitTaskRepository.AddAsync(new VisitTask()
{
@ -1047,7 +1101,8 @@ namespace IRaCIS.Core.Application.Service
TaskName = reReadingVisitTask.TaskName,
TaskBlindName = reReadingVisitTask.TaskBlindName,
IsUrgent = reReadingVisitTask.IsAnalysisCreate?false: subjectVisitUrgent,
IsUrgent = reReadingVisitTask.IsAnalysisCreate?false: subjectVisitUrgentInfo.IsUrgent,
TaskUrgentType = reReadingVisitTask.IsAnalysisCreate ? null : taskUrgent,
VisitTaskNum = reReadingVisitTask.VisitTaskNum,
ReadingCategory = reReadingVisitTask.ReadingCategory,
@ -1073,7 +1128,7 @@ namespace IRaCIS.Core.Application.Service
// AllocateTime = DateTime.Now,
//DoctorUserId = reReadingVisitTask.DoctorUserId,
});;
});
generateTaskCommand.Action(newTask);
@ -1264,6 +1319,7 @@ namespace IRaCIS.Core.Application.Service
// 需要添加全局任务再添加
if (originalTaskInfo.TrialReadingCriterion.IsGlobalReading)
{
var visitNumList = _subjectVisitRepository.Where(t => t.SubjectId == originalTaskInfo.SubjectId && t.IsLostVisit == false).OrderBy(t => t.VisitNum).Select(t => t.VisitNum).ToList();
foreach (var item in generateTaskCommand.ReadingGenerataTaskList)
{
item.VisitNum = originalTaskInfo.VisitTaskNum;
@ -1275,14 +1331,15 @@ namespace IRaCIS.Core.Application.Service
VisitTaskNum = item.VisitNum + ReadingCommon.TaskNumDic[ReadingCategory.Global],
TaskName = item.ReadingName,
ArmEnum = originalTaskInfo.ArmEnum,//特殊
TaskUrgentType= originalTaskInfo.TaskUrgentType,
TaskUrgentRemake= originalTaskInfo.TaskUrgentRemake,
DoctorUserId = originalTaskInfo.DoctorUserId,
AllocateTime = DateTime.Now,
TaskAllocationState = TaskAllocationState.Allocated,
SuggesteFinishedTime = DateTime.Now.AddDays(7),
Code = currentMaxCodeInt + 1,
TaskBlindName = "G-"+ item.VisitNum.ToString("0.##"),
TaskBlindName = "G-"+ visitNumList.IndexOf(originalTaskInfo.VisitTaskNum),
SouceReadModuleId = item.ReadModuleId,
TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)),
ReadingCategory = item.ReadingCategory,

View File

@ -46,18 +46,37 @@ namespace IRaCIS.Application.Services
public async Task<IResponseOutput> BatchSubmitGlobalReadingInfo(BatchSubmitGlobalReadingInfo inDto)
{
await VerifyTaskIsSign(inDto.GlobalTaskId);
var criterionType = await _visitTaskRepository.Where(x => x.Id == inDto.GlobalTaskId).Select(x => x.TrialReadingCriterion.CriterionType).FirstNotNullAsync();
foreach (var item in inDto.VisitTaskAnswerList)
{
foreach (var answer in item.AnswerList)
{
await _readingGlobalTaskInfoRepository.BatchDeleteNoTrackingAsync(x => x.GlobalTaskId == inDto.GlobalTaskId && x.TaskId == item.VisitTaskId && x.GlobalAnswerType == answer.GlobalAnswerType && x.QuestionId == answer.QuestionId);
await _readingTaskQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == item.VisitTaskId && x.ReadingQuestionTrialId == answer.QuestionId
&& x.Answer != answer.Answer && answer.Answer != string.Empty&& answer.Answer!=null
, x => new ReadingTaskQuestionAnswer()
if (criterionType == CriterionType.PCWG3)
{
GlobalChangeAnswer = answer.Answer,
IsGlobalChange=true,
});
await _readingTaskQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == item.VisitTaskId && x.ReadingQuestionTrialId == answer.QuestionId
&& x.Answer != answer.Answer && answer.Answer != string.Empty && answer.Answer != null
, x => new ReadingTaskQuestionAnswer()
{
Answer= answer.Answer,
GlobalChangeAnswer = answer.Answer,
IsGlobalChange = true,
});
}
else
{
await _readingTaskQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == item.VisitTaskId && x.ReadingQuestionTrialId == answer.QuestionId
&& x.Answer != answer.Answer && answer.Answer != string.Empty && answer.Answer != null
, x => new ReadingTaskQuestionAnswer()
{
GlobalChangeAnswer = answer.Answer,
IsGlobalChange = true,
});
}
}
}
var answers= inDto.VisitTaskAnswerList.SelectMany(x => x.AnswerList.Select(y => new ReadingGlobalTaskInfo()
@ -308,6 +327,10 @@ namespace IRaCIS.Application.Services
}).ToList();
List<GetGlobalQuestionType> questionTypes = new List<GetGlobalQuestionType>()
{
};
if (criterionType != CriterionType.PCWG3)
{
x.AgreeOrNot = new List<GlobalQuestionInfo>()
@ -322,6 +345,8 @@ namespace IRaCIS.Application.Services
}
};
questionTypes.Add(new GetGlobalQuestionType() { GlobalAnswerType = GlobalAnswerType.UpdateType, QuestionName = "评估更新类型" });
}
else
{
@ -331,14 +356,8 @@ namespace IRaCIS.Application.Services
List<GetGlobalQuestionType> questionTypes = new List<GetGlobalQuestionType>()
{
};
if(criterionType!= CriterionType.PCWG3)
{
questionTypes.Add(new GetGlobalQuestionType() { GlobalAnswerType = GlobalAnswerType.UpdateType, QuestionName = "评估更新类型" });
}
questionTypes.Add(new GetGlobalQuestionType() { GlobalAnswerType = GlobalAnswerType.Reason, QuestionName = "全局阅片备注" });
foreach (var item in questionTypes)
{