diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs index 65f8634e5..36a08849c 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs @@ -65,6 +65,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public Guid VisitTaskId { get; set; } + public decimal VisitNum { get; set; } + public List BeforeQuestionList { get; set; } public List AfterQuestionList { get; set; } diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs index 90456925f..25275e5c6 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs @@ -110,6 +110,15 @@ namespace IRaCIS.Application.Services public async Task SaveGlobalReadingInfo(SaveGlobalReadingInfoInDto inDto) { await _readingGlobalTaskInfoRepository.BatchDeleteNoTrackingAsync(x => x.GlobalTaskId == inDto.GlobalTaskId); + + foreach(var item in inDto.QuestionList) + { + await _readingTaskQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == item.VisitTaskId && x.ReadingQuestionTrialId == item.QuestionId, x => new ReadingTaskQuestionAnswer() + { + GlobalChangeAnswer = item.Answer + }); + } + await _readingGlobalTaskInfoRepository.AddRangeAsync(inDto.QuestionList.Select(x => new ReadingGlobalTaskInfo() { Answer = x.Answer, @@ -145,11 +154,12 @@ namespace IRaCIS.Application.Services }; result.TaskList = await _visitTaskRepository.Where(x => x.ReadingCategory == ReadingCategory.Visit && - x.SubjectId == taskInfo.SubjectId && x.ArmEnum == taskInfo.ArmEnum && x.VisitTaskNum < taskInfo.VisitTaskNum) + x.SubjectId == taskInfo.SubjectId && x.ArmEnum == taskInfo.ArmEnum&&x.IsAnalysisCreate== taskInfo.IsAnalysisCreate&&x.TaskState== TaskState.Effect && x.VisitTaskNum < taskInfo.VisitTaskNum) .OrderBy(x => x.VisitTaskNum).Select(x => new GlobalVisitInfo() { VisitName = x.SourceSubjectVisit.VisitName, VisitTaskId = x.Id, + VisitNum=x.SourceSubjectVisit.VisitNum, VisitId = x.SourceSubjectVisitId.Value, BeforeQuestionList = x.ReadingTaskQuestionAnswerList.Where(y => y.ReadingQuestionTrial.IsJudgeQuestion).OrderBy(y => y.ReadingQuestionTrial.ShowOrder) .Select(y => new GlobalQuestionInfo() @@ -390,7 +400,7 @@ namespace IRaCIS.Application.Services [HttpPost] public async Task<(List, object)> GetTrialCriterionJudgeQuestionList(GetTrialCriterionJudgeQuestionListInDto inDto) { - var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.TrialId == inDto.TrialId && x.IsConfirm).FirstOrDefaultAsync(); + var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.TrialId == inDto.TrialId && x.IsConfirm).FirstNotNullAsync(); var result = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == inDto.ReadingQuestionCriterionTrialId && x.IsJudgeQuestion) .WhereIf(trialCriterion.FormType == FormType.SinglePage, x => x.ReadingCriterionPageId == null) @@ -810,7 +820,7 @@ namespace IRaCIS.Application.Services /// private async Task FinishReadUpdateState(Guid visitTaskId) { - var taskInfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).FirstOrDefaultAsync(); + var taskInfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).FirstNotNullAsync(); if (!await _visitTaskRepository.AnyAsync(x => x.SourceSubjectVisitId == taskInfo.SourceSubjectVisitId && x.SouceReadModuleId == taskInfo.SouceReadModuleId && x.ReadingTaskState != ReadingTaskState.HaveSigned)) { if (taskInfo.SouceReadModuleId != null) @@ -921,6 +931,7 @@ namespace IRaCIS.Application.Services //x.ReReadingApplyState!=ReReadingApplyState.Agree 排除重阅的 var visitTask = await _visitTaskRepository.Where(x => x.Id == visitTaskId).AsNoTracking().FirstNotNullAsync(); + // 判断是否是一致性核查产生 if (visitTask.IsAnalysisCreate&& visitTask.ConsistentAnalysisOriginalTaskId!=null) { visitTaskids.Add(visitTask.Id); @@ -939,7 +950,8 @@ namespace IRaCIS.Application.Services } else { - visitTaskids = await _visitTaskRepository.Where(x => x.ReadingTaskState == ReadingTaskState.HaveSigned && x.ReadingCategory != ReadingCategory.Judge && x.ReReadingApplyState != ReReadingApplyState.Agree && x.SourceSubjectVisitId == visitTask.SourceSubjectVisitId && x.SouceReadModuleId == visitTask.SouceReadModuleId).Select(x => x.Id).ToListAsync(); + visitTaskids = await _visitTaskRepository.Where(x => x.ReadingTaskState == ReadingTaskState.HaveSigned && x.ReadingCategory != ReadingCategory.Judge + && x.ReReadingApplyState != ReReadingApplyState.Agree && x.SourceSubjectVisitId == visitTask.SourceSubjectVisitId && x.SouceReadModuleId == visitTask.SouceReadModuleId).Select(x => x.Id).ToListAsync(); } var trialInfo = await _trialRepository.Where(x => x.Id == visitTask.TrialId).Select(x=> new { diff --git a/IRaCIS.Core.Domain/Allocation/VisitTask.cs b/IRaCIS.Core.Domain/Allocation/VisitTask.cs index 8d011af22..1f45a8ba6 100644 --- a/IRaCIS.Core.Domain/Allocation/VisitTask.cs +++ b/IRaCIS.Core.Domain/Allocation/VisitTask.cs @@ -70,6 +70,9 @@ namespace IRaCIS.Core.Domain.Models public TaskState TaskState { get; set; } + /// + /// 重阅状态 + /// public ReReadingApplyState ReReadingApplyState { get; set; } public Guid? DoctorUserId { get; set; } diff --git a/IRaCIS.Core.Domain/Reading/ReadingTaskQuestionAnswer.cs b/IRaCIS.Core.Domain/Reading/ReadingTaskQuestionAnswer.cs index 54f7ce027..11b9df2ed 100644 --- a/IRaCIS.Core.Domain/Reading/ReadingTaskQuestionAnswer.cs +++ b/IRaCIS.Core.Domain/Reading/ReadingTaskQuestionAnswer.cs @@ -49,6 +49,11 @@ namespace IRaCIS.Core.Domain.Models /// public DateTime CreateTime { get; set; } + /// + /// 全局阅片修改的答案 + /// + public string GlobalChangeAnswer { get; set; } + /// /// 创建人 ///