diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs index 96f7ed5df..39db472cf 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs @@ -109,7 +109,11 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var visitTaskInfo = await _visitTaskRepository.Where(x => x.Id == indto.VisitTaskId).FirstNotNullAsync(); - result.ReadingTaskState = visitTaskInfo.ReadingTaskState; + + var isConvertTask= await _visitTaskRepository.Where(x => x.Id == indto.VisitTaskId).Select(x=>x.IsConvertedTask).FirstNotNullAsync(); + + + result.ReadingTaskState = visitTaskInfo.ReadingTaskState; var taskInfoList = await _generalCalculateService.GetReadingReportTaskList(indto.VisitTaskId); result.VisitTaskList = taskInfoList; @@ -117,7 +121,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var visitTaskIds = taskInfoList.Select(x => x.VisitTaskId).ToList(); var criterionId = visitTaskInfo.TrialReadingCriterionId; - var questionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == criterionId&&x.ShowQuestion!= ShowQuestion.Hide).ToListAsync(); + var questionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == criterionId&&x.ShowQuestion!= ShowQuestion.Hide) + .WhereIf(isConvertTask,x=>x.ConvertShowType==ConvertShowType.All||x.ConvertShowType==ConvertShowType.AfterShow) + .WhereIf(!isConvertTask, x => x.ConvertShowType == ConvertShowType.All || x.ConvertShowType == ConvertShowType.BeforeShow) + .ToListAsync(); var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.TrialCriterionId == criterionId).OrderBy(x => x.ShowOrder).ToListAsync(); var tableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == indto.VisitTaskId).ProjectTo(_mapper.ConfigurationProvider).ToListAsync();