diff --git a/IRaCIS.Core.Application/Service/Reading/ClinicalData/ReadingClinicalDataService.cs b/IRaCIS.Core.Application/Service/Reading/ClinicalData/ReadingClinicalDataService.cs index 0b723921d..d12f6a849 100644 --- a/IRaCIS.Core.Application/Service/Reading/ClinicalData/ReadingClinicalDataService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ClinicalData/ReadingClinicalDataService.cs @@ -538,6 +538,15 @@ namespace IRaCIS.Application.Services } + Dictionary keys = new Dictionary() { + {ClinicalLevel.Subject,0 }, + {ClinicalLevel.ImageRead,1 }, + {ClinicalLevel.OncologyRead,2 }, + {ClinicalLevel.SubjectVisit,3 }, + }; + + result.OrderBy(x => keys[x.ClinicalDataLevel]).ToList(); + return (result, new { SubjectCode = await _subjectRepository.Where(x => x.Id == inDto.SubjectId).Select(x => x.Code).FirstOrDefaultAsync(), diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs index 14ef3fbed..a0617a406 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs @@ -156,7 +156,14 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public string Answer { get; set; } - + public bool IsGlobalChange { get; set; } = false; + + /// + /// 全局阅片修改的答案 + /// + public string GlobalChangeAnswer { get; set; } = string.Empty; + + } @@ -1408,6 +1415,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public string TaskBlindName { get; set; } public decimal VisitTaskNum { get; set; } + + + public Arm? JudgeResultArm { get; set; } } public class GetJudgeReadingPastResultListInDto diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs index 92cd26fe7..d6c2407be 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs @@ -51,9 +51,12 @@ namespace IRaCIS.Application.Services foreach (var answer in item.AnswerList) { await _readingGlobalTaskInfoRepository.BatchDeleteNoTrackingAsync(x => x.GlobalTaskId == inDto.GlobalTaskId && x.TaskId == item.VisitTaskId && x.GlobalAnswerType == answer.GlobalAnswerType && x.QuestionId == answer.QuestionId); - await _readingTaskQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == item.VisitTaskId && x.ReadingQuestionTrialId == answer.QuestionId, x => new ReadingTaskQuestionAnswer() + await _readingTaskQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == item.VisitTaskId && x.ReadingQuestionTrialId == answer.QuestionId + && x.Answer != answer.Answer && x.Answer != string.Empty + , x => new ReadingTaskQuestionAnswer() { - GlobalChangeAnswer = answer.Answer + GlobalChangeAnswer = answer.Answer, + IsGlobalChange=true, }); } } @@ -233,7 +236,7 @@ namespace IRaCIS.Application.Services var globalReadingQuestion = await _readingGlobalTaskInfoRepository.Where(x => x.GlobalTaskId == inDto.VisitTaskId).ToListAsync(); var criterionType = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == taskInfo.TrialReadingCriterionId).Select(x => x.CriterionType).FirstOrDefaultAsync(); - // 如果不是PCWG3 Before的Answer取自于 上一次全局阅片的结果, 如果没有上一次全局阅片的结果 取访视的答案 + // Before的Answer取自于 上一次全局阅片的结果, 如果没有上一次全局阅片的结果 取访视的答案 var lastGlobalTask = await _visitTaskRepository.Where(x => x.ReadingCategory == ReadingCategory.Global && x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId && @@ -354,8 +357,6 @@ namespace IRaCIS.Application.Services if (criterionType == CriterionType.PCWG3) { - // PCWG3 访视点肿瘤评估 采用上一次全局阅片的答案 如果没有 就采用访视的答案 - // 找到上一个全局阅片 diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index d49b22d72..726532914 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -425,8 +425,14 @@ namespace IRaCIS.Application.Services taskQuery = _visitTaskRepository.Where(x => taskInfo.PastResultTaskIdList.Contains(x.Id)); } - var readingPastResultList = await taskQuery - .ProjectTo(_mapper.ConfigurationProvider).OrderBy(x => x.VisitTaskNum).ToListAsync(); + var readingPastResultList = await taskQuery.Select(x => new GetReadingPastResultListOutDto() { + VisitTaskId = x.Id, + TaskBlindName = x.TaskBlindName, + TaskName = x.TaskName, + VisitTaskNum = x.VisitTaskNum, + JudgeResultArm = x.JudgeResultTask == null?null:x.JudgeResultTask.ArmEnum, + + }).OrderBy(x => x.VisitTaskNum).ToListAsync(); return readingPastResultList; } diff --git a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs index 254417b9f..057e97d14 100644 --- a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs @@ -204,8 +204,9 @@ namespace IRaCIS.Core.Application.Service .ForMember(d => d.QuestionName, u => u.MapFrom(s => isEn_Us ? s.QuestionEnName : s.QuestionName)) .ForMember(x=>x.Id, y=>y.MapFrom(z=>z.Id)); - CreateMap() - .ForMember(x => x.VisitTaskId, y => y.MapFrom(z => z.Id)); + //CreateMap() + // .ForMember(x => x.VisitTaskId, y => y.MapFrom(z => z.Id)) + // .ForMember(x => x.JudgeResultArm, y => y.MapFrom(z => (z.JudgeResultTask==null?null:z.JudgeResultTask.ArmEnum))); #endregion #region 医学审核 diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs index 4d6fb6a83..64c3f5685 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs @@ -202,11 +202,15 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate foreach (var task in taskInfoList) { + var answer = answers.Where(x => x.VisitTaskId == task.VisitTaskId && x.ReadingQuestionTrialId == question.QuestionId).FirstOrDefault(); question.Answer.Add(new TaskQuestionAnswer() { - Answer = answers.Where(x => x.VisitTaskId == task.VisitTaskId && x.ReadingQuestionTrialId == question.QuestionId).Select(x => x.Answer).FirstIsNullReturnEmpty(), + Answer = answer == null ? string.Empty : answer.Answer, + IsGlobalChange = answer == null ? false : answer.IsGlobalChange, + GlobalChangeAnswer = answer == null ? string.Empty : answer.GlobalChangeAnswer, TaskName = task.TaskName, VisitTaskId = task.VisitTaskId, + }); } diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs index e26c6881d..e328669e6 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs @@ -180,11 +180,15 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate foreach (var task in taskInfoList) { + var answer = answers.Where(x => x.VisitTaskId == task.VisitTaskId && x.ReadingQuestionTrialId == question.QuestionId).FirstOrDefault(); question.Answer.Add(new TaskQuestionAnswer() { - Answer = answers.Where(x => x.VisitTaskId == task.VisitTaskId && x.ReadingQuestionTrialId == question.QuestionId).Select(x => x.Answer).FirstIsNullReturnEmpty(), + Answer = answer==null?string.Empty:answer.Answer, + IsGlobalChange = answer == null ? false : answer.IsGlobalChange, + GlobalChangeAnswer = answer == null ? string.Empty : answer.GlobalChangeAnswer, TaskName = task.TaskName, VisitTaskId = task.VisitTaskId, + }); } diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/SelfDefineCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/SelfDefineCalculateService.cs index 0fbf3f73f..0ed8868c8 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/SelfDefineCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/SelfDefineCalculateService.cs @@ -192,11 +192,15 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate foreach (var task in taskInfoList) { + var answer = answers.Where(x => x.VisitTaskId == task.VisitTaskId && x.ReadingQuestionTrialId == question.QuestionId).FirstOrDefault(); question.Answer.Add(new TaskQuestionAnswer() { - Answer = answers.Where(x => x.VisitTaskId == task.VisitTaskId && x.ReadingQuestionTrialId == question.QuestionId).Select(x => x.Answer).FirstIsNullReturnEmpty(), + Answer = answer == null ? string.Empty : answer.Answer, + IsGlobalChange = answer == null ? false : answer.IsGlobalChange, + GlobalChangeAnswer = answer == null ? string.Empty : answer.GlobalChangeAnswer, TaskName = task.TaskName, VisitTaskId = task.VisitTaskId, + }); } diff --git a/IRaCIS.Core.Domain/Reading/ReadingFormAnswer/ReadingTaskQuestionAnswer.cs b/IRaCIS.Core.Domain/Reading/ReadingFormAnswer/ReadingTaskQuestionAnswer.cs index f5d6721c6..38c8fdff9 100644 --- a/IRaCIS.Core.Domain/Reading/ReadingFormAnswer/ReadingTaskQuestionAnswer.cs +++ b/IRaCIS.Core.Domain/Reading/ReadingFormAnswer/ReadingTaskQuestionAnswer.cs @@ -54,6 +54,12 @@ namespace IRaCIS.Core.Domain.Models /// public string GlobalChangeAnswer { get; set; } + + /// + /// 全局阅片是否修改 + /// + public bool IsGlobalChange { get; set; } = false; + /// /// 创建人 /// diff --git a/IRaCIS.Core.Domain/Trial/Trial.cs b/IRaCIS.Core.Domain/Trial/Trial.cs index 243fc07d4..30a19d510 100644 --- a/IRaCIS.Core.Domain/Trial/Trial.cs +++ b/IRaCIS.Core.Domain/Trial/Trial.cs @@ -302,7 +302,7 @@ namespace IRaCIS.Core.Domain.Models public DateTime? TrialFinishTime { get; set; } - public int? DigitPlaces { get; set; } = 2; + public int? DigitPlaces { get; set; } = 1; public bool IsTrialProcessConfirmed { get; set; }