Compare commits
No commits in common. "e559c2503b5aa51c8ea49931daa75bee7aba339a" and "9b6ddb0f1634e4e25a6ca0dbb42e909f27fe5bcb" have entirely different histories.
e559c2503b
...
9b6ddb0f16
|
|
@ -170,7 +170,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var dictionList = await _dictionaryRepository.Where(x => x.Parent.Code == "Liver4Segmentation").OrderBy(x => x.ShowOrder).ToListAsync();
|
var dictionList = await _dictionaryRepository.Where(x => x.Parent.Code == "LiverSegmentation").OrderBy(x => x.ShowOrder).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
var tableQuestion = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId && x.LesionType == LesionType.FatFraction).FirstNotNullAsync();
|
var tableQuestion = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId && x.LesionType == LesionType.FatFraction).FirstNotNullAsync();
|
||||||
|
|
@ -297,7 +297,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
public async Task ReadingCalculate(ReadingCalculateDto inDto, List<QuestionType>? calculateType = null)
|
public async Task ReadingCalculate(ReadingCalculateDto inDto, List<QuestionType>? calculateType = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
//await this.CalculateAvg(inDto);
|
await this.CalculateAvg(inDto);
|
||||||
inDto = await _generalCalculateService.GetReadingCalculateDto(inDto.VisitTaskId);
|
inDto = await _generalCalculateService.GetReadingCalculateDto(inDto.VisitTaskId);
|
||||||
var needAddList = new List<ReadingTaskQuestionAnswer>();
|
var needAddList = new List<ReadingTaskQuestionAnswer>();
|
||||||
List<ReadingCalculateData> calculateList = new List<ReadingCalculateData>()
|
List<ReadingCalculateData> calculateList = new List<ReadingCalculateData>()
|
||||||
|
|
@ -456,54 +456,54 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
/// 计算平均值
|
/// 计算平均值
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
//public async Task CalculateAvg(ReadingCalculateDto inDto)
|
public async Task CalculateAvg(ReadingCalculateDto inDto)
|
||||||
//{
|
{
|
||||||
// // 脂肪分数的表格问题Id
|
// 脂肪分数的表格问题Id
|
||||||
// var questionInfo = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.FatFraction).FirstOrDefault();
|
var questionInfo = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.FatFraction).FirstOrDefault();
|
||||||
|
|
||||||
// List<ReadingTableQuestionAnswer> tableAnswers = new List<ReadingTableQuestionAnswer>();
|
List<ReadingTableQuestionAnswer> tableAnswers = new List<ReadingTableQuestionAnswer>();
|
||||||
|
|
||||||
|
|
||||||
// foreach (var item in questionInfo.TableRowInfoList)
|
foreach (var item in questionInfo.TableRowInfoList)
|
||||||
// {
|
{
|
||||||
// var avg = item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.AverageValue).FirstOrDefault();
|
var avg = item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.AverageValue).FirstOrDefault();
|
||||||
// var avgAnswer = string.Empty;
|
var avgAnswer = string.Empty;
|
||||||
// List<QuestionMark?> questionMarks = new List<QuestionMark?>()
|
List<QuestionMark?> questionMarks = new List<QuestionMark?>()
|
||||||
// {
|
{
|
||||||
// QuestionMark.FirstMeasurement,
|
QuestionMark.FirstMeasurement,
|
||||||
// QuestionMark.SecondMeasurement,
|
QuestionMark.SecondMeasurement,
|
||||||
// QuestionMark.ThirdMeasurement,
|
QuestionMark.ThirdMeasurement,
|
||||||
// QuestionMark.FourthMeasurement,
|
QuestionMark.FourthMeasurement,
|
||||||
// };
|
};
|
||||||
// var answers = item.TableQuestionList.Where(x => questionMarks.Contains(x.QuestionMark)).Select(x=>x.Answer).ToList();
|
var answers = item.TableQuestionList.Where(x => questionMarks.Contains(x.QuestionMark)).Select(x=>x.Answer).ToList();
|
||||||
// if (answers.Count() == 4 && !answers.Any(x => x.IsNullOrEmpty()))
|
if (answers.Count() == 4 && !answers.Any(x => x.IsNullOrEmpty()))
|
||||||
// {
|
{
|
||||||
// var avgAnswernum= answers.Select(x=>x.IsNullOrEmptyReturn0()).Average(x=>x);
|
var avgAnswernum= answers.Select(x=>x.IsNullOrEmptyReturn0()).Average(x=>x);
|
||||||
// avgAnswer = decimal.Round(avgAnswernum, inDto.DigitPlaces, MidpointRounding.AwayFromZero).ToString("F" + inDto.DigitPlaces.ToString());
|
avgAnswer = decimal.Round(avgAnswernum, inDto.DigitPlaces, MidpointRounding.AwayFromZero).ToString("F" + inDto.DigitPlaces.ToString());
|
||||||
// }
|
}
|
||||||
// if(item.TableQuestionList.Where(x => x.QuestionMark== QuestionMark.IsMeasurable).Select(x => x.Answer).FirstOrDefault().EqEnum(YesOrNoOrNa.No))
|
if(item.TableQuestionList.Where(x => x.QuestionMark== QuestionMark.IsMeasurable).Select(x => x.Answer).FirstOrDefault().EqEnum(YesOrNoOrNa.No))
|
||||||
// {
|
{
|
||||||
// avgAnswer = "NE";
|
avgAnswer = "NE";
|
||||||
// }
|
}
|
||||||
// tableAnswers.Add(new ReadingTableQuestionAnswer()
|
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||||
// {
|
{
|
||||||
// Answer = avgAnswer,
|
Answer = avgAnswer,
|
||||||
// VisitTaskId = inDto.VisitTaskId,
|
VisitTaskId = inDto.VisitTaskId,
|
||||||
// QuestionId = avg.QuestionId,
|
QuestionId = avg.QuestionId,
|
||||||
// TableQuestionId = avg.TableQuestionId,
|
TableQuestionId = avg.TableQuestionId,
|
||||||
// TrialId = inDto.TrialId,
|
TrialId = inDto.TrialId,
|
||||||
// RowIndex = avg.RowIndex,
|
RowIndex = avg.RowIndex,
|
||||||
// RowId = avg.RowId,
|
RowId = avg.RowId,
|
||||||
|
|
||||||
// });
|
});
|
||||||
|
|
||||||
// await _readingTableQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId && x.RowId == item.RowId && x.TableQuestionId == avg.TableQuestionId);
|
await _readingTableQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId && x.RowId == item.RowId && x.TableQuestionId == avg.TableQuestionId);
|
||||||
// }
|
}
|
||||||
|
|
||||||
// await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers);
|
await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers);
|
||||||
// await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
||||||
|
|
||||||
//}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -523,12 +523,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
var rowInfo = readingData.QuestionInfo.Where(x => x.LesionType == LesionType.FatFraction)
|
var rowInfo = readingData.QuestionInfo.Where(x => x.LesionType == LesionType.FatFraction)
|
||||||
.SelectMany(x => x.TableRowInfoList).ToList();
|
.SelectMany(x => x.TableRowInfoList).ToList();
|
||||||
|
|
||||||
//var tableQuestionList = rowInfo.Where(x => x.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.AverageValue && x.Answer.IsNotNullOrEmpty())).ToList();
|
var tableQuestionList = rowInfo.Where(x => x.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.AverageValue && x.Answer.IsNotNullOrEmpty())).ToList();
|
||||||
|
|
||||||
//if (tableQuestionList.Count() != 4)
|
if (tableQuestionList.Count() != 8)
|
||||||
//{
|
{
|
||||||
// throw new BusinessValidationFailedException(_localizer["MRIPDFF_AllNeedToBeMark"]);
|
throw new BusinessValidationFailedException(_localizer["MRIPDFF_AllNeedToBeMark"]);
|
||||||
//}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue