Merge branch 'Test_IRC_Net8' of http://192.168.3.68:2000/XCKJ/irc-netcore-api into Test_IRC_Net8
commit
e5b5cbb8d8
|
@ -1186,6 +1186,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
{
|
{
|
||||||
var dbSubjectVisitList = await _subjectVisitRepository.Where(t => cRCRequestToQCCommand.SubjectVisitIds.Contains(t.Id), true).ProjectTo<QCCRCVisitViewModel>(_mapper.ConfigurationProvider).ToListAsync();
|
var dbSubjectVisitList = await _subjectVisitRepository.Where(t => cRCRequestToQCCommand.SubjectVisitIds.Contains(t.Id), true).ProjectTo<QCCRCVisitViewModel>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
|
|
||||||
|
var trialinfo = await _trialRepository.Where(x => x.Id == dbSubjectVisitList[0].TrialId).FirstNotNullAsync();
|
||||||
//普通提交
|
//普通提交
|
||||||
if (dbSubjectVisitList.Count == 1)
|
if (dbSubjectVisitList.Count == 1)
|
||||||
{
|
{
|
||||||
|
@ -1213,8 +1214,9 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
}
|
}
|
||||||
|
|
||||||
//同时要根据项目有没有配置Subject 级别临床数据
|
//同时要根据项目有没有配置Subject 级别临床数据
|
||||||
if (dbSubjectVisitList.Any(t => t.IsBaseLine && !t.IsHaveClinicalData))
|
if (dbSubjectVisitList.Any(t => t.IsBaseLine && !t.IsHaveClinicalData)&&trialinfo.ClinicalInformationTransmissionEnum!=0)
|
||||||
{
|
{
|
||||||
|
|
||||||
//---基线没有临床数据,确认提交?
|
//---基线没有临床数据,确认提交?
|
||||||
return ResponseOutput.NotOk(_localizer["QCOperation_NoBaselineData"], 0, ApiResponseCodeEnum.NeedTips);
|
return ResponseOutput.NotOk(_localizer["QCOperation_NoBaselineData"], 0, ApiResponseCodeEnum.NeedTips);
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,7 +92,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
}
|
}
|
||||||
return new
|
return new
|
||||||
{
|
{
|
||||||
BaseLinePET5PS= baseLinePET5PS,
|
BaseLinePET5PS = baseLinePET5PS,
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -169,7 +169,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
var answers = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
var answers = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
||||||
var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
|
||||||
|
|
||||||
var globalanswerList = await _readingGlobalTaskInfoRepository.Where(x => visitTaskIds.Contains(x.TaskId)&&x.GlobalVisitTask.TaskState== TaskState.Effect&&x.Answer!=string.Empty).Select(x => new
|
var globalanswerList = await _readingGlobalTaskInfoRepository.Where(x => visitTaskIds.Contains(x.TaskId) && x.GlobalVisitTask.TaskState == TaskState.Effect && x.Answer != string.Empty).Select(x => new
|
||||||
{
|
{
|
||||||
x.TaskId,
|
x.TaskId,
|
||||||
x.GlobalVisitTask.VisitTaskNum,
|
x.GlobalVisitTask.VisitTaskNum,
|
||||||
|
@ -411,7 +411,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
var maxSuv = await GetSuvMax(readingData);
|
var maxSuv = await GetSuvMax(readingData);
|
||||||
var rowInfo = readingData.QuestionInfo.SelectMany(x => x.TableRowInfoList).ToList();
|
var rowInfo = readingData.QuestionInfo.SelectMany(x => x.TableRowInfoList).ToList();
|
||||||
var tableQuestions = rowInfo.SelectMany(x => x.TableQuestionList).Where(x=>x.RowId==inDto.RowId).ToList();
|
var tableQuestions = rowInfo.SelectMany(x => x.TableQuestionList).Where(x => x.RowId == inDto.RowId).ToList();
|
||||||
|
|
||||||
var lesionMaxSuv = tableQuestions.Where(x => x.QuestionMark == QuestionMark.SUVmax).Select(x => x.Answer.IsNullOrEmptyReturn0()).MaxOrDefault();
|
var lesionMaxSuv = tableQuestions.Where(x => x.QuestionMark == QuestionMark.SUVmax).Select(x => x.Answer.IsNullOrEmptyReturn0()).MaxOrDefault();
|
||||||
|
|
||||||
|
@ -611,19 +611,22 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.LiverAssessment,GetStringFun=GetLiverAssessment,ComputationTriggerList=new List<ComputationTrigger>(){ ComputationTrigger.InitialCalculation, ComputationTrigger.LiverStatus,}},
|
new ReadingCalculateData (){QuestionType=QuestionType.LiverAssessment,GetStringFun=GetLiverAssessment,ComputationTriggerList=new List<ComputationTrigger>(){ ComputationTrigger.InitialCalculation, ComputationTrigger.LiverStatus,}},
|
||||||
|
|
||||||
// 骨髓中是否存在局灶性 FDG亲和病灶的证据
|
// 骨髓中是否存在局灶性 FDG亲和病灶的证据
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.EvidenceFocalFDG,GetStringFun=GetEvidenceFocalFDG,ComputationTriggerList=new List<ComputationTrigger>(){ }},
|
new ReadingCalculateData (){QuestionType=QuestionType.EvidenceFocalFDG,GetStringFun=GetEvidenceFocalFDG,ComputationTriggerList=new List<ComputationTrigger>(){ ComputationTrigger.ImageQuality, }},
|
||||||
|
|
||||||
//CT/MRI
|
//CT/MRI
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.CTandMRI,GetStringFun=CTMRIEvaluation,ComputationTriggerList=new List<ComputationTrigger>(){ ComputationTrigger.InitialCalculation, ComputationTrigger.LiverStatus,ComputationTrigger.SplenicApexPosition,ComputationTrigger.PositionSpleenFloor,ComputationTrigger.SplenicEvaluation,ComputationTrigger.CTSave,ComputationTrigger.MergeSave,ComputationTrigger.RemoveLesion,ComputationTrigger.MergeLesion,}},
|
new ReadingCalculateData (){QuestionType=QuestionType.CTandMRI,GetStringFun=CTMRIEvaluation,ComputationTriggerList=new List<ComputationTrigger>(){ ComputationTrigger.InitialCalculation, ComputationTrigger.LiverStatus,ComputationTrigger.SplenicApexPosition,ComputationTrigger.PositionSpleenFloor,ComputationTrigger.SplenicEvaluation,ComputationTrigger.CTSave,ComputationTrigger.MergeSave,ComputationTrigger.RemoveLesion,ComputationTrigger.MergeLesion,}},
|
||||||
|
|
||||||
|
//SUVmax
|
||||||
|
new ReadingCalculateData (){QuestionType=QuestionType.SUVmax,GetDecimalNullFun=GetSuvMax,ComputationTriggerList=new List<ComputationTrigger>(){ ComputationTrigger.MergeSave,ComputationTrigger.RemoveLesion,}},
|
||||||
|
|
||||||
// PET 5PS评分
|
// PET 5PS评分
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.PET5PS,GetStringFun=GetPET5PS,ComputationTriggerList=new List<ComputationTrigger>(){ ComputationTrigger.ImageQuality, ComputationTrigger.LiverBloodPool,ComputationTrigger.MediastinalPool,ComputationTrigger.MergeSave,ComputationTrigger.RemoveLesion,} },
|
new ReadingCalculateData (){QuestionType=QuestionType.PET5PS,GetStringFun=GetPET5PS,ComputationTriggerList=new List<ComputationTrigger>(){ ComputationTrigger.InitialCalculation, ComputationTrigger.ImageQuality, ComputationTrigger.LiverBloodPool,ComputationTrigger.MediastinalPool,ComputationTrigger.MergeSave,ComputationTrigger.RemoveLesion,}},
|
||||||
|
|
||||||
// 修改PET 5PS评分备注
|
// 修改PET 5PS评分备注
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.PSScoreRemarks,GetStringFun=GetPET5PSRemark,ComputationTriggerList=new List<ComputationTrigger>(){ ComputationTrigger.LiverBloodPool,ComputationTrigger.MediastinalPool,ComputationTrigger.MergeSave,ComputationTrigger.RemoveLesion,}},
|
new ReadingCalculateData (){QuestionType=QuestionType.PSScoreRemarks,GetStringFun=GetPET5PSRemark,ComputationTriggerList=new List<ComputationTrigger>(){ ComputationTrigger.LiverBloodPool,ComputationTrigger.MediastinalPool,ComputationTrigger.MergeSave,ComputationTrigger.RemoveLesion,}},
|
||||||
|
|
||||||
//与基线相比摄取值变化
|
//与基线相比摄取值变化
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.UptakeChange,GetStringFun=GetUptakeChange,ComputationTriggerList=new List<ComputationTrigger>(){ ComputationTrigger.LiverBloodPool,ComputationTrigger.MediastinalPool,ComputationTrigger.MergeSave,ComputationTrigger.RemoveLesion,}},
|
new ReadingCalculateData (){QuestionType=QuestionType.UptakeChange,GetStringFun=GetUptakeChange,ComputationTriggerList=new List<ComputationTrigger>(){ ComputationTrigger.InitialCalculation, ComputationTrigger.ImageQuality, ComputationTrigger.LiverBloodPool,ComputationTrigger.MediastinalPool,ComputationTrigger.MergeSave,ComputationTrigger.RemoveLesion,}},
|
||||||
|
|
||||||
// FDG-PET 评估结果
|
// FDG-PET 评估结果
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.FDGPET,GetStringFun=GetFDGPETOverallAssessment,ComputationTriggerList=new List<ComputationTrigger>(){ ComputationTrigger.InitialCalculation, ComputationTrigger.ImageQuality, ComputationTrigger.LiverBloodPool,ComputationTrigger.MediastinalPool,ComputationTrigger.MergeSave,ComputationTrigger.RemoveLesion,ComputationTrigger.PDGPET,}},
|
new ReadingCalculateData (){QuestionType=QuestionType.FDGPET,GetStringFun=GetFDGPETOverallAssessment,ComputationTriggerList=new List<ComputationTrigger>(){ ComputationTrigger.InitialCalculation, ComputationTrigger.ImageQuality, ComputationTrigger.LiverBloodPool,ComputationTrigger.MediastinalPool,ComputationTrigger.MergeSave,ComputationTrigger.RemoveLesion,ComputationTrigger.PDGPET,}},
|
||||||
|
@ -634,8 +637,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
// 影像学整体肿瘤评估
|
// 影像学整体肿瘤评估
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.ImgOncology,GetStringFun=GetImgOncology,ComputationTriggerList=new List<ComputationTrigger>(){ ComputationTrigger.InitialCalculation, ComputationTrigger.LiverStatus,ComputationTrigger.SplenicApexPosition,ComputationTrigger.PositionSpleenFloor,ComputationTrigger.SplenicEvaluation,ComputationTrigger.LiverBloodPool,ComputationTrigger.MediastinalPool,ComputationTrigger.CTSave,ComputationTrigger.MergeSave,ComputationTrigger.RemoveLesion,ComputationTrigger.PDGPET,ComputationTrigger.MergeLesion,}},
|
new ReadingCalculateData (){QuestionType=QuestionType.ImgOncology,GetStringFun=GetImgOncology,ComputationTriggerList=new List<ComputationTrigger>(){ ComputationTrigger.InitialCalculation, ComputationTrigger.LiverStatus,ComputationTrigger.SplenicApexPosition,ComputationTrigger.PositionSpleenFloor,ComputationTrigger.SplenicEvaluation,ComputationTrigger.LiverBloodPool,ComputationTrigger.MediastinalPool,ComputationTrigger.CTSave,ComputationTrigger.MergeSave,ComputationTrigger.RemoveLesion,ComputationTrigger.PDGPET,ComputationTrigger.MergeLesion,}},
|
||||||
|
|
||||||
//SUVmax
|
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.SUVmax,GetDecimalNullFun=GetSuvMax,ComputationTriggerList=new List<ComputationTrigger>(){ ComputationTrigger.MergeSave,ComputationTrigger.RemoveLesion,}},
|
|
||||||
|
|
||||||
// SUVmax所在病灶
|
// SUVmax所在病灶
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.SUVmaxLesion,GetStringFun=GetSuvMaxFocus,ComputationTriggerList=new List<ComputationTrigger>(){ ComputationTrigger.MergeSave,ComputationTrigger.RemoveLesion,}},
|
new ReadingCalculateData (){QuestionType=QuestionType.SUVmaxLesion,GetStringFun=GetSuvMaxFocus,ComputationTriggerList=new List<ComputationTrigger>(){ ComputationTrigger.MergeSave,ComputationTrigger.RemoveLesion,}},
|
||||||
|
@ -729,7 +731,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
calculateList = calculateList.Where(x =>x.ComputationTriggerList.Contains(inDto.ComputationTrigger)).ToList();
|
calculateList = calculateList.Where(x => x.ComputationTriggerList.Contains(inDto.ComputationTrigger)).ToList();
|
||||||
var typeNAList = new List<QuestionType>
|
var typeNAList = new List<QuestionType>
|
||||||
{
|
{
|
||||||
QuestionType.SODChange,
|
QuestionType.SODChange,
|
||||||
|
@ -916,7 +918,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
|
|
||||||
var unableEvaluateRowIds = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId &&
|
var unableEvaluateRowIds = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId &&
|
||||||
(x.Answer == TargetState.UnableEvaluate.GetEnumInt()|| x.Answer == TargetState.Loss.GetEnumInt())
|
(x.Answer == TargetState.UnableEvaluate.GetEnumInt() || x.Answer == TargetState.Loss.GetEnumInt())
|
||||||
&& x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State
|
&& x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State
|
||||||
)
|
)
|
||||||
.Select(x => x.RowId).Distinct().ToListAsync();
|
.Select(x => x.RowId).Distinct().ToListAsync();
|
||||||
|
@ -1108,7 +1110,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
// 找到靶病灶问题
|
// 找到靶病灶问题
|
||||||
var targetQuestion = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskInfo.TrialReadingCriterionId && x.LesionType == LesionType.TargetLesion).FirstOrDefaultAsync();
|
var targetQuestion = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskInfo.TrialReadingCriterionId && x.LesionType == LesionType.TargetLesion).FirstOrDefaultAsync();
|
||||||
if(targetQuestion!=null)
|
if (targetQuestion != null)
|
||||||
{
|
{
|
||||||
// 找到状态问题
|
// 找到状态问题
|
||||||
var stateQuestion = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == targetQuestion.Id && x.QuestionMark == QuestionMark.State).FirstOrDefaultAsync();
|
var stateQuestion = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == targetQuestion.Id && x.QuestionMark == QuestionMark.State).FirstOrDefaultAsync();
|
||||||
|
@ -1116,14 +1118,14 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
{
|
{
|
||||||
|
|
||||||
// 找到主病灶的状态
|
// 找到主病灶的状态
|
||||||
var state =await _readingTableQuestionAnswerRepository.Where(x=>x.VisitTaskId==inDto.VisitTaskId&&x.RowIndex== (int)Math.Floor(inDto.RowNumber)&&x.TableQuestionId== stateQuestion.Id).Select(x=>x.Answer).FirstOrDefaultAsync();
|
var state = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.RowIndex == (int)Math.Floor(inDto.RowNumber) && x.TableQuestionId == stateQuestion.Id).Select(x => x.Answer).FirstOrDefaultAsync();
|
||||||
|
|
||||||
// 长径
|
// 长径
|
||||||
var majorAxis = (await _readingTableQuestionAnswerRepository.Where(x =>
|
var majorAxis = (await _readingTableQuestionAnswerRepository.Where(x =>
|
||||||
x.VisitTaskId == inDto.VisitTaskId &&
|
x.VisitTaskId == inDto.VisitTaskId &&
|
||||||
x.RowIndex >= (int)Math.Floor(inDto.RowNumber) && x.RowIndex < ((int)Math.Floor(inDto.RowNumber) + 1) &&
|
x.RowIndex >= (int)Math.Floor(inDto.RowNumber) && x.RowIndex < ((int)Math.Floor(inDto.RowNumber) + 1) &&
|
||||||
x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.MajorAxis &&
|
x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.MajorAxis &&
|
||||||
x.QuestionId== targetQuestion.Id
|
x.QuestionId == targetQuestion.Id
|
||||||
).Select(x => x.Answer).ToListAsync()).Select(x => x.IsNullOrEmptyReturn0()).Sum();
|
).Select(x => x.Answer).ToListAsync()).Select(x => x.IsNullOrEmptyReturn0()).Sum();
|
||||||
|
|
||||||
// 短径
|
// 短径
|
||||||
|
@ -1137,9 +1139,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
// 找到ppd问题
|
// 找到ppd问题
|
||||||
var ppdQuestion = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == targetQuestion.Id && x.QuestionMark == QuestionMark.PPD).FirstOrDefaultAsync();
|
var ppdQuestion = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == targetQuestion.Id && x.QuestionMark == QuestionMark.PPD).FirstOrDefaultAsync();
|
||||||
|
|
||||||
if(ppdQuestion!=null)
|
if (ppdQuestion != null)
|
||||||
{
|
{
|
||||||
var ppdAnswerList= await _readingTableQuestionAnswerRepository.Where(x =>
|
var ppdAnswerList = await _readingTableQuestionAnswerRepository.Where(x =>
|
||||||
x.VisitTaskId == inDto.VisitTaskId &&
|
x.VisitTaskId == inDto.VisitTaskId &&
|
||||||
x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.PPD &&
|
x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.PPD &&
|
||||||
x.QuestionId == targetQuestion.Id &&
|
x.QuestionId == targetQuestion.Id &&
|
||||||
|
@ -1178,7 +1180,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
//相比最低点PPD增加百分比 ≥50%
|
//相比最低点PPD增加百分比 ≥50%
|
||||||
// (相比PPD最低点LDi增加值 ≥10 mm
|
// (相比PPD最低点LDi增加值 ≥10 mm
|
||||||
// 或者相比PPD最低点SDi增加值Sdi ≥10 mm)
|
// 或者相比PPD最低点SDi增加值Sdi ≥10 mm)
|
||||||
if ( majorAxis > 20 &&
|
if (majorAxis > 20 &&
|
||||||
(allPPd - lowPPDInfo.NadirPPD) * 100 / lowPPDInfo.NadirPPD >= 50 &&
|
(allPPd - lowPPDInfo.NadirPPD) * 100 / lowPPDInfo.NadirPPD >= 50 &&
|
||||||
(majorAxis - lowPPDInfo.LowPPDLDi >= 10 ||
|
(majorAxis - lowPPDInfo.LowPPDLDi >= 10 ||
|
||||||
shortAxis - lowPPDInfo.LowPPDSDi >= 10)
|
shortAxis - lowPPDInfo.LowPPDSDi >= 10)
|
||||||
|
@ -1266,7 +1268,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
{
|
{
|
||||||
RowId = answerList.Where(x => x.RowIndex == i).Select(x => x.RowId).FirstOrDefault(),
|
RowId = answerList.Where(x => x.RowIndex == i).Select(x => x.RowId).FirstOrDefault(),
|
||||||
RowIndex = answerList.Where(x => x.RowIndex == i).Select(x => x.RowIndex).FirstOrDefault().ToString(),
|
RowIndex = answerList.Where(x => x.RowIndex == i).Select(x => x.RowIndex).FirstOrDefault().ToString(),
|
||||||
AllPPD = answerList.Where(x=>x.QuestionMark== QuestionMark.PPD).Where(x => x.RowIndex > i && x.RowIndex < (i + 1)).Sum(x => x.Answer),
|
AllPPD = answerList.Where(x => x.QuestionMark == QuestionMark.PPD).Where(x => x.RowIndex > i && x.RowIndex < (i + 1)).Sum(x => x.Answer),
|
||||||
AllLDi = answerList.Where(x => x.QuestionMark == QuestionMark.MajorAxis).Where(x => x.RowIndex > i && x.RowIndex < (i + 1)).Sum(x => x.Answer),
|
AllLDi = answerList.Where(x => x.QuestionMark == QuestionMark.MajorAxis).Where(x => x.RowIndex > i && x.RowIndex < (i + 1)).Sum(x => x.Answer),
|
||||||
AllSDi = answerList.Where(x => x.QuestionMark == QuestionMark.ShortAxis).Where(x => x.RowIndex > i && x.RowIndex < (i + 1)).Sum(x => x.Answer),
|
AllSDi = answerList.Where(x => x.QuestionMark == QuestionMark.ShortAxis).Where(x => x.RowIndex > i && x.RowIndex < (i + 1)).Sum(x => x.Answer),
|
||||||
});
|
});
|
||||||
|
@ -1324,7 +1326,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
TrialId = x.TrialId
|
TrialId = x.TrialId
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
var tableRowAnswers = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == LastVisitTaskId).OrderBy(x=>x.RowIndex).ProjectTo<CopyTableAnswerRowInfo>(_mapper.ConfigurationProvider).ToListAsync();
|
var tableRowAnswers = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == LastVisitTaskId).OrderBy(x => x.RowIndex).ProjectTo<CopyTableAnswerRowInfo>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
tableRowAnswers.ForEach(x =>
|
tableRowAnswers.ForEach(x =>
|
||||||
|
@ -1381,15 +1383,15 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
var rowIndexList = copyTableAnswers.Select(x => x.RowIndex).Distinct().ToList();
|
var rowIndexList = copyTableAnswers.Select(x => x.RowIndex).Distinct().ToList();
|
||||||
// 找到靶病灶问题Id
|
// 找到靶病灶问题Id
|
||||||
var questionId=await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId && x.LesionType == LesionType.TargetLesion).Select(x => x.Id).FirstNotNullAsync();
|
var questionId = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId && x.LesionType == LesionType.TargetLesion).Select(x => x.Id).FirstNotNullAsync();
|
||||||
|
|
||||||
foreach (var item in rowIndexList)
|
foreach (var item in rowIndexList)
|
||||||
{
|
{
|
||||||
var lowPPD =await this.GetLowPPDInfo(new GetPPDInfoInDto() {
|
var lowPPD = await this.GetLowPPDInfo(new GetPPDInfoInDto() {
|
||||||
|
|
||||||
VisitTaskId= visitTaskId,
|
VisitTaskId = visitTaskId,
|
||||||
QuestionId= questionId,
|
QuestionId = questionId,
|
||||||
RowIndex=item
|
RowIndex = item
|
||||||
});
|
});
|
||||||
|
|
||||||
copyTableAnswers.Where(x => x.RowIndex == item).ForEach(x =>
|
copyTableAnswers.Where(x => x.RowIndex == item).ForEach(x =>
|
||||||
|
@ -1399,7 +1401,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
switch (x.QuestionMark)
|
switch (x.QuestionMark)
|
||||||
{
|
{
|
||||||
case QuestionMark.LowPPDLDi:
|
case QuestionMark.LowPPDLDi:
|
||||||
x.Answer = lowPPD.LowPPDLDi==null?string.Empty: lowPPD.LowPPDLDi.Value.ToString();
|
x.Answer = lowPPD.LowPPDLDi == null ? string.Empty : lowPPD.LowPPDLDi.Value.ToString();
|
||||||
break;
|
break;
|
||||||
case QuestionMark.LowPPDSDi:
|
case QuestionMark.LowPPDSDi:
|
||||||
x.Answer = lowPPD.LowPPDSDi == null ? string.Empty : lowPPD.LowPPDSDi.Value.ToString();
|
x.Answer = lowPPD.LowPPDSDi == null ? string.Empty : lowPPD.LowPPDSDi.Value.ToString();
|
||||||
|
@ -1445,11 +1447,11 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
var questionMarkList = await _readingTaskQuestionMarkRepository.Where(x => x.VisitTaskId == LastVisitTaskId).Select(x => new ReadingTaskQuestionMark()
|
var questionMarkList = await _readingTaskQuestionMarkRepository.Where(x => x.VisitTaskId == LastVisitTaskId).Select(x => new ReadingTaskQuestionMark()
|
||||||
{
|
{
|
||||||
VisitTaskId= visitTaskId,
|
VisitTaskId = visitTaskId,
|
||||||
FirstAddTaskId=x.FirstAddTaskId,
|
FirstAddTaskId = x.FirstAddTaskId,
|
||||||
QuestionId=x.QuestionId,
|
QuestionId = x.QuestionId,
|
||||||
QuestionType=x.QuestionType,
|
QuestionType = x.QuestionType,
|
||||||
OrderMarkName=x.OrderMarkName,
|
OrderMarkName = x.OrderMarkName,
|
||||||
|
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
questionMarkList.ForEach(x => {
|
questionMarkList.ForEach(x => {
|
||||||
|
@ -2108,7 +2110,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
// 脾底答案
|
// 脾底答案
|
||||||
var splenicBottomAnswer = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SplenicBottomPosition).Select(x => x.Answer).FirstOrDefault();
|
var splenicBottomAnswer = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SplenicBottomPosition).Select(x => x.Answer).FirstOrDefault();
|
||||||
|
|
||||||
decimal? spleenLength=null;
|
decimal? spleenLength = null;
|
||||||
if (splenicTopAnswer != null && splenicBottomAnswer != null)
|
if (splenicTopAnswer != null && splenicBottomAnswer != null)
|
||||||
{
|
{
|
||||||
spleenLength = splenicTopAnswer.IsNullOrEmptyReturn0() - splenicBottomAnswer.IsNullOrEmptyReturn0();
|
spleenLength = splenicTopAnswer.IsNullOrEmptyReturn0() - splenicBottomAnswer.IsNullOrEmptyReturn0();
|
||||||
|
@ -2142,7 +2144,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
var presentSpd = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SPD).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
|
var presentSpd = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SPD).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
|
||||||
if (baseLineSpd != 0)
|
if (baseLineSpd != 0)
|
||||||
{
|
{
|
||||||
return ReserveDecimal((presentSpd - baseLineSpd)*100 / baseLineSpd,inDto.DigitPlaces);
|
return ReserveDecimal((presentSpd - baseLineSpd) * 100 / baseLineSpd, inDto.DigitPlaces);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2169,9 +2171,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
var baseLineSpleenLength = await GetBaseLineSpleenLength(inDto);
|
var baseLineSpleenLength = await GetBaseLineSpleenLength(inDto);
|
||||||
|
|
||||||
var presentSpleenLength = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SpleenLength).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
|
var presentSpleenLength = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SpleenLength).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
|
||||||
if (baseLineSpleenLength - 130 > 0&& presentSpleenLength>130)
|
if (baseLineSpleenLength - 130 > 0 && presentSpleenLength > 130)
|
||||||
{
|
{
|
||||||
return ReserveDecimal((presentSpleenLength - 130 - (baseLineSpleenLength - 130))*100 / (baseLineSpleenLength - 130), inDto.DigitPlaces);
|
return ReserveDecimal((presentSpleenLength - 130 - (baseLineSpleenLength - 130)) * 100 / (baseLineSpleenLength - 130), inDto.DigitPlaces);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2242,7 +2244,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
/// <param name="spleenLength"></param>
|
/// <param name="spleenLength"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<string> GetSplenicState(Guid visitTaskId,decimal spleenLength)
|
public async Task<string> GetSplenicState(Guid visitTaskId, decimal spleenLength)
|
||||||
{
|
{
|
||||||
|
|
||||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).FirstNotNullAsync();
|
var taskinfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).FirstNotNullAsync();
|
||||||
|
@ -2297,7 +2299,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
//2、与基线相比脾垂直径变化值≥10 mm
|
//2、与基线相比脾垂直径变化值≥10 mm
|
||||||
// 当前垂直径>130 mm
|
// 当前垂直径>130 mm
|
||||||
//与基线相比脾肿大增加的百分比 > 50%
|
//与基线相比脾肿大增加的百分比 > 50%
|
||||||
if (baseLineSpleenLength > 130 && differenceValue >= 10 && spleenLength>130 && getPercentage() > 50)
|
if (baseLineSpleenLength > 130 && differenceValue >= 10 && spleenLength > 130 && getPercentage() > 50)
|
||||||
{
|
{
|
||||||
result = SpleenAssessment.Increase;
|
result = SpleenAssessment.Increase;
|
||||||
}
|
}
|
||||||
|
@ -2388,7 +2390,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
var baseLineTaskId = await GetBaseLineTaskId(inDto);
|
var baseLineTaskId = await GetBaseLineTaskId(inDto);
|
||||||
|
|
||||||
// 最低垂直经
|
// 最低垂直经
|
||||||
var lowSpleenLength= await this.GetLowSpleenLength(taskinfo);
|
var lowSpleenLength = await this.GetLowSpleenLength(taskinfo);
|
||||||
|
|
||||||
// 基线状态
|
// 基线状态
|
||||||
var baseLineState = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == baseLineTaskId && x.ReadingQuestionTrial.QuestionType == QuestionType.SplenicStatus).Select(x => x.Answer).FirstOrDefaultAsync();
|
var baseLineState = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == baseLineTaskId && x.ReadingQuestionTrial.QuestionType == QuestionType.SplenicStatus).Select(x => x.Answer).FirstOrDefaultAsync();
|
||||||
|
@ -2413,7 +2415,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<string> GetSplenicStatus(ReadingCalculateDto inDto)
|
public async Task<string> GetSplenicStatus(ReadingCalculateDto inDto)
|
||||||
{
|
{
|
||||||
var spleenLength= inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SpleenLength).Select(x => x.Answer).FirstOrDefault();
|
var spleenLength = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SpleenLength).Select(x => x.Answer).FirstOrDefault();
|
||||||
if (spleenLength == string.Empty)
|
if (spleenLength == string.Empty)
|
||||||
{
|
{
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
|
@ -2521,9 +2523,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果不是保存肝脏血池和纵隔血池
|
|
||||||
if (inDto.ComputationTrigger != ComputationTrigger.LiverBloodPool && inDto.ComputationTrigger != ComputationTrigger.MediastinalPool)
|
|
||||||
{
|
|
||||||
// 先在数据库查这几个值
|
// 先在数据库查这几个值
|
||||||
List<QuestionType?> needSearchTypes = new List<QuestionType?>()
|
List<QuestionType?> needSearchTypes = new List<QuestionType?>()
|
||||||
{
|
{
|
||||||
|
@ -2535,18 +2535,18 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
{
|
{
|
||||||
x.Answer,
|
x.Answer,
|
||||||
x.ReadingQuestionTrial.QuestionType
|
x.ReadingQuestionTrial.QuestionType
|
||||||
}).ToListAsync(); ;
|
}).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
// 数据库中最大SUVmax
|
// 数据库中最大SUVmax
|
||||||
var dataBaseSUVmax = dataBaseDataList.Where(x => x.QuestionType == QuestionType.SUVmax).Select(x => x.Answer).FirstIsNullReturnEmpty();
|
var dataBaseSUVmax = dataBaseDataList.Where(x => x.QuestionType == QuestionType.SUVmax).Select(x => x.Answer).FirstIsNullReturnEmpty();
|
||||||
|
|
||||||
// 如果SUVmax没变 就不重新计算
|
// 如果不是保存肝脏血池和纵隔血池
|
||||||
if (dataBaseSUVmax == (await GetSuvMax(inDto)).ToString())
|
if (inDto.ComputationTrigger != ComputationTrigger.LiverBloodPool && inDto.ComputationTrigger != ComputationTrigger.MediastinalPool&& dataBaseSUVmax == (await GetSuvMax(inDto)).ToString())
|
||||||
{
|
{
|
||||||
return dataBaseDataList.Where(x => x.QuestionType == QuestionType.PET5PS).Select(x => x.Answer).FirstIsNullReturnEmpty();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
return dataBaseDataList.Where(x => x.QuestionType == QuestionType.PET5PS).Select(x => x.Answer).FirstIsNullReturnEmpty();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2557,7 +2557,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
// return SpleenAssessment.Stabilization.GetEnumInt();
|
// return SpleenAssessment.Stabilization.GetEnumInt();
|
||||||
//}
|
//}
|
||||||
|
|
||||||
if (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.ExistPET && x.Answer == ReadingYesOrNo.No.GetEnumInt()))
|
else if (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.ExistPET && x.Answer == ReadingYesOrNo.No.GetEnumInt()))
|
||||||
{
|
{
|
||||||
return PET5PSScore.NE.GetEnumInt();
|
return PET5PSScore.NE.GetEnumInt();
|
||||||
}
|
}
|
||||||
|
@ -2588,7 +2588,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
}
|
}
|
||||||
|
|
||||||
// 本访视病灶的 max SUVmax(所有病灶中最大的)> 2 * 肝脏血池SUVmax
|
// 本访视病灶的 max SUVmax(所有病灶中最大的)> 2 * 肝脏血池SUVmax
|
||||||
else if (maxSUVmax >2* LiverSUVmax&& LiverSUVmax != 0m)
|
else if (maxSUVmax > 2 * LiverSUVmax && LiverSUVmax != 0m)
|
||||||
{
|
{
|
||||||
result = PET5PSScore.Five;
|
result = PET5PSScore.Five;
|
||||||
}
|
}
|
||||||
|
@ -2598,12 +2598,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
result = PET5PSScore.Four;
|
result = PET5PSScore.Four;
|
||||||
}
|
}
|
||||||
//纵隔血池SUVmax<本访视点病灶的max SUVmax(所有病灶中最大的)≤1*肝脏血池SUVmax
|
//纵隔血池SUVmax<本访视点病灶的max SUVmax(所有病灶中最大的)≤1*肝脏血池SUVmax
|
||||||
else if (MediastinumSUVmax < maxSUVmax&& maxSUVmax <= LiverSUVmax&& MediastinumSUVmax != 0)
|
else if (MediastinumSUVmax < maxSUVmax && maxSUVmax <= LiverSUVmax && MediastinumSUVmax != 0)
|
||||||
{
|
{
|
||||||
result = PET5PSScore.Three;
|
result = PET5PSScore.Three;
|
||||||
}
|
}
|
||||||
//本访视点病灶的SUVmax(所有病灶中最大的)<纵隔血池SUVmax
|
//本访视点病灶的SUVmax(所有病灶中最大的)<=纵隔血池SUVmax
|
||||||
else if (maxSUVmax < MediastinumSUVmax && maxSUVmax != 0)
|
else if (maxSUVmax <= MediastinumSUVmax && maxSUVmax != 0)
|
||||||
{
|
{
|
||||||
result = PET5PSScore.Two;
|
result = PET5PSScore.Two;
|
||||||
}
|
}
|
||||||
|
@ -2666,6 +2666,20 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<string> GetUptakeChange(ReadingCalculateDto inDto)
|
public async Task<string> GetUptakeChange(ReadingCalculateDto inDto)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (await ImageQualityIsUnableFuse(inDto))
|
||||||
|
{
|
||||||
|
if (inDto.IsBaseLine)
|
||||||
|
{
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return SUVChangeVSBaseline.NotEvaluable.GetEnumInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//PET5ps评分改变时,才计算
|
//PET5ps评分改变时,才计算
|
||||||
|
|
||||||
List<QuestionType?> needSearchTypes = new List<QuestionType?>()
|
List<QuestionType?> needSearchTypes = new List<QuestionType?>()
|
||||||
|
@ -2758,8 +2772,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
var lastTaskId = await GetLastVisitTaskId(inDto);
|
var lastTaskId = await GetLastVisitTaskId(inDto);
|
||||||
|
|
||||||
|
|
||||||
var answer =await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == lastTaskId).Include(x => x.ReadingQuestionTrial).Where(x => x.ReadingQuestionTrial.QuestionType == QuestionType.FDGPET).Select(x => x.Answer).FirstOrDefaultAsync();
|
var answer = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == lastTaskId).Include(x => x.ReadingQuestionTrial).Where(x => x.ReadingQuestionTrial.QuestionType == QuestionType.FDGPET).Select(x => x.Answer).FirstOrDefaultAsync();
|
||||||
return answer?? string.Empty;
|
return answer ?? string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region FDG-PET总体评估结果
|
#region FDG-PET总体评估结果
|
||||||
|
@ -2797,7 +2811,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (notExistPET)
|
if (notExistPET || (await ImageQualityIsUnableFuse(inDto)))
|
||||||
{
|
{
|
||||||
return FDGPETOverallAssessment.NE.GetEnumInt();
|
return FDGPETOverallAssessment.NE.GetEnumInt();
|
||||||
}
|
}
|
||||||
|
@ -2825,7 +2839,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
/// <param name="uptakeChange"> 与基线相比摄取值变化</param>
|
/// <param name="uptakeChange"> 与基线相比摄取值变化</param>
|
||||||
/// <param name="evidenceFocalFDG">骨髓中是否存在局灶性 FDG亲和病灶的证据</param>
|
/// <param name="evidenceFocalFDG">骨髓中是否存在局灶性 FDG亲和病灶的证据</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public string CalculationFDGPETOverallAssessment(string? pET5PS, string uptakeChange,string? evidenceFocalFDG)
|
public string CalculationFDGPETOverallAssessment(string? pET5PS, string uptakeChange, string? evidenceFocalFDG)
|
||||||
{
|
{
|
||||||
List<CalculationDto> data = new List<CalculationDto>() {
|
List<CalculationDto> data = new List<CalculationDto>() {
|
||||||
|
|
||||||
|
@ -2906,6 +2920,19 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<string> GetEvidenceFocalFDG(ReadingCalculateDto inDto)
|
public async Task<string> GetEvidenceFocalFDG(ReadingCalculateDto inDto)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (await ImageQualityIsUnableFuse(inDto))
|
||||||
|
{
|
||||||
|
if (inDto.IsBaseLine)
|
||||||
|
{
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return FDGAffinityFociInBM.NE.GetEnumInt();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.ExistPET && x.Answer == ReadingYesOrNo.No.GetEnumInt()))
|
if (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.ExistPET && x.Answer == ReadingYesOrNo.No.GetEnumInt()))
|
||||||
{
|
{
|
||||||
return FDGAffinityFociInBM.NE.GetEnumInt();
|
return FDGAffinityFociInBM.NE.GetEnumInt();
|
||||||
|
|
Loading…
Reference in New Issue