diff --git a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs index cfcfc40e7..3dc67bdc4 100644 --- a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs +++ b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs @@ -1153,6 +1153,7 @@ namespace IRaCIS.Core.Application.Service.Common var resultList = list.Where(t => t.ReadingCategory != ReadingCategory.Judge).ToList(); + if (arbitrationRule == ArbitrationRule.Visit) { @@ -1165,11 +1166,30 @@ namespace IRaCIS.Core.Application.Service.Common } if (arbitrationRule == ArbitrationRule.Reading) { + //先确定裁判选定的是谁 foreach (var item in resultList) { + //以最后一次裁判为准 找到最大的裁判的裁判选择的Arm,相同就设置裁判标记 item.IsGenerateJudge = list.Where(t => t.ReadingCategory == ReadingCategory.Judge && t.SubjectCode == item.SubjectCode && t.VisitTaskNum > item.VisitTaskNum ).OrderByDescending(t => t.VisitTaskNum).FirstOrDefault()?.JudgeArmEnum == item.ArmEnum ? true : false; + } + //全局裁判了,选择了那个全局,那么对应全局下面的访视 设置裁判标记 + foreach (var item in resultList.Where(t => t.ReadingCategory == ReadingCategory.Visit)) + { + + var selectJudegeGlobalList = resultList.Where(t => t.ReadingCategory == ReadingCategory.Global && t.IsGenerateJudge == true).ToList(); + + //全局修改了答案,那么给访视上赋值全局的结果 并且取的是最后的全局 + var existGlobalAnswer = selectJudegeGlobalList.Where(t => t.SubjectCode == item.SubjectCode).SelectMany(t => t.GlobalTaskAnswerList).Where(t => t.VisitTaskId == item.Id) + .OrderByDescending(t => t.GlobalTaskVisitNum).FirstOrDefault()?.Answer; + + item.OverallTumorEvaluationResult = string.IsNullOrEmpty(existGlobalAnswer) ? item.OverallTumorEvaluationResult : existGlobalAnswer; + + item.IsGenerateJudge = true; + } + + } //如果没有产生裁判,默认选择R1 @@ -1247,7 +1267,7 @@ namespace IRaCIS.Core.Application.Service.Common //处理裁判标记 list = DealJudgeMark(criterion.ArbitrationRule, list); - exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId); + exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list.Where(t => t.ReadingCategory != ReadingCategory.Global).ToList(), _userInfo.TimeZoneId); exportInfo.IsEn_US = _userInfo.IsEn_Us; exportInfo.ClientZoneId = _userInfo.TimeZoneId; @@ -1307,7 +1327,7 @@ namespace IRaCIS.Core.Application.Service.Common //处理裁判标记 list = DealJudgeMark(criterion.ArbitrationRule, list); - exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId); + exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list.Where(t=>t.ReadingCategory!=ReadingCategory.Global).ToList(), _userInfo.TimeZoneId); exportInfo.IsEn_US = _userInfo.IsEn_Us; exportInfo.ClientZoneId = _userInfo.TimeZoneId; diff --git a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs index 82c491a75..2db5966a6 100644 --- a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs +++ b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs @@ -865,13 +865,6 @@ namespace IRaCIS.Core.Application.Contracts public string OverallTumorEvaluationResult { get; set; } - #region old 废弃 - - //public Guid? JudgeResultTaskId { get; set; } - - //[DictionaryTranslateAttribute("YesOrNo")] - //public bool IsGenerateJudge => JudgeResultTaskId != null; - #endregion public Arm? JudgeArmEnum { get; set; } @@ -882,8 +875,20 @@ namespace IRaCIS.Core.Application.Contracts public bool IsGenerateJudge { get; set; } + [JsonIgnore] + + public List GlobalTaskAnswerList { get; set; } + } + public class GlobalAnswerInfo + { + public decimal GlobalTaskVisitNum { get; set; } + public Guid VisitTaskId { get; set; } + + public string Answer { get; set; } + + } public class RECIST1Point1EvaluationOfTumorEfficacyExport : OverallTumorEvaluationExport diff --git a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs index 7bb30bb77..2110ce0bd 100644 --- a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs @@ -182,7 +182,12 @@ namespace IRaCIS.Core.Application.Service .ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.Subject.TrialSite.TrialSiteCode)) .ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.Subject.Code)) - .ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName)); + .ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName)) + .ForMember(o => o.GlobalTaskAnswerList, t => t.MapFrom(u => u.GlobalVisitResultList.Where(t=>t.GlobalAnswerType== GlobalAnswerType.Question) + .Select(c=>new GlobalAnswerInfo() { GlobalTaskVisitNum=c.VisitTask.VisitTaskNum,VisitTaskId=c.TaskId ,Answer=c.Answer}))) + + + ; CreateMap().IncludeBase() .ForMember(o => o.TargetlesionEvaluationResult, t => t.MapFrom(u => u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.TargetLesion).FirstOrDefault()!.Answer)) diff --git a/IRaCIS.Core.Domain/Reading/ClinicalData/ReadingConsistentClinicalData.cs b/IRaCIS.Core.Domain/Reading/ClinicalData/ReadingConsistentClinicalData.cs index 66c216fc9..c57fc08e7 100644 --- a/IRaCIS.Core.Domain/Reading/ClinicalData/ReadingConsistentClinicalData.cs +++ b/IRaCIS.Core.Domain/Reading/ClinicalData/ReadingConsistentClinicalData.cs @@ -9,7 +9,7 @@ using System.Collections.Generic; namespace IRaCIS.Core.Domain.Models { /// - /// 项目的临床数据 + /// 一致性分析临床数据 /// [Table("ReadingConsistentClinicalData")] public class ReadingConsistentClinicalData : Entity, IAuditAdd diff --git a/IRaCIS.Core.Domain/Reading/ClinicalData/ReadingConsistentClinicalDataPDF.cs b/IRaCIS.Core.Domain/Reading/ClinicalData/ReadingConsistentClinicalDataPDF.cs index ce3183971..ab442df64 100644 --- a/IRaCIS.Core.Domain/Reading/ClinicalData/ReadingConsistentClinicalDataPDF.cs +++ b/IRaCIS.Core.Domain/Reading/ClinicalData/ReadingConsistentClinicalDataPDF.cs @@ -7,10 +7,10 @@ using System.ComponentModel.DataAnnotations.Schema; namespace IRaCIS.Core.Domain.Models { - /// - /// 项目的临床数据 - /// - [Table("ReadingConsistentClinicalDataPDF")] + /// + /// 一致性分析临床数据 + /// + [Table("ReadingConsistentClinicalDataPDF")] public class ReadingConsistentClinicalDataPDF : Entity, IAuditAdd { [JsonIgnore]