diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs index 59c6f1b4..d87c3a91 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs @@ -829,6 +829,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public GlobalAnswerType GlobalAnswerType { get; set; } + + /// + /// 是否是裁判问题 + /// + public bool IsJudgeQuestion { get; set; } = true; } public class GetReadingImgOutDto diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs index 1cde4150..96c80775 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs @@ -111,7 +111,8 @@ namespace IRaCIS.Application.Services VisitNum = x.SourceSubjectVisit.VisitNum, IsBaseLine=x.SourceSubjectVisit.IsBaseLine, VisitId = x.SourceSubjectVisitId.Value, - BeforeQuestionList = x.ReadingTaskQuestionAnswerList.Where(y => y.ReadingQuestionTrial.IsJudgeQuestion).OrderBy(y => y.ReadingQuestionTrial.ShowOrder) + + BeforeQuestionList = x.ReadingTaskQuestionAnswerList.Where(y => y.ReadingQuestionTrial.GlobalReadingShowType!=GlobalReadingShowType.NotShow).OrderBy(y => y.ReadingQuestionTrial.ShowOrder) .Select(y => new GlobalQuestionInfo() { QuestionId = y.ReadingQuestionTrialId, @@ -121,11 +122,11 @@ namespace IRaCIS.Application.Services QuestionGenre = y.ReadingQuestionTrial.QuestionGenre, DictionaryCode = y.ReadingQuestionTrial.DictionaryCode, GlobalReadingShowType=y.ReadingQuestionTrial.GlobalReadingShowType, - AnswerCombination = y.ReadingQuestionTrial.AnswerCombination, JudgeType = y.ReadingQuestionTrial.JudgeType, Type = y.ReadingQuestionTrial.Type, TypeValue = y.ReadingQuestionTrial.TypeValue, + IsJudgeQuestion=y.ReadingQuestionTrial.IsJudgeQuestion, Answer = y.Answer }).ToList() }).ToListAsync(); @@ -144,7 +145,6 @@ namespace IRaCIS.Application.Services { Answer = lr.global == null || lr.global.Count() == 0 ? (inDto.UsingOriginalData ? lr.question.Answer : string.Empty) : - (lr.global.Select(x => x.Answer).FirstOrDefault().IsNullOrEmpty() && inDto.UsingOriginalData ? lr.question.Answer : lr.global.Select(x => x.Answer).FirstOrDefault() ), @@ -159,6 +159,7 @@ namespace IRaCIS.Application.Services GlobalAnswerType = GlobalAnswerType.Question, AnswerGroup = lr.question.AnswerGroup, AnswerCombination = lr.question.AnswerCombination, + IsJudgeQuestion=lr.question.IsJudgeQuestion, JudgeType = lr.question.JudgeType, TypeValue = lr.question.TypeValue, diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index 22320367..d0afe992 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -884,10 +884,9 @@ namespace IRaCIS.Application.Services if (rowCount > item.MaxRowCount.Value - 1) { //throw new BusinessValidationFailedException($"问题{item.QuestionName}最大相同问题数为{item.MaxRowCount.Value},当前已存在{rowCount}条!"); - throw new BusinessValidationFailedException($"当前器官上已有{rowCount}个靶病灶!"); + throw new BusinessValidationFailedException($"按照RECIST1.1的相关规则,同一器官的靶病灶数量不超过{item.MaxRowCount.Value}个,请确认!!"); } } - } } var isCurrentTaskAddList = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == inDto.QuestionId && x.TrialId == inDto.TrialId && x.RowIndex == inDto.RowIndex).Select(x => x.IsCurrentTaskAdd).ToListAsync(); diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingJudgeTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingJudgeTaskService.cs index 90741b99..8dbd8d57 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingJudgeTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingJudgeTaskService.cs @@ -422,8 +422,8 @@ namespace IRaCIS.Application.Services } else { - var newlist = item.AfterQuestionList.Where(x => x.QuestionId != null).ToList().Union( - twoItem.AfterQuestionList.Where(x => x.QuestionId != null).ToList() + var newlist = item.AfterQuestionList.Where(x => x.QuestionId != null&&x.IsJudgeQuestion).ToList().Union( + twoItem.AfterQuestionList.Where(x => x.QuestionId != null&&x.IsJudgeQuestion).ToList() ).ToList(); List globalGroupTasks = newlist.GroupBy(x => new { x.QuestionId, x.AnswerGroup, x.JudgeType, x.AnswerCombination }).Select(x => new GroupTaskAnswerDto diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs index f61c6423..ffaf06d7 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs @@ -1487,6 +1487,11 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { result = NewLesionAssessment.Yes; } + //只要有任何一个新病灶状态为“无法评估” + else if (tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewLesionState.UnableEvaluate))) + { + result = NewLesionAssessment.NE; + } //当前访视不存在明确新病灶且存在至少一个疑似新病灶 else if (!tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewLesionState.Exist)) && tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewLesionState.Suspected)) @@ -1495,11 +1500,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate result = NewLesionAssessment.Suspected; } - //只要有任何一个新病灶状态为“无法评估” - else if (tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewLesionState.UnableEvaluate))) - { - result = NewLesionAssessment.NE; - } + else { result = NewLesionAssessment.No; diff --git a/IRaCIS.Core.Application/Service/Visit/DTO/VisitPointViewModel.cs b/IRaCIS.Core.Application/Service/Visit/DTO/VisitPointViewModel.cs index e610c75e..cfa42598 100644 --- a/IRaCIS.Core.Application/Service/Visit/DTO/VisitPointViewModel.cs +++ b/IRaCIS.Core.Application/Service/Visit/DTO/VisitPointViewModel.cs @@ -192,6 +192,8 @@ namespace IRaCIS.Core.Application.Contracts public int SeriesCount { get; set; } public int InstanceCount { get; set; } + public bool IsDicom { get; set; } = true; + public List SeriesList { get; set; } = new List(); } diff --git a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs index 95e1c75e..f9edbff6 100644 --- a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs +++ b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs @@ -20,6 +20,7 @@ namespace IRaCIS.Core.Application.Services private readonly IRepository _readModuleRepository; private readonly IRepository _trialRepository; private readonly IRepository _readingPeriodSetRepository; + private readonly IRepository _noneDicomStudyRepository; private readonly IRepository _readingPeriodPlanRepository; private readonly IRepository _subjectRepository; @@ -27,6 +28,7 @@ namespace IRaCIS.Core.Application.Services IRepository readModuleRepository, IRepository trialRepository, IRepository readingPeriodSetRepository, + IRepository noneDicomStudyRepository, IRepository readingPeriodPlanRepository, IRepository subjectRepository) { @@ -34,6 +36,7 @@ namespace IRaCIS.Core.Application.Services this._readModuleRepository = readModuleRepository; this._trialRepository = trialRepository; this._readingPeriodSetRepository = readingPeriodSetRepository; + this._noneDicomStudyRepository = noneDicomStudyRepository; this._readingPeriodPlanRepository = readingPeriodPlanRepository; _subjectRepository = subjectRepository; } @@ -219,6 +222,66 @@ namespace IRaCIS.Core.Application.Services } + /// + /// 获取访视下的Dicom 检查信息 分所有的, 阅片的 不阅片 isReading : 0 查询所有 1 查询仅仅阅片的 + /// + /// + /// + /// + /// + [HttpGet, Route("{trialId:guid}/{sujectVisitId:guid}/{isReading}")] + [AllowAnonymous] + public async Task> GetReadingVisitStudyList(Guid trialId, Guid sujectVisitId, int isReading) + { + var studyList = await _repository.Where(t => t.TrialId == trialId && t.SubjectVisitId == sujectVisitId).Select(k => new VisitStudyDTO() + { + InstanceCount = k.InstanceCount, + Modalities = k.Modalities, + SeriesCount = k.SeriesCount, + StudyCode = k.StudyCode, + StudyId = k.Id, + IsDicom=true, + }).ToListAsync(); + var studyIds = studyList.Select(t => t.StudyId).ToList(); + + var instanceList = await _repository.Where(t => studyIds.Contains(t.StudyId)) + .Select(t => new { t.SeriesId, t.Id, t.InstanceNumber }).ToListAsync(); + + foreach (var t in studyList) + { + t.SeriesList = await _repository.Where(s => s.StudyId == t.StudyId) + .WhereIf(isReading == 1, s => s.IsReading).OrderBy(s => s.SeriesNumber). + ThenBy(s => s.SeriesTime) + .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + + + t.SeriesList.ForEach(series => series.InstanceList = instanceList.Where(t => t.SeriesId == series.Id).OrderBy(t => t.InstanceNumber).Select(k => k.Id).ToList()); + + //设置为阅片与否 不更改数据库检查 的instance数量 和 SeriesCount 所以这里要实时统计 + t.SeriesCount = t.SeriesList.Count(); + t.InstanceCount = t.SeriesList.SelectMany(t => t.InstanceList).Count(); + } + + + // 非Dicom + + //var noDicomStudyList = _noneDicomStudyRepository.Where(x => x.TrialId == trialId && x.SubjectVisitId == sujectVisitId).Select(x => new VisitStudyDTO() + //{ + // InstanceCount = x.FileCount, + // Modalities = x.Modalities, + // SeriesCount = x.SeriesCount, + // StudyCode = x.StudyCode, + // StudyId = x.Id, + // IsDicom = false, + //}).ToListAsync(); + + return studyList; + + //return ResponseOutput.Ok(studyList.Where(t => t.SeriesList.Count > 0).ToList()); + + } + + /// diff --git a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs index e05f586c..06bc4fa2 100644 --- a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs +++ b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs @@ -649,7 +649,12 @@ namespace IRaCIS.Core.Domain.Share /// /// 随访显示 /// - FollowVisitShow = 2 + FollowVisitShow = 2, + + /// + /// 不显示 + /// + NotShow =3 } @@ -1005,6 +1010,11 @@ namespace IRaCIS.Core.Domain.Share /// 访视点肿瘤评估 /// SiteVisitForTumorEvaluation = 21, + + /// + /// 间隔天数 + /// + DaysBetween = 21, } ///