Compare commits

..

No commits in common. "abe77916a374e9e5e2ef7732fd38231a5e58f87e" and "8dec77f30a1bb82f467126d07893ea652c05e3d1" have entirely different histories.

2 changed files with 16 additions and 45 deletions

View File

@ -22,17 +22,9 @@ namespace IRaCIS.Core.Application.ViewModel
} }
public class GetSplitPPdOutDto public class GetSplitPPdInDto
{
public Guid RowId { get; set; }
public decimal AllPPD { get; set; }
}
public class GetSplitPPdInDto
{ {
public Guid RowId { get; set; }
public Guid VisitTaskId { get; set; }
} }
public class ReadingTaskQuestionAnswerDto : ReadingTaskQuestionAnswer public class ReadingTaskQuestionAnswerDto : ReadingTaskQuestionAnswer

View File

@ -997,48 +997,27 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
} }
} }
/// <summary> /// <summary>
/// 获取分裂病灶的PPd之和 不包括当前的主病灶 /// 获取分裂病灶的PPd之和 不包括当前的主病灶
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public async Task<List<GetSplitPPdOutDto>> GetSplitPPdSum(GetSplitPPdInDto inDto) public async Task<decimal> GetSplitPPdSum(GetSplitPPdInDto inDto)
{ {
List<GetSplitPPdOutDto> result = new List<GetSplitPPdOutDto>(); var rowinfo = await _readingTableAnswerRowInfoRepository.Where(x => x.Id == inDto.RowId).FirstNotNullAsync();
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 ppdAnswerList = await _readingTableQuestionAnswerRepository.Where(x =>
{ x.VisitTaskId == rowinfo.VisitTaskId &&
var ppdAnswerList = await _readingTableQuestionAnswerRepository.Where(x => x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.PPD &&
x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == rowinfo.QuestionId &&
x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.PPD && x.RowIndex > (int)Math.Floor(rowinfo.RowIndex) && x.RowIndex < ((int)Math.Floor(rowinfo.RowIndex) + 1)
x.QuestionId == targetQuestion.Id) ).Select(x => x.Answer).ToListAsync();
.Select(x => new {
x.RowId, var allPPd = ppdAnswerList.Select(x => x.IsNullOrEmptyReturn0()).Sum();
x.RowIndex,
x.Answer return allPPd;
}).ToListAsync();
var answerList = ppdAnswerList.Select(x => new {
x.RowId,
x.RowIndex,
Answer = x.Answer.IsNullOrEmptyReturn0()
}).ToList();
var maxRowIndex = answerList.Max(x => x.RowIndex);
for (int i = 1; i < maxRowIndex; i++)
{
result.Add(new GetSplitPPdOutDto()
{
RowId = answerList.Where(x => x.RowIndex == i).Select(x => x.RowId).FirstOrDefault(),
AllPPD = answerList.Where(x => x.RowIndex > i && x.RowIndex < (i + 1)).Sum(x => x.Answer),
});
}
}
return result;
} }
#region 将上一次的访视病灶添加到这一次 #region 将上一次的访视病灶添加到这一次