融合修改
parent
552e7a430d
commit
9eabd9031b
|
@ -1771,6 +1771,13 @@
|
||||||
<param name="inDto"></param>
|
<param name="inDto"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.LuganoCalculateService.CalculateMergeTargetLesionStatus(IRaCIS.Core.Application.ViewModel.CalculateTargetLesionStatusInDto)">
|
||||||
|
<summary>
|
||||||
|
计算融合靶病灶的状态
|
||||||
|
</summary>
|
||||||
|
<param name="inDto"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.LuganoCalculateService.CalculateTargetLesionStatus(IRaCIS.Core.Application.ViewModel.CalculateTargetLesionStatusInDto)">
|
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.LuganoCalculateService.CalculateTargetLesionStatus(IRaCIS.Core.Application.ViewModel.CalculateTargetLesionStatusInDto)">
|
||||||
<summary>
|
<summary>
|
||||||
计算靶病灶状态
|
计算靶病灶状态
|
||||||
|
|
|
@ -1435,7 +1435,7 @@ namespace IRaCIS.Application.Services
|
||||||
QuestionMark.MajorAxis,
|
QuestionMark.MajorAxis,
|
||||||
QuestionMark.ShortAxis,
|
QuestionMark.ShortAxis,
|
||||||
QuestionMark.State,
|
QuestionMark.State,
|
||||||
|
QuestionMark.PPD,
|
||||||
};
|
};
|
||||||
|
|
||||||
tableAnswers.ForEach(x =>
|
tableAnswers.ForEach(x =>
|
||||||
|
@ -1468,6 +1468,7 @@ namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
await VerifyTaskIsSign(inDto.VisitTaskId);
|
await VerifyTaskIsSign(inDto.VisitTaskId);
|
||||||
await this.VerifyIsBaseLineTask(inDto.VisitTaskId);
|
await this.VerifyIsBaseLineTask(inDto.VisitTaskId);
|
||||||
|
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.MergeMainRowId).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
|
||||||
var mergeRow = await _readingTableAnswerRowInfoRepository.Where(x => x.Id == inDto.MergeMainRowId).Include(x => x.ReadingQuestionTrial).FirstNotNullAsync();
|
var mergeRow = await _readingTableAnswerRowInfoRepository.Where(x => x.Id == inDto.MergeMainRowId).Include(x => x.ReadingQuestionTrial).FirstNotNullAsync();
|
||||||
|
|
||||||
var mark = mergeRow.ReadingQuestionTrial.OrderMark + mergeRow.RowIndex.GetLesionMark();
|
var mark = mergeRow.ReadingQuestionTrial.OrderMark + mergeRow.RowIndex.GetLesionMark();
|
||||||
|
@ -1496,6 +1497,19 @@ namespace IRaCIS.Application.Services
|
||||||
VisitTaskId = inDto.VisitTaskId,
|
VisitTaskId = inDto.VisitTaskId,
|
||||||
ComputationTrigger = ComputationTrigger.Lesion,
|
ComputationTrigger = ComputationTrigger.Lesion,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 保存完了计算疾病进展
|
||||||
|
switch (taskinfo.TrialReadingCriterion.CriterionType)
|
||||||
|
{
|
||||||
|
case CriterionType.Lugano2014:
|
||||||
|
await _luganoCalculateService.CalculateMergeTargetLesionStatus(new CalculateTargetLesionStatusInDto()
|
||||||
|
{
|
||||||
|
QuestionId = inDto.QuestionId,
|
||||||
|
VisitTaskId = inDto.VisitTaskId,
|
||||||
|
RowNumber = mergeRow.RowIndex,
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1863,7 +1877,7 @@ namespace IRaCIS.Application.Services
|
||||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_Idnotcorrespond"]);
|
throw new BusinessValidationFailedException(_localizer["ReadingImage_Idnotcorrespond"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
|
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.TrialReadingCriterion).Include(x => x.SourceSubjectVisit).FirstNotNullAsync();
|
||||||
inDto.BlindName = taskinfo.TaskBlindName;
|
inDto.BlindName = taskinfo.TaskBlindName;
|
||||||
switch (taskinfo.TrialReadingCriterion.CriterionType)
|
switch (taskinfo.TrialReadingCriterion.CriterionType)
|
||||||
{
|
{
|
||||||
|
@ -1993,9 +2007,9 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
var targetlymphQuestion = targetTablequestionList.Where(x => x.QuestionMark == QuestionMark.IsLymph).FirstOrDefault();
|
var targetlymphQuestion = targetTablequestionList.Where(x => x.QuestionMark == QuestionMark.IsLymph).FirstOrDefault();
|
||||||
|
|
||||||
// 判断是否存在淋巴结问题
|
// 判断是否存在淋巴结问题
|
||||||
if (targetlymphQuestion != null)
|
if (targetlymphQuestion != null && taskinfo.SourceSubjectVisit.VisitNum == 0)
|
||||||
{
|
{
|
||||||
// 判断是否为淋巴结
|
// 判断是否为淋巴结
|
||||||
if (inDto.QuestionId == targetTablequestionList[0].ReadingQuestionId && inDto.AnswerList.Any(x => x.TableQuestionId == targetlymphQuestion.Id && x.Answer.EqEnum(ReadingYesOrNo.No)))
|
if (inDto.QuestionId == targetTablequestionList[0].ReadingQuestionId && inDto.AnswerList.Any(x => x.TableQuestionId == targetlymphQuestion.Id && x.Answer.EqEnum(ReadingYesOrNo.No)))
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,5 +15,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate.Interface
|
||||||
/// <param name="inDto"></param>
|
/// <param name="inDto"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task CalculateTargetLesionStatus(CalculateTargetLesionStatusInDto inDto);
|
Task CalculateTargetLesionStatus(CalculateTargetLesionStatusInDto inDto);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 计算靶病灶融合后状态
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task CalculateMergeTargetLesionStatus(CalculateTargetLesionStatusInDto inDto);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -869,11 +869,117 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 计算靶病灶状态
|
/// 计算融合靶病灶的状态
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="inDto"></param>
|
/// <param name="inDto"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task CalculateTargetLesionStatus(CalculateTargetLesionStatusInDto inDto)
|
public async Task CalculateMergeTargetLesionStatus(CalculateTargetLesionStatusInDto inDto)
|
||||||
|
{
|
||||||
|
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
|
||||||
|
|
||||||
|
// 找到靶病灶问题
|
||||||
|
var targetQuestion = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskInfo.TrialReadingCriterionId && x.LesionType == LesionType.TargetLesion).FirstOrDefaultAsync();
|
||||||
|
if (targetQuestion != null)
|
||||||
|
{
|
||||||
|
// 找到状态问题
|
||||||
|
var stateQuestion = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == targetQuestion.Id && x.QuestionMark == QuestionMark.State).FirstOrDefaultAsync();
|
||||||
|
if (stateQuestion != null)
|
||||||
|
{
|
||||||
|
|
||||||
|
// 找到主病灶的状态
|
||||||
|
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 =>
|
||||||
|
x.VisitTaskId == inDto.VisitTaskId &&
|
||||||
|
x.RowIndex == (int)Math.Floor(inDto.RowNumber) &&
|
||||||
|
x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.MajorAxis &&
|
||||||
|
x.QuestionId == targetQuestion.Id
|
||||||
|
).Select(x => x.Answer).FirstOrDefaultAsync()).IsNullOrEmptyReturn0();
|
||||||
|
|
||||||
|
// 短径
|
||||||
|
var shortAxis = (await _readingTableQuestionAnswerRepository.Where(x =>
|
||||||
|
x.VisitTaskId == inDto.VisitTaskId &&
|
||||||
|
x.RowIndex == (int)Math.Floor(inDto.RowNumber) &&
|
||||||
|
x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.ShortAxis &&
|
||||||
|
x.QuestionId == targetQuestion.Id
|
||||||
|
).Select(x => x.Answer).FirstOrDefaultAsync()).IsNullOrEmptyReturn0();
|
||||||
|
|
||||||
|
// 找到ppd问题
|
||||||
|
var ppdQuestion = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == targetQuestion.Id && x.QuestionMark == QuestionMark.PPD).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
if (ppdQuestion != null)
|
||||||
|
{
|
||||||
|
var pPdAnswer = (await _readingTableQuestionAnswerRepository.Where(x =>
|
||||||
|
x.VisitTaskId == inDto.VisitTaskId &&
|
||||||
|
x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.PPD &&
|
||||||
|
x.QuestionId == targetQuestion.Id &&
|
||||||
|
x.RowIndex == inDto.RowNumber
|
||||||
|
).Select(x => x.Answer).FirstOrDefaultAsync()).IsNullOrEmptyReturn0();
|
||||||
|
|
||||||
|
|
||||||
|
// 是否符合疾病进展
|
||||||
|
var accord = false;
|
||||||
|
|
||||||
|
var lowPPDInfo = await GetLowPPDInfo(new GetPPDInfoInDto()
|
||||||
|
{
|
||||||
|
RowIndex = (int)Math.Floor(inDto.RowNumber),
|
||||||
|
VisitTaskId = inDto.VisitTaskId,
|
||||||
|
QuestionId = inDto.QuestionId,
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
if (lowPPDInfo.NadirPPD != 0)
|
||||||
|
{
|
||||||
|
//当前融合靶病灶LDi>15 mm &&
|
||||||
|
//(当前融合靶病灶的ppd-最低点PPD)/最低点PPD ≥50 %
|
||||||
|
|
||||||
|
if (majorAxis >= 15 &&
|
||||||
|
(pPdAnswer - lowPPDInfo.NadirPPD) * 100 / lowPPDInfo.NadirPPD >= 50
|
||||||
|
{
|
||||||
|
accord = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 符合疾病进展
|
||||||
|
if (accord)
|
||||||
|
{
|
||||||
|
await _readingTableQuestionAnswerRepository.UpdatePartialFromQueryAsync(x =>
|
||||||
|
x.VisitTaskId == inDto.VisitTaskId &&
|
||||||
|
x.RowIndex == inDto.RowNumber &&
|
||||||
|
x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State &&
|
||||||
|
x.QuestionId == targetQuestion.Id, x => new ReadingTableQuestionAnswer()
|
||||||
|
{
|
||||||
|
Answer = TargetState.DiseaseProgression.GetEnumInt()
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else if (state == TargetState.DiseaseProgression.GetEnumInt())
|
||||||
|
{
|
||||||
|
await _readingTableQuestionAnswerRepository.UpdatePartialFromQueryAsync(x =>
|
||||||
|
x.VisitTaskId == inDto.VisitTaskId &&
|
||||||
|
x.RowIndex == inDto.RowNumber &&
|
||||||
|
x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State &&
|
||||||
|
x.QuestionId == targetQuestion.Id, x => new ReadingTableQuestionAnswer()
|
||||||
|
{
|
||||||
|
Answer = TargetState.Exist.GetEnumInt()
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 计算靶病灶状态
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task CalculateTargetLesionStatus(CalculateTargetLesionStatusInDto inDto)
|
||||||
{
|
{
|
||||||
if (inDto.RowNumber % 1 != 0)
|
if (inDto.RowNumber % 1 != 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue