Merge branch 'Test_IRC_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
cfd05cff36
|
@ -649,6 +649,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
}
|
||||
await _readingTableAnswerRowInfoRepository.DeleteFromQueryAsync(x => x.QuestionId == questionInfo.Id && x.VisitTaskId == taskinfo.Id);
|
||||
await _readingTableQuestionAnswerRepository.DeleteFromQueryAsync(x => x.QuestionId == questionInfo.Id && x.VisitTaskId == taskinfo.Id);
|
||||
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
||||
await _readingTableAnswerRowInfoRepository.AddRangeAsync(tableAnsweRowInfos);
|
||||
await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers);
|
||||
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
||||
|
@ -824,6 +825,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
}
|
||||
await _readingTableAnswerRowInfoRepository.DeleteFromQueryAsync(x => x.QuestionId == questionInfo.Id && x.VisitTaskId == taskinfo.Id);
|
||||
await _readingTableQuestionAnswerRepository.DeleteFromQueryAsync(x => x.QuestionId == questionInfo.Id && x.VisitTaskId == taskinfo.Id);
|
||||
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
||||
await _readingTableAnswerRowInfoRepository.AddRangeAsync(tableAnsweRowInfos);
|
||||
await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers);
|
||||
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
||||
|
|
|
@ -254,23 +254,6 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
}
|
||||
|
||||
|
||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ReadingImportFile)))
|
||||
{
|
||||
var type = GetEntityAuditOpt(item);
|
||||
|
||||
var extraIdentification = string.Empty;
|
||||
|
||||
var basicData = item.Entity as SystemBasicData;
|
||||
extraIdentification = (basicData.ParentId == null ? "/parent" : string.Empty);
|
||||
|
||||
await InsertInspection<SystemBasicData>(item.Entity as SystemBasicData, type, x => new InspectionConvertDTO()
|
||||
{
|
||||
IsDistinctionInterface = false,
|
||||
ExtraIndentification = extraIdentification
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 阅片导入
|
||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ReadingImportFile)))
|
||||
{
|
||||
|
@ -2166,6 +2149,278 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
);
|
||||
}
|
||||
|
||||
|
||||
//任务
|
||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(VisitTask)))
|
||||
{
|
||||
var type = GetEntityAuditOpt(item);
|
||||
|
||||
var entity = item.Entity as VisitTask;
|
||||
var userRealName = await _dbContext.User.Where(x => x.Id == entity.DoctorUserId).Select(x => x.FullName).FirstOrDefaultAsync();
|
||||
VisitTaskAuditingDto obj = new VisitTaskAuditingDto()
|
||||
{
|
||||
UserRealName = userRealName,
|
||||
|
||||
};
|
||||
|
||||
string reason = string.Empty;
|
||||
var extraIdentification = string.Empty;
|
||||
var isDistinctionInterface = true;
|
||||
#region 标识区分
|
||||
|
||||
if (type == AuditOpt.Add)
|
||||
{
|
||||
isDistinctionInterface = false;
|
||||
|
||||
//生成一致性分析任务
|
||||
if (entity.IsSelfAnalysis == true)
|
||||
{
|
||||
extraIdentification = "/SelfAnalysis";
|
||||
}
|
||||
else if (entity.IsSelfAnalysis == false)
|
||||
{
|
||||
extraIdentification = "/GroupAnalysis";
|
||||
}
|
||||
else
|
||||
{
|
||||
extraIdentification = "/NotAnalysis";
|
||||
}
|
||||
|
||||
//区分任务类型
|
||||
extraIdentification = extraIdentification + "/" + (int)entity.ReadingCategory;
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
switch (_userInfo.RequestUrl)
|
||||
{
|
||||
//申请重阅
|
||||
case "VisitTask/applyReReading":
|
||||
|
||||
|
||||
extraIdentification = "/" + (int)entity.ReReadingApplyState;
|
||||
|
||||
break;
|
||||
|
||||
|
||||
//同意重阅
|
||||
case "VisitTask/ConfirmReReading":
|
||||
|
||||
|
||||
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM)
|
||||
{
|
||||
extraIdentification = "/" + 1;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
extraIdentification = "/" + 2;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "VisitTask/PMSetTaskBack":
|
||||
|
||||
if (entity.PMBackReason.IsNotNullOrEmpty())
|
||||
{
|
||||
extraIdentification = "/" + "Reason";
|
||||
reason = entity.PMBackReason;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "ReadingImageTask/SubmitVisitTaskQuestions":
|
||||
|
||||
//访视任务-- 非Dicom 阅片
|
||||
if (entity.ReadingTaskState != ReadingTaskState.HaveSigned)
|
||||
{
|
||||
//提交访视任务的时候 会多次更新同一个记录 只记录最后一次
|
||||
return;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
//Dicom 阅片 签名
|
||||
case "ReadingImageTask/SubmitDicomVisitTask":
|
||||
|
||||
//跳转阅片结果需要该参数
|
||||
var subjectCode = _dbContext.Subject.Where(t => t.Id == entity.SubjectId).Select(t => t.Code).First();
|
||||
|
||||
obj.SubjectCode = subjectCode;
|
||||
|
||||
break;
|
||||
|
||||
case "ReadingImageTask/resetReadingTask":
|
||||
//跳转阅片结果需要该参数
|
||||
|
||||
obj.IsReadingReset = true;
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
#region 裁判、肿瘤学、全局 都是通用的
|
||||
|
||||
//裁判任务 结果的保存 和签名提交
|
||||
if (entity.JudgeResultTaskId != null && (_userInfo.RequestUrl == "ReadingImageTask/SaveJudgeVisitTaskResult" || _userInfo.RequestUrl == "ReadingImageTask/SubmitJudgeVisitTaskResult"))
|
||||
{
|
||||
|
||||
var visitTaskNum = entity.VisitTaskNum - ReadingCommon.TaskNumDic[ReadingCategory.Judge];
|
||||
var list = await _dbContext.VisitTask.Where(t => t.TaskState == TaskState.Effect && t.SubjectId == entity.SubjectId && t.VisitTaskNum == visitTaskNum && t.JudgeVisitTaskId == entity.Id && t.TrialReadingCriterionId == entity.TrialReadingCriterionId).Select(t => new { t.Id, t.DoctorUser.FullName, t.ArmEnum }).OrderBy(t => t.ArmEnum).ToListAsync();
|
||||
|
||||
|
||||
var r1 = list.Where(t => t.ArmEnum == Arm.DoubleReadingArm1).FirstOrDefault();
|
||||
var r2 = list.Where(t => t.ArmEnum == Arm.DoubleReadingArm2).FirstOrDefault();
|
||||
|
||||
obj.R1 = r1.FullName;
|
||||
obj.R2 = r2.FullName;
|
||||
obj.SelectResult = r1.Id == entity.JudgeResultTaskId ? "R1" : "R2";
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
//增加进入阅片中的稽查
|
||||
|
||||
//重置阅片也会从待阅片 变为阅片中,因为复制病灶依赖这个改变
|
||||
if (obj.IsReadingReset != true)
|
||||
{
|
||||
if (entity.ReadingTaskState == ReadingTaskState.Reading)
|
||||
{
|
||||
if (_dbContext.VisitTask.Where(t => t.Id == entity.Id).Any(t => t.ReadingTaskState == ReadingTaskState.WaitReading))
|
||||
{
|
||||
isDistinctionInterface = false;
|
||||
extraIdentification = "/ChangeToReading";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (entity.IsReadClinicalData == true)
|
||||
{
|
||||
if (_dbContext.VisitTask.Where(t => t.Id == entity.Id).Any(t => t.IsReadClinicalData == false))
|
||||
{
|
||||
isDistinctionInterface = false;
|
||||
extraIdentification = "/ReadClinicalData";
|
||||
}
|
||||
}
|
||||
|
||||
if (entity.TaskBlindName.Contains("Timepoint Ran"))
|
||||
{
|
||||
if (_dbContext.VisitTask.Where(t => t.Id == entity.Id).Any(t => !t.TaskBlindName.Contains("Timepoint Ran")))
|
||||
{
|
||||
isDistinctionInterface = false;
|
||||
extraIdentification = "/TriggerSystemBlindingName";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#region 通过链接跳转 2022 12-19
|
||||
|
||||
////肿瘤学任务
|
||||
//if (entity.ReadingTaskState == ReadingTaskState.HaveSigned && _userInfo.RequestUrl == "ReadingImageTask/SubmitOncologyReadingInfo")
|
||||
//{
|
||||
|
||||
|
||||
// var oncologyAnswerList = await _dbContext.ReadingOncologyTaskInfo.Where(t => t.OncologyTaskId == entity.Id).Select(t => new { t.VisitTask.TaskBlindName, t.VisitTask.TaskName, t.EvaluationReason, t.EvaluationResult, t.VisitTask.VisitTaskNum, VisitTaskId = t.VisitTask.Id }).ToListAsync();
|
||||
|
||||
// var golbalTaskInfo = await _dbContext.VisitTask.Where(t => t.SubjectId == entity.SubjectId && t.ReadingCategory == ReadingCategory.Global && t.TaskState == TaskState.Effect && t.IsAnalysisCreate == entity.IsAnalysisCreate && t.VisitTaskNum == (entity.VisitTaskNum - ReadingCommon.TaskNumDic[ReadingCategory.Oncology] + ReadingCommon.TaskNumDic[ReadingCategory.Global])).Select(t => new { GlobalTaskId = t.Id }).FirstNotNullAsync();
|
||||
|
||||
|
||||
// var globalResultList = await _dbContext.ReadingGlobalTaskInfo.Where(t => t.GlobalTaskId == golbalTaskInfo.GlobalTaskId).ToListAsync();
|
||||
|
||||
// var modifyVisitList = globalResultList
|
||||
// .GroupBy(t => t.TaskId).Select(g => new
|
||||
// {
|
||||
// VisitTaskId = g.Key,
|
||||
// GlobalResult = g.Select(c => new { c.Answer, c.QuestionId })
|
||||
// }).ToList();
|
||||
|
||||
// var query = from answer in oncologyAnswerList
|
||||
// join modifyVisit in modifyVisitList on answer.VisitTaskId equals modifyVisit.VisitTaskId into cc
|
||||
// from modifyVisit in cc.DefaultIfEmpty()
|
||||
// select new
|
||||
// {
|
||||
// answer.TaskBlindName,
|
||||
// answer.TaskName,
|
||||
// answer.EvaluationReason,
|
||||
// answer.EvaluationResult,
|
||||
// IsGlobalModify = modifyVisit != null,
|
||||
// Reason = modifyVisit != null ? modifyVisit.GlobalResult.Where(t => t.QuestionId == null).FirstOrDefault()?.Answer : String.Empty
|
||||
// };
|
||||
|
||||
// var result = query.ToList();
|
||||
|
||||
// obj = new { OncologyAnswerList = result };
|
||||
//}
|
||||
|
||||
////全局任务
|
||||
//if (entity.ReadingTaskState == ReadingTaskState.HaveSigned && _userInfo.RequestUrl == "ReadingImageTask/SubmitGlobalReadingInfo")
|
||||
//{
|
||||
|
||||
// var globalResultList = await _dbContext.ReadingGlobalTaskInfo.Where(t => t.GlobalTaskId == entity.Id).Select(t => new { VisitTaskId = t.TaskId, t.QuestionId, t.Answer, t.VisitTask.TaskBlindName, t.VisitTask.TaskName, t.TrialReadingQuestion.QuestionName }).ToListAsync();
|
||||
|
||||
// var visitTaskIdList = globalResultList.Select(t => t.VisitTaskId).ToList();
|
||||
|
||||
// var visitResultList = await _dbContext.ReadingTaskQuestionAnswer.Where(t => visitTaskIdList.Contains(t.VisitTaskId) && t.ReadingQuestionTrial.IsJudgeQuestion).Select(t => new { t.VisitTaskId, t.VisitTask.TaskBlindName, t.VisitTask.TaskName, t.VisitTask.VisitTaskNum, t.ReadingQuestionTrial.QuestionName, t.ReadingQuestionTrial.ShowOrder, t.Answer, t.ReadingQuestionTrialId })
|
||||
// .OrderBy(t => t.VisitTaskNum).ToListAsync();
|
||||
|
||||
// var query = visitResultList.GroupBy(t => new { t.VisitTaskId, t.VisitTaskNum, t.TaskName, t.TaskBlindName }).Select(g => new
|
||||
// {
|
||||
// VisitTaskId = g.Key.VisitTaskId,
|
||||
// VisitTaskNum = g.Key.VisitTaskNum,
|
||||
// TaskName = g.Key.TaskName,
|
||||
// TaskBlindName = g.Key.TaskBlindName,
|
||||
|
||||
// VisitQuestionAnswerList = g.OrderBy(t => t.ShowOrder).Select(u => new { u.QuestionName, u.Answer }).ToList(),
|
||||
|
||||
// GlobalQuestionAnswerList = g.OrderBy(t => t.ShowOrder).Select(u => new { u.QuestionName, Answer = globalResultList.Where(t => t.VisitTaskId == g.Key.VisitTaskId && t.QuestionId == u.ReadingQuestionTrialId).FirstOrDefault()?.Answer ?? String.Empty }).ToList(),
|
||||
|
||||
// Reason = globalResultList.Where(t => t.VisitTaskId == g.Key.VisitTaskId && t.QuestionId == null).FirstOrDefault()?.Answer ?? String.Empty
|
||||
// });
|
||||
|
||||
|
||||
// var result = query.ToList();
|
||||
|
||||
// obj = new { GlobalAnswerList = result };
|
||||
//}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
if (entity.SouceReadModuleId != null)
|
||||
{
|
||||
var subjectVisitId = await _dbContext.ReadModule.Where(x => x.Id == entity.SouceReadModuleId).Select(x => x.SubjectVisitId).FirstOrDefaultAsync();
|
||||
|
||||
obj.CutOffVisitName = await _dbContext.SubjectVisit.Where(x => x.Id == subjectVisitId).Select(x => x.BlindName).FirstOrDefaultAsync();
|
||||
|
||||
}
|
||||
|
||||
await InsertInspection<VisitTask>(entity, type, x => new InspectionConvertDTO()
|
||||
{
|
||||
VisitTaskId = x.Id,
|
||||
|
||||
IsDistinctionInterface = isDistinctionInterface,
|
||||
Reason = reason,
|
||||
ExtraIndentification = extraIdentification,
|
||||
|
||||
ObjectRelationParentId = entity.SourceSubjectVisitId != null ? entity.SourceSubjectVisitId : entity.SouceReadModuleId,
|
||||
|
||||
ObjectRelationParentId2 = entity.DoctorUserId,
|
||||
|
||||
ObjectRelationParentId3 = entity.TrialReadingCriterionId,
|
||||
|
||||
}, obj);
|
||||
}
|
||||
|
||||
#region Dicom 非Dicom 既往手术史..临床数据
|
||||
|
||||
// Dicom
|
||||
|
@ -3438,7 +3693,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
string questionName = string.Empty;
|
||||
string questionAnswer = string.Empty;
|
||||
if (thisQuestinonAnswer != null)
|
||||
if (thisQuestinonAnswer != null&& question!=null)
|
||||
{
|
||||
questionName = _userInfo.IsEn_Us ? question.QuestionEnName : question.QuestionName;
|
||||
questionAnswer = Translationunit(question.Type, question.Unit, question.CustomUnit, unitDataList, thisQuestinonAnswer.Answer);
|
||||
|
@ -3869,276 +4124,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
#endregion
|
||||
|
||||
|
||||
//任务
|
||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(VisitTask)))
|
||||
{
|
||||
var type = GetEntityAuditOpt(item);
|
||||
|
||||
var entity = item.Entity as VisitTask;
|
||||
var userRealName = await _dbContext.User.Where(x => x.Id == entity.DoctorUserId).Select(x => x.FullName).FirstOrDefaultAsync();
|
||||
VisitTaskAuditingDto obj = new VisitTaskAuditingDto()
|
||||
{
|
||||
UserRealName = userRealName,
|
||||
|
||||
};
|
||||
|
||||
string reason = string.Empty;
|
||||
var extraIdentification = string.Empty;
|
||||
var isDistinctionInterface = true;
|
||||
#region 标识区分
|
||||
|
||||
if (type == AuditOpt.Add)
|
||||
{
|
||||
isDistinctionInterface = false;
|
||||
|
||||
//生成一致性分析任务
|
||||
if (entity.IsSelfAnalysis == true)
|
||||
{
|
||||
extraIdentification = "/SelfAnalysis";
|
||||
}
|
||||
else if (entity.IsSelfAnalysis == false)
|
||||
{
|
||||
extraIdentification = "/GroupAnalysis";
|
||||
}
|
||||
else
|
||||
{
|
||||
extraIdentification = "/NotAnalysis";
|
||||
}
|
||||
|
||||
//区分任务类型
|
||||
extraIdentification = extraIdentification + "/" + (int)entity.ReadingCategory;
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
switch (_userInfo.RequestUrl)
|
||||
{
|
||||
//申请重阅
|
||||
case "VisitTask/applyReReading":
|
||||
|
||||
|
||||
extraIdentification = "/" + (int)entity.ReReadingApplyState;
|
||||
|
||||
break;
|
||||
|
||||
|
||||
//同意重阅
|
||||
case "VisitTask/ConfirmReReading":
|
||||
|
||||
|
||||
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM)
|
||||
{
|
||||
extraIdentification = "/" + 1;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
extraIdentification = "/" + 2;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "VisitTask/PMSetTaskBack":
|
||||
|
||||
if (entity.PMBackReason.IsNotNullOrEmpty())
|
||||
{
|
||||
extraIdentification = "/" + "Reason";
|
||||
reason = entity.PMBackReason;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "ReadingImageTask/SubmitVisitTaskQuestions":
|
||||
|
||||
//访视任务-- 非Dicom 阅片
|
||||
if (entity.ReadingTaskState != ReadingTaskState.HaveSigned)
|
||||
{
|
||||
//提交访视任务的时候 会多次更新同一个记录 只记录最后一次
|
||||
return;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
//Dicom 阅片 签名
|
||||
case "ReadingImageTask/SubmitDicomVisitTask":
|
||||
|
||||
//跳转阅片结果需要该参数
|
||||
var subjectCode = _dbContext.Subject.Where(t => t.Id == entity.SubjectId).Select(t => t.Code).First();
|
||||
|
||||
obj.SubjectCode = subjectCode;
|
||||
|
||||
break;
|
||||
|
||||
case "ReadingImageTask/resetReadingTask":
|
||||
//跳转阅片结果需要该参数
|
||||
|
||||
obj.IsReadingReset = true;
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
#region 裁判、肿瘤学、全局 都是通用的
|
||||
|
||||
//裁判任务 结果的保存 和签名提交
|
||||
if (entity.JudgeResultTaskId != null && (_userInfo.RequestUrl == "ReadingImageTask/SaveJudgeVisitTaskResult" || _userInfo.RequestUrl == "ReadingImageTask/SubmitJudgeVisitTaskResult"))
|
||||
{
|
||||
|
||||
var visitTaskNum = entity.VisitTaskNum - ReadingCommon.TaskNumDic[ReadingCategory.Judge];
|
||||
var list = await _dbContext.VisitTask.Where(t => t.TaskState == TaskState.Effect && t.SubjectId == entity.SubjectId && t.VisitTaskNum == visitTaskNum && t.JudgeVisitTaskId == entity.Id && t.TrialReadingCriterionId == entity.TrialReadingCriterionId).Select(t => new { t.Id, t.DoctorUser.FullName, t.ArmEnum }).OrderBy(t => t.ArmEnum).ToListAsync();
|
||||
|
||||
|
||||
var r1 = list.Where(t => t.ArmEnum == Arm.DoubleReadingArm1).FirstOrDefault();
|
||||
var r2 = list.Where(t => t.ArmEnum == Arm.DoubleReadingArm2).FirstOrDefault();
|
||||
|
||||
obj.R1 = r1.FullName;
|
||||
obj.R2 = r2.FullName;
|
||||
obj.SelectResult = r1.Id == entity.JudgeResultTaskId ? "R1" : "R2";
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
//增加进入阅片中的稽查
|
||||
|
||||
//重置阅片也会从待阅片 变为阅片中,因为复制病灶依赖这个改变
|
||||
if (obj.IsReadingReset != true)
|
||||
{
|
||||
if (entity.ReadingTaskState == ReadingTaskState.Reading)
|
||||
{
|
||||
if (_dbContext.VisitTask.Where(t => t.Id == entity.Id).Any(t => t.ReadingTaskState == ReadingTaskState.WaitReading))
|
||||
{
|
||||
isDistinctionInterface = false;
|
||||
extraIdentification = "/ChangeToReading";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (entity.IsReadClinicalData == true)
|
||||
{
|
||||
if (_dbContext.VisitTask.Where(t => t.Id == entity.Id).Any(t => t.IsReadClinicalData == false))
|
||||
{
|
||||
isDistinctionInterface = false;
|
||||
extraIdentification = "/ReadClinicalData";
|
||||
}
|
||||
}
|
||||
|
||||
if (entity.TaskBlindName.Contains("Timepoint Ran"))
|
||||
{
|
||||
if (_dbContext.VisitTask.Where(t => t.Id == entity.Id).Any(t => !t.TaskBlindName.Contains("Timepoint Ran")))
|
||||
{
|
||||
isDistinctionInterface = false;
|
||||
extraIdentification = "/TriggerSystemBlindingName";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#region 通过链接跳转 2022 12-19
|
||||
|
||||
////肿瘤学任务
|
||||
//if (entity.ReadingTaskState == ReadingTaskState.HaveSigned && _userInfo.RequestUrl == "ReadingImageTask/SubmitOncologyReadingInfo")
|
||||
//{
|
||||
|
||||
|
||||
// var oncologyAnswerList = await _dbContext.ReadingOncologyTaskInfo.Where(t => t.OncologyTaskId == entity.Id).Select(t => new { t.VisitTask.TaskBlindName, t.VisitTask.TaskName, t.EvaluationReason, t.EvaluationResult, t.VisitTask.VisitTaskNum, VisitTaskId = t.VisitTask.Id }).ToListAsync();
|
||||
|
||||
// var golbalTaskInfo = await _dbContext.VisitTask.Where(t => t.SubjectId == entity.SubjectId && t.ReadingCategory == ReadingCategory.Global && t.TaskState == TaskState.Effect && t.IsAnalysisCreate == entity.IsAnalysisCreate && t.VisitTaskNum == (entity.VisitTaskNum - ReadingCommon.TaskNumDic[ReadingCategory.Oncology] + ReadingCommon.TaskNumDic[ReadingCategory.Global])).Select(t => new { GlobalTaskId = t.Id }).FirstNotNullAsync();
|
||||
|
||||
|
||||
// var globalResultList = await _dbContext.ReadingGlobalTaskInfo.Where(t => t.GlobalTaskId == golbalTaskInfo.GlobalTaskId).ToListAsync();
|
||||
|
||||
// var modifyVisitList = globalResultList
|
||||
// .GroupBy(t => t.TaskId).Select(g => new
|
||||
// {
|
||||
// VisitTaskId = g.Key,
|
||||
// GlobalResult = g.Select(c => new { c.Answer, c.QuestionId })
|
||||
// }).ToList();
|
||||
|
||||
// var query = from answer in oncologyAnswerList
|
||||
// join modifyVisit in modifyVisitList on answer.VisitTaskId equals modifyVisit.VisitTaskId into cc
|
||||
// from modifyVisit in cc.DefaultIfEmpty()
|
||||
// select new
|
||||
// {
|
||||
// answer.TaskBlindName,
|
||||
// answer.TaskName,
|
||||
// answer.EvaluationReason,
|
||||
// answer.EvaluationResult,
|
||||
// IsGlobalModify = modifyVisit != null,
|
||||
// Reason = modifyVisit != null ? modifyVisit.GlobalResult.Where(t => t.QuestionId == null).FirstOrDefault()?.Answer : String.Empty
|
||||
// };
|
||||
|
||||
// var result = query.ToList();
|
||||
|
||||
// obj = new { OncologyAnswerList = result };
|
||||
//}
|
||||
|
||||
////全局任务
|
||||
//if (entity.ReadingTaskState == ReadingTaskState.HaveSigned && _userInfo.RequestUrl == "ReadingImageTask/SubmitGlobalReadingInfo")
|
||||
//{
|
||||
|
||||
// var globalResultList = await _dbContext.ReadingGlobalTaskInfo.Where(t => t.GlobalTaskId == entity.Id).Select(t => new { VisitTaskId = t.TaskId, t.QuestionId, t.Answer, t.VisitTask.TaskBlindName, t.VisitTask.TaskName, t.TrialReadingQuestion.QuestionName }).ToListAsync();
|
||||
|
||||
// var visitTaskIdList = globalResultList.Select(t => t.VisitTaskId).ToList();
|
||||
|
||||
// var visitResultList = await _dbContext.ReadingTaskQuestionAnswer.Where(t => visitTaskIdList.Contains(t.VisitTaskId) && t.ReadingQuestionTrial.IsJudgeQuestion).Select(t => new { t.VisitTaskId, t.VisitTask.TaskBlindName, t.VisitTask.TaskName, t.VisitTask.VisitTaskNum, t.ReadingQuestionTrial.QuestionName, t.ReadingQuestionTrial.ShowOrder, t.Answer, t.ReadingQuestionTrialId })
|
||||
// .OrderBy(t => t.VisitTaskNum).ToListAsync();
|
||||
|
||||
// var query = visitResultList.GroupBy(t => new { t.VisitTaskId, t.VisitTaskNum, t.TaskName, t.TaskBlindName }).Select(g => new
|
||||
// {
|
||||
// VisitTaskId = g.Key.VisitTaskId,
|
||||
// VisitTaskNum = g.Key.VisitTaskNum,
|
||||
// TaskName = g.Key.TaskName,
|
||||
// TaskBlindName = g.Key.TaskBlindName,
|
||||
|
||||
// VisitQuestionAnswerList = g.OrderBy(t => t.ShowOrder).Select(u => new { u.QuestionName, u.Answer }).ToList(),
|
||||
|
||||
// GlobalQuestionAnswerList = g.OrderBy(t => t.ShowOrder).Select(u => new { u.QuestionName, Answer = globalResultList.Where(t => t.VisitTaskId == g.Key.VisitTaskId && t.QuestionId == u.ReadingQuestionTrialId).FirstOrDefault()?.Answer ?? String.Empty }).ToList(),
|
||||
|
||||
// Reason = globalResultList.Where(t => t.VisitTaskId == g.Key.VisitTaskId && t.QuestionId == null).FirstOrDefault()?.Answer ?? String.Empty
|
||||
// });
|
||||
|
||||
|
||||
// var result = query.ToList();
|
||||
|
||||
// obj = new { GlobalAnswerList = result };
|
||||
//}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
if (entity.SouceReadModuleId != null)
|
||||
{
|
||||
var subjectVisitId = await _dbContext.ReadModule.Where(x => x.Id == entity.SouceReadModuleId).Select(x => x.SubjectVisitId).FirstOrDefaultAsync();
|
||||
|
||||
obj.CutOffVisitName = await _dbContext.SubjectVisit.Where(x => x.Id == subjectVisitId).Select(x => x.BlindName).FirstOrDefaultAsync();
|
||||
|
||||
}
|
||||
|
||||
await InsertInspection<VisitTask>(entity, type, x => new InspectionConvertDTO()
|
||||
{
|
||||
VisitTaskId = x.Id,
|
||||
|
||||
IsDistinctionInterface = isDistinctionInterface,
|
||||
Reason = reason,
|
||||
ExtraIndentification = extraIdentification,
|
||||
|
||||
ObjectRelationParentId = entity.SourceSubjectVisitId != null ? entity.SourceSubjectVisitId : entity.SouceReadModuleId,
|
||||
|
||||
ObjectRelationParentId2 = entity.DoctorUserId,
|
||||
|
||||
ObjectRelationParentId3 = entity.TrialReadingCriterionId,
|
||||
|
||||
}, obj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue