diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs index ecae583f5..99c64d051 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs @@ -86,10 +86,13 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public string Type { get; set; } - + /// + /// 问题标识 + /// public QuestionMark? QuestionMark { get; set; } + /// /// 类型值 /// diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs index 3930f94df..1c55daca4 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs @@ -24,6 +24,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate private readonly IRepository _readingTableQuestionTrialRepository; private readonly IRepository _readingTableAnswerRowInfoRepository; private readonly IRepository _readingQuestionTrialRepository; + private readonly IRepository _organInfoRepository; private readonly IRepository _subjectVisitRepository; private readonly IRepository _tumorAssessmentRepository; private readonly IGeneralCalculateService _generalCalculateService; @@ -36,6 +37,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate IRepository readingTableQuestionTrialRepository, IRepository readingTableAnswerRowInfoRepository, IRepository readingQuestionTrialRepository, + IRepository organInfoRepository, IRepository subjectVisitRepository, IRepository tumorAssessmentRepository, IGeneralCalculateService generalCalculateService, @@ -48,6 +50,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate this._readingTableQuestionTrialRepository = readingTableQuestionTrialRepository; this._readingTableAnswerRowInfoRepository = readingTableAnswerRowInfoRepository; this._readingQuestionTrialRepository = readingQuestionTrialRepository; + this._organInfoRepository = organInfoRepository; this._subjectVisitRepository = subjectVisitRepository; this._tumorAssessmentRepository = tumorAssessmentRepository; this._generalCalculateService = generalCalculateService; @@ -96,7 +99,6 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var visitTaskInfo = await _visitTaskRepository.Where(x => x.Id == indto.VisitTaskId).FirstNotNullAsync(); - result.ReadingTaskState = visitTaskInfo.ReadingTaskState; var taskInfoList = await _generalCalculateService.GetReadingReportTaskList(indto.VisitTaskId); @@ -112,6 +114,16 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var answers = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); + var alltableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); + + var organIds = alltableAnsweRowInfos.Where(x => x.OrganInfoId != null).Select(x => x.OrganInfoId).Distinct().ToList(); + var organInfos = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync(); + + var needChangeType = new List() { + QuestionMark.Organ, + QuestionMark.Location, + QuestionMark.Part, + }; // 第一级 @@ -189,6 +201,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate SplitOrMergeLesionName = x.MergeName.IsNullOrEmpty() ? x.SplitName : x.MergeName, SplitOrMergeType = x.SplitOrMergeType, LesionType = question.LesionType, + IsCanEditPosition = x.IsCanEditPosition, RowIndex = x.RowIndex, BlindName = x.BlindName, @@ -224,13 +237,83 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { foreach (var task in taskInfoList) { - - tableQuestion.Answer.Add(new TaskQuestionAnswer() + var rowinfo = alltableAnsweRowInfos.Where(x => x.VisitTaskId == task.VisitTaskId && x.QuestionId == tableQuestion.QuestionId && x.RowIndex == tableQuestion.RowIndex).FirstOrDefault(); + var taskQuestionAnswer = new TaskQuestionAnswer() { Answer = tableAnswers.Where(x => x.VisitTaskId == task.VisitTaskId && x.QuestionId == tableQuestion.QuestionId && x.RowIndex == tableQuestion.RowIndex && x.TableQuestionId == tableQuestion.TableQuestionId).Select(x => x.Answer).FirstIsNullReturnEmpty(), TaskName = task.TaskName, VisitTaskId = task.VisitTaskId, - }); + }; + if (rowinfo != null && rowinfo.OrganInfoId != null) + { + var organInfo = organInfos.Where(x => x.Id == rowinfo.OrganInfoId).FirstOrDefault(); + + + if (organInfo != null && needChangeType.Contains(tableQuestion.QuestionMark)) + { + if (_userInfo.IsEn_Us) + { + switch (tableQuestion.QuestionMark) + { + case QuestionMark.Organ: + taskQuestionAnswer.Answer= organInfo.TULOCEN; + + break; + case QuestionMark.Location: + if (organInfo.IsCanEditPosition) + { + + } + else + { + taskQuestionAnswer.Answer = organInfo.TULATEN; + + } + break; + case QuestionMark.Part: + + taskQuestionAnswer.Answer = organInfo.PartEN; + + break; + + } + + } + else + { + switch (tableQuestion.QuestionMark) + { + case QuestionMark.Organ: + taskQuestionAnswer.Answer = organInfo.TULOC; + break; + case QuestionMark.Location: + if (organInfo.IsCanEditPosition) + { + + } + else + { + taskQuestionAnswer.Answer = organInfo.TULAT; + + } + break; + case QuestionMark.Part: + taskQuestionAnswer.Answer = organInfo.Part; + break; + + } + } + + } + } + + + + + + + + tableQuestion.Answer.Add(taskQuestionAnswer); } }