From 023665783224399960fc95442faae9049df8e2ba Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Mon, 16 Jan 2023 15:41:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Reading/Dto/ReadingMedicalReviewDto.cs | 10 +++++-- .../ReadingMedicalReviewService.cs | 28 ++++++++++++++++++- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingMedicalReviewDto.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingMedicalReviewDto.cs index 41f2295c2..ba0f7a25e 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingMedicalReviewDto.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingMedicalReviewDto.cs @@ -578,6 +578,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto { public Guid? TaskId { get; set; } + + public decimal VisitTaskNum { get; set; } /// /// 是否是当前任务 /// @@ -617,11 +619,15 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public Guid? OtherTaskId { get; set; } + public Guid? GlobalTaskId { get; set; } + + public Guid? JudgeTaskId { get; set; } + public Arm OtherArmEnum { get; set; } - public Guid? JudgeVisitTaskId { get; set; } + //public Guid? JudgeVisitTaskId { get; set; } - public Guid? JudgeResultTaskId { get; set; } + //public Guid? JudgeResultTaskId { get; set; } public Arm? JudgeResultArm { get; set; } diff --git a/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs b/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs index e51227361..a04238754 100644 --- a/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs +++ b/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs @@ -163,6 +163,8 @@ namespace IRaCIS.Core.Application.Service ).OrderBy(x => x.VisitTaskNum).Select(x => new TaskInfo() { TaskId = x.Id, + VisitTaskNum=x.VisitTaskNum, + //JudgeTaskId=x.JudgeVisitTaskId, // 在下面赋值 要去已完成的 IsCurrentTask = x.Id == taskInfo.Id, ReadingCategory = x.ReadingCategory, TaskBlindName = x.TaskBlindName, @@ -170,7 +172,7 @@ namespace IRaCIS.Core.Application.Service TaskName = x.TaskName, SouceReadModuleId = x.SouceReadModuleId, SourceSubjectVisitId = x.SourceSubjectVisitId, - JudgeVisitTaskId = x.JudgeVisitTaskId, + //JudgeVisitTaskId = x.JudgeVisitTaskId, JudgeResultArm = x.JudgeResultTask.ArmEnum, SubjectId = x.SubjectId, }).ToListAsync(); @@ -189,6 +191,7 @@ namespace IRaCIS.Core.Application.Service .OrderBy(x => x.VisitTaskNum).Select(x => new TaskInfo() { TaskId = x.Id, + IsCurrentTask = x.Id == taskInfo.Id, ReadingCategory = x.ReadingCategory, TaskBlindName = x.TaskBlindName, @@ -216,6 +219,8 @@ namespace IRaCIS.Core.Application.Service medicalReviewInfo.TaskList = await _visitTaskRepository.Where(x => x.Id == taskInfo.Id).Select(x => new TaskInfo() { TaskId = x.Id, + VisitTaskNum = x.VisitTaskNum, + //JudgeTaskId = x.JudgeVisitTaskId, // 在下面赋值 要去已完成的 IsCurrentTask = x.Id == taskInfo.Id, ReadingCategory = x.ReadingCategory, TaskBlindName = x.TaskBlindName, @@ -275,8 +280,29 @@ namespace IRaCIS.Core.Application.Service QuestionName = x.ReadingQuestionTrial.QuestionName.LanguageName(x.ReadingQuestionTrial.QuestionEnName,_userInfo.IsEn_Us) }).ToListAsync(); var globalChangeAnswer = await _readingGlobalTaskInfoRepository.Where(x => taskIds.Contains(x.GlobalTaskId) && x.Answer != string.Empty && x.GlobalAnswerType == GlobalAnswerType.Question && x.GlobalVisitTask.TaskState == TaskState.Effect).ToListAsync(); + // 找全局阅片 和裁判 + var globalTask = await _visitTaskRepository.Where(x => + x.SubjectId == taskInfo.SubjectId + && x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId + && x.TaskState == TaskState.Effect + && x.ArmEnum== taskInfo.ArmEnum + && (x.ReadingCategory == ReadingCategory.Global||x.ReadingCategory==ReadingCategory.Judge) + && x.IsAnalysisCreate == taskInfo.IsAnalysisCreate + && x.IsSelfAnalysis == taskInfo.IsSelfAnalysis + && x.DoctorUserId == taskInfo.DoctorUserId + && x.ReadingTaskState == ReadingTaskState.HaveSigned + && x.ReReadingApplyState != ReReadingApplyState.Agree) + .Select(x => new + { + x.VisitTaskNum, + x.Id + }).ToListAsync(); + + medicalReviewInfo.TaskList.ForEach(x => { + x.GlobalTaskId= globalTask.Where(y=>y.VisitTaskNum==x.VisitTaskNum+ ReadingCommon.TaskNumDic[ReadingCategory.Global]).Select(y=>y.Id).FirstOrDefault(), + x.JudgeTaskId = globalTask.Where(y => y.VisitTaskNum == x.VisitTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Judge]).Select(y => y.Id).FirstOrDefault(), x.IsGlobalChange = globalChangeAnswer.Any(y => y.TaskId == x.TaskId); x.JudgeQuestionAnswerInfoList = visitTaskAnswer.Where(y => y.VisitTaskId == x.TaskId).OrderBy(y => y.ShowOrder).ToList(); });