diff --git a/IRaCIS.Core.Application/MassTransit/Consumer/ConsistencyCheckConsumer.cs b/IRaCIS.Core.Application/MassTransit/Consumer/ConsistencyCheckConsumer.cs index 26a5d6959..b3d9e35ff 100644 --- a/IRaCIS.Core.Application/MassTransit/Consumer/ConsistencyCheckConsumer.cs +++ b/IRaCIS.Core.Application/MassTransit/Consumer/ConsistencyCheckConsumer.cs @@ -67,7 +67,7 @@ namespace IRaCIS.Core.Application.MassTransit.Consumer //subjectVisitLambda2= subjectVisitLambda2.And(x => x.CheckState == CheckStateEnum.ToCheck && x.AuditState == AuditStateEnum.QCPassed || (x.CheckState == CheckStateEnum.CVIng && x.AuditState == AuditStateEnum.QCPassed)); - Expression> subjectVisitLambda = x => x.TrialId == trialId && + Expression> subjectVisitLambda = x => x.TrialId == trialId && x.Subject.IsSubjectQuit == false && (x.CheckState == CheckStateEnum.ToCheck && x.AuditState == AuditStateEnum.QCPassed || (x.CheckState == CheckStateEnum.CVIng && x.AuditState == AuditStateEnum.QCPassed)); var dicomQuery = from sv in _subjectVisitRepository.Where(subjectVisitLambda) diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs index 2b3c67ac8..69cc6719f 100644 --- a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs @@ -71,6 +71,8 @@ namespace IRaCIS.Core.Application.ViewModel public bool IsPMSetBack { get; set; } + public bool IsSubjectQuit { get; set; } + #region 标准配置 public Guid TrialReadingCriterionId { get; set; } @@ -237,6 +239,7 @@ namespace IRaCIS.Core.Application.ViewModel //重阅原始编号 //public string ReReadingOriginalTaskCode { get; set; } + public string ApplicantName { get; set; } public Guid Id { get; set; } diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index 0dab0ba1e..4682e01d4 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -763,7 +763,7 @@ public class VisitTaskService(IRepository _visitTaskRepository, .WhereIf(inQuery.BeginSignTime != null, t => t.SignTime > inQuery.BeginSignTime) .WhereIf(inQuery.EndSignTime != null, t => t.SignTime < inQuery.EndSignTime) .WhereIf(inQuery.RandomOrder != null, t => t.RandomOrder == inQuery.RandomOrder) - .WhereIf(inQuery.IsRandomOrderList == true, t => (t.ReadingTaskState == ReadingTaskState.WaitReading || t.ReadingTaskState==ReadingTaskState.Reading) && t.TaskAllocationState==TaskAllocationState.Allocated) + .WhereIf(inQuery.IsRandomOrderList == true, t => (t.ReadingTaskState == ReadingTaskState.WaitReading || t.ReadingTaskState == ReadingTaskState.Reading) && t.TaskAllocationState == TaskAllocationState.Allocated) .ProjectTo(_mapper.ConfigurationProvider); var defalutSortArray = new string[] { nameof(ReadingTaskView.IsUrgent) + " desc", nameof(ReadingTaskView.SubjectCode), nameof(ReadingTaskView.VisitTaskNum) }; @@ -964,7 +964,7 @@ public class VisitTaskService(IRepository _visitTaskRepository, //随机阅片 else { - var taskQuery = _visitTaskRepository.Where(x => x.TrialId == inQuery.TrialId && x.DoctorUserId == _userInfo.UserRoleId && x.TaskState == TaskState.Effect && x.TrialReadingCriterionId == trialReadingCriterionId) + var taskQuery = _visitTaskRepository.Where(x => x.TrialId == inQuery.TrialId && x.DoctorUserId == _userInfo.UserRoleId && x.TaskState == TaskState.Effect && x.TrialReadingCriterionId == trialReadingCriterionId && x.Subject.IsSubjectQuit == false) .Where(x => !x.Subject.IsDeleted).Where(x => (x.IsNeedClinicalDataSign && x.IsClinicalDataSign) || !x.IsNeedClinicalDataSign); iRUnReadOut = new IRUnReadOutDto() @@ -1008,7 +1008,7 @@ public class VisitTaskService(IRepository _visitTaskRepository, if (critrion.IsReadingTaskViewInOrder == ReadingOrder.InOrder) { - var visitQuery = _visitTaskRepository.Where(x => x.TrialId == inQuery.TrialId && x.DoctorUserId == _userInfo.UserRoleId && x.TaskState == TaskState.Effect) + var visitQuery = _visitTaskRepository.Where(x => x.TrialId == inQuery.TrialId && x.DoctorUserId == _userInfo.UserRoleId && x.TaskState == TaskState.Effect && x.Subject.IsSubjectQuit == false) .WhereIf(inQuery.SubjectId != null, x => x.SubjectId == inQuery.SubjectId) //前序 不存在 未生成任务的访视 @@ -3008,7 +3008,7 @@ public class VisitTaskService(IRepository _visitTaskRepository, } else { - if(!_visitTaskRepository.Any(t => t.TrialId == inCommand.TrialId && t.TrialReadingCriterionId == inCommand.TrialReadingCriterionId && t.DoctorUserId == inCommand.DoctorUserId + if (!_visitTaskRepository.Any(t => t.TrialId == inCommand.TrialId && t.TrialReadingCriterionId == inCommand.TrialReadingCriterionId && t.DoctorUserId == inCommand.DoctorUserId && t.TaskAllocationState == TaskAllocationState.Allocated && t.ReadingTaskState == ReadingTaskState.WaitReading && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze) && t.RandomOrder == item.RandomOrder)) { diff --git a/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs b/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs index 7db67e2a8..0f2124d61 100644 --- a/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs @@ -2,6 +2,7 @@ using IRaCIS.Application.Contracts; using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Infra.EFCore.Migrations; namespace IRaCIS.Core.Application.Service { @@ -117,7 +118,9 @@ namespace IRaCIS.Core.Application.Service .ForMember(o => o.IsReadingShowPreviousResults, t => t.MapFrom(u => u.TrialReadingCriterion.IsReadingShowPreviousResults)) .ForMember(o => o.DigitPlaces, t => t.MapFrom(u => u.TrialReadingCriterion.DigitPlaces)) .ForMember(o => o.IseCRFShowInDicomReading, t => t.MapFrom(u => u.TrialReadingCriterion.IseCRFShowInDicomReading)) - .ForMember(o => o.CriterionType, t => t.MapFrom(u => u.TrialReadingCriterion.CriterionType)); + .ForMember(o => o.CriterionType, t => t.MapFrom(u => u.TrialReadingCriterion.CriterionType)) + .ForMember(o => o.IsSubjectQuit, t => t.MapFrom(u => u.Subject.IsSubjectQuit)) + ; CreateMap().IncludeBase() @@ -163,6 +166,7 @@ namespace IRaCIS.Core.Application.Service .ForMember(o => o.ApplicantName, t => t.MapFrom(u => u.CreateUserRole.IdentityUser.FullName)) .ForMember(o => o.ReReadingNewTaskCode, t => t.MapFrom(u => u.NewReReadingTask.TaskCode)) .ForMember(o => o.OriginalReReadingTask, t => t.MapFrom(u => u.OriginalReReadingTask)) + //.ForMember(o => o.IsSubjectQuit, t => t.MapFrom(u => u.OriginalReReadingTask.Subject.IsSubjectQuit)) ; @@ -222,6 +226,7 @@ namespace IRaCIS.Core.Application.Service .ForMember(o => o.IseCRFShowInDicomReading, t => t.MapFrom(u => u.VisitTask.TrialReadingCriterion.IseCRFShowInDicomReading)) .ForMember(o => o.CriterionType, t => t.MapFrom(u => u.VisitTask.TrialReadingCriterion.CriterionType)) + .ForMember(o => o.IsSubjectQuit, t => t.MapFrom(u => u.VisitTask.Subject.IsSubjectQuit)) .ForMember(o => o.Id, t => t.MapFrom(u => u.Id)) .ForMember(o => o.MedicalNo, t => t.MapFrom(u => u.VisitTask.Subject.MedicalNo)) .ForMember(o => o.DoctorUser, t => t.MapFrom(u => u.VisitTask.DoctorUser)) diff --git a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs index bc5b6e946..7d610c408 100644 --- a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs +++ b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs @@ -58,7 +58,7 @@ namespace IRaCIS.Core.Application.Contracts //public string VisitPlanInfo { get; set; } = string.Empty; public string[]? VisitPlanArray { get; set; } - + public bool? IsSubjectQuit { get; set; } } public class GetNextQCInfoInDto @@ -96,6 +96,8 @@ namespace IRaCIS.Core.Application.Contracts public DateTime? BeginAuditTime { get; set; } public DateTime? EndAuditTime { get; set; } + + public bool? IsSubjectQuit { get; set; } } public class GetNextIQCQualityInDto @@ -1752,6 +1754,7 @@ namespace IRaCIS.Core.Application.Contracts public class ImageBackViewModel { + public bool IsSubjectQuit { get; set; } public Guid Id { get; set; } public DateTime CreateTime { get; set; } @@ -1867,6 +1870,8 @@ namespace IRaCIS.Core.Application.Contracts public class QCCRCChallengeViewModel { + public bool IsSubjectQuit { get; set; } + public Guid? PreliminaryAuditUserId { get; set; } public Guid? CurrentActionUserId { get; set; } @@ -2068,6 +2073,7 @@ namespace IRaCIS.Core.Application.Contracts public class QCCheckViewModel { + public bool IsSubjectQuit { get; set; } public string? TalkContent { get; set; } = String.Empty; public string BlindName { get; set; } = String.Empty; public bool IsUrgent { get; set; } @@ -2161,6 +2167,7 @@ namespace IRaCIS.Core.Application.Contracts public class QCVisitBasicListViewModel { + public bool IsSubjectQuit { get; set; } public ChallengeStateEnum ChallengeState { get; set; } public bool? IsConfirmedClinicalData { get; set; } public bool IsQCConfirmedReupload { get; set; } diff --git a/IRaCIS.Core.Application/Service/QC/QCListService.cs b/IRaCIS.Core.Application/Service/QC/QCListService.cs index 8c9274e2d..c3720526a 100644 --- a/IRaCIS.Core.Application/Service/QC/QCListService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCListService.cs @@ -84,6 +84,7 @@ namespace IRaCIS.Core.Application.Image.QA .WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId) .WhereIf(inQuery.SubjectId != null, t => t.Subject.Id == inQuery.SubjectId) .WhereIf(!string.IsNullOrEmpty(inQuery.SubjectInfo), t => t.Subject.Code.Contains(inQuery.SubjectInfo)) + .WhereIf(inQuery.IsSubjectQuit != null, t => t.Subject.IsSubjectQuit == inQuery.IsSubjectQuit) .WhereIf(inQuery.VisitPlanArray != null && inQuery.VisitPlanArray?.Length > 0, svExpression) //.WhereIf(!string.IsNullOrEmpty(visitSearchDTO.VisitPlanInfo), visitSearchDTO.VisitPlanInfo.Contains('.') ? t => t.InPlan == false : t => t.VisitNum == decimal.Parse(visitSearchDTO.VisitPlanInfo)) @@ -273,6 +274,7 @@ namespace IRaCIS.Core.Application.Image.QA .WhereIf(inQuery.ChallengeState != null, t => t.ChallengeState == inQuery.ChallengeState) .WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId) .WhereIf(inQuery.SubjectId != null, t => t.Subject.Id == inQuery.SubjectId) + .WhereIf(inQuery.IsSubjectQuit != null, t => t.Subject.IsSubjectQuit == inQuery.IsSubjectQuit) .WhereIf(!string.IsNullOrEmpty(inQuery.SubjectInfo), t => /*t.Subject.FirstName.Contains(subjectInfo) || t.Subject.LastName.Contains(subjectInfo) ||*/ t.Subject.Code.Contains(inQuery.SubjectInfo)) .WhereIf(inQuery.VisitPlanArray != null && inQuery.VisitPlanArray?.Length > 0, svExpression) //.WhereIf(!string.IsNullOrEmpty(visitSearchDTO.VisitPlanInfo), visitSearchDTO.VisitPlanInfo.Contains('.') ? t => t.VisitNum.ToString().Contains(".") : t => t.VisitNum == decimal.Parse(visitSearchDTO.VisitPlanInfo)) diff --git a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs index 50dcf99ee..226bd8161 100644 --- a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs @@ -6,6 +6,7 @@ using IRaCIS.Core.Application.Contracts.DTO; using IRaCIS.Core.Application.MassTransit.Command; using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Infra.EFCore.Migrations; using NPOI.SS.Formula.Functions; using System.Linq; @@ -521,6 +522,7 @@ namespace IRaCIS.Core.Application.Service .ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.TrialSite.TrialSiteCode)) .ForMember(d => d.QCProcessEnum, u => u.MapFrom(s => s.Trial.QCProcessEnum)) .ForMember(d => d.SubjectStatus, u => u.MapFrom(s => s.Subject.Status)) + .ForMember(d => d.IsSubjectQuit, u => u.MapFrom(t => t.Subject.IsSubjectQuit)) .ForMember(d => d.StudyCount, u => u.MapFrom(s => s.StudyList.Count())) .ForMember(d => d.SubmitUserName, u => u.MapFrom(s => s.SubmitUser.UserName)) @@ -546,6 +548,7 @@ namespace IRaCIS.Core.Application.Service .ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.TrialSite.TrialSiteCode)) .ForMember(d => d.QCProcessEnum, u => u.MapFrom(s => s.Trial.QCProcessEnum)) .ForMember(d => d.SubjectId, u => u.MapFrom(t => t.Subject.Id)) + .ForMember(d => d.IsSubjectQuit, u => u.MapFrom(t => t.Subject.IsSubjectQuit)) .ForMember(d => d.MedicalNo, u => u.MapFrom(s => s.Subject.MedicalNo)) .ForMember(d => d.Sex, u => u.MapFrom(s => s.Subject.Sex)) .ForMember(d => d.Age, u => u.MapFrom(t => t.Subject.Age)) @@ -571,6 +574,7 @@ namespace IRaCIS.Core.Application.Service CreateMap() .ForMember(d => d.TalkContent, u => u.MapFrom(s => s.CheckChallengeDialogList.OrderByDescending(y => y.CreateTime).Select(x => x.TalkContent).FirstOrDefault())) .ForMember(d => d.SubjectCode, u => u.MapFrom(s => s.Subject.Code)) + .ForMember(d => d.IsSubjectQuit, u => u.MapFrom(s => s.Subject.IsSubjectQuit)) .ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.TrialSite.TrialSiteCode)); CreateMap().IncludeBase() @@ -681,9 +685,10 @@ namespace IRaCIS.Core.Application.Service .ForMember(d => d.PreliminaryAuditUserId, u => u.MapFrom(s => s.SubjectVisit.PreliminaryAuditUserId)) .ForMember(d => d.CurrentActionUserId, u => u.MapFrom(s => s.SubjectVisit.CurrentActionUserId)) .ForMember(d => d.CurrentActionUserName, u => u.MapFrom(s => s.SubjectVisit.CurrentActionUser.UserName)) - .ForMember(d => d.SubmitState, u => u.MapFrom(s => s.SubjectVisit.SubmitState)) - + .ForMember(d => d.SubmitState, u => u.MapFrom(s => s.SubjectVisit.SubmitState)) + .ForMember(d => d.IsSubjectQuit, u => u.MapFrom(s => s.SubjectVisit.Subject.IsSubjectQuit)) + .ForMember(d => d.IsSubjectQuit, u => u.MapFrom(s => s.SubjectVisit.Subject.IsSubjectQuit)) .ForMember(d => d.TrialSiteId, u => u.MapFrom(s => s.SubjectVisit.TrialSiteId)) .ForMember(d => d.AuditState, u => u.MapFrom(s => s.SubjectVisit.AuditState)) .ForMember(d => d.IsUrgent, u => u.MapFrom(s => s.SubjectVisit.IsUrgent)) @@ -748,6 +753,7 @@ namespace IRaCIS.Core.Application.Service CreateMap() .ForMember(d => d.SubjectCode, u => u.MapFrom(s => s.SubjectVisit.Subject.Code)) + .ForMember(d => d.IsSubjectQuit, u => u.MapFrom(s => s.SubjectVisit.Subject.IsSubjectQuit)) .ForMember(d => d.VisitNum, u => u.MapFrom(t => t.SubjectVisit.VisitNum)) .ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.SubjectVisit.TrialSite.TrialSiteCode)) .ForMember(d => d.VisitName, u => u.MapFrom(s => s.SubjectVisit.VisitName)) diff --git a/IRaCIS.Core.Application/Service/Reading/AdditionalEvaluate/DTO/SubjectCriteriaEvaluationViewModel.cs b/IRaCIS.Core.Application/Service/Reading/AdditionalEvaluate/DTO/SubjectCriteriaEvaluationViewModel.cs index a5cd9ad35..60524b9f4 100644 --- a/IRaCIS.Core.Application/Service/Reading/AdditionalEvaluate/DTO/SubjectCriteriaEvaluationViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/AdditionalEvaluate/DTO/SubjectCriteriaEvaluationViewModel.cs @@ -30,6 +30,8 @@ namespace IRaCIS.Core.Application.ViewModel public string TrialSiteCode { get; set; } public SubjectStatus SubjectStatus { get; set; } + public bool IsSubjectQuit { get; set; } + public List FinalEvaluationList { get; set; } = new List(); @@ -66,6 +68,8 @@ namespace IRaCIS.Core.Application.ViewModel public bool? IsImageFiltering { get; set; } public bool? IsJoinEvaluation { get; set; } + + public bool? IsSubjectQuit { get; set; } } /// SubjectCriteriaEvaluationAddOrEdit 列表查询参数模型 diff --git a/IRaCIS.Core.Application/Service/Reading/AdditionalEvaluate/SubjectCriteriaEvaluationService.cs b/IRaCIS.Core.Application/Service/Reading/AdditionalEvaluate/SubjectCriteriaEvaluationService.cs index 75a76fb98..320d48433 100644 --- a/IRaCIS.Core.Application/Service/Reading/AdditionalEvaluate/SubjectCriteriaEvaluationService.cs +++ b/IRaCIS.Core.Application/Service/Reading/AdditionalEvaluate/SubjectCriteriaEvaluationService.cs @@ -78,6 +78,7 @@ namespace IRaCIS.Core.Application.Service .WhereIf(!string.IsNullOrWhiteSpace(inQuery.SubjectCode), t => t.Code.Contains(inQuery.SubjectCode)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.TrialSiteCode), t => t.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode)) .WhereIf(inQuery.SubjectStatus != null, t => t.Status == inQuery.SubjectStatus) + .WhereIf(inQuery.IsSubjectQuit != null, t => t.IsSubjectQuit == inQuery.IsSubjectQuit) join subjectCriteriaEvaluation in _subjectCriteriaEvaluationRepository .Where(t => t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId) @@ -90,6 +91,7 @@ namespace IRaCIS.Core.Application.Service SubjectCode = subject.Code, SubjectId = subject.Id, SubjectStatus = subject.Status, + IsSubjectQuit = subject.IsSubjectQuit, TrialSiteCode = subject.TrialSite.TrialSiteCode, Id = subjectCriteriaEvaluation.Id, diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/GetReadModuleDto.cs b/IRaCIS.Core.Application/Service/Reading/Dto/GetReadModuleDto.cs index 083383a66..dec3879f0 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/GetReadModuleDto.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/GetReadModuleDto.cs @@ -259,6 +259,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public string? TrialSiteCode { get; set; } + public bool IsSubjectQuit { get; set; } public Guid? TrialSiteId { get; set; } diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadModuleView.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadModuleView.cs index 95a28a305..0c2c6ac47 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadModuleView.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadModuleView.cs @@ -172,5 +172,7 @@ namespace IRaCIS.Core.Domain.Models } } + public bool IsSubjectQuit { get; set; } + } } diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingMedicalReviewDto.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingMedicalReviewDto.cs index 1a0d5600d..c5d8899b3 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingMedicalReviewDto.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingMedicalReviewDto.cs @@ -99,6 +99,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public class GetIRMedicalFeedbackListOutDto { + public bool IsSubjectQuit { get; set; } + public Guid Id { get; set; } public bool IsUrgent { get; set; } diff --git a/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs b/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs index cec81c79f..943c669b6 100644 --- a/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs +++ b/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs @@ -802,6 +802,7 @@ namespace IRaCIS.Core.Application.Service .Select(x => new GetIRMedicalFeedbackListOutDto { TaskState = x.VisitTask.TaskState, + IsSubjectQuit=x.VisitTask.Subject.IsSubjectQuit, Id = x.Id, VisitTaskId = x.VisitTaskId, IsUrgent = x.VisitTask.IsUrgent, diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadModuleService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadModuleService.cs index ed95af6ff..512e22015 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadModuleService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadModuleService.cs @@ -53,8 +53,8 @@ namespace IRaCIS.Core.Application.Service decimal thisVisitNum = 0; - var readModule = await _readModuleRepository.Where(x => x.Id == inDto.Id).Include(x=>x.SubjectVisit).FirstOrDefaultAsync(); - if(readModule!=null) + var readModule = await _readModuleRepository.Where(x => x.Id == inDto.Id).Include(x => x.SubjectVisit).FirstOrDefaultAsync(); + if (readModule != null) { thisVisitNum = readModule.SubjectVisit.VisitNum; } @@ -66,7 +66,7 @@ namespace IRaCIS.Core.Application.Service var readModulequery = _readModuleRepository.AsQueryable().Where(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId); var resultlist = await visitQuery.WhereIf(finalVisitNum != null && finalVisitNum != 0, x => x.VisitNum <= finalVisitNum) - .Where(x => x.VisitNum > mixReadVisitNum|| x.VisitNum==thisVisitNum) + .Where(x => x.VisitNum > mixReadVisitNum || x.VisitNum == thisVisitNum) //.Where(x => !x.IsBaseLine) // 排除基线 .WhereIf(inDto.ReadingSetType == ReadingSetType.TumorReading, x => readModulequery.Where(y => y.SubjectVisitId == x.Id && y.TrialReadingCriterionId == inDto.TrialReadingCriterionId && y.ReadingSetType == ReadingSetType.ImageReading).Count() > 0) .WhereIf(inDto.ReadingSetType == ReadingSetType.ImageReading, x => readModulequery.Where(y => y.Id != inDto.Id && y.SubjectVisitId == x.Id && y.TrialReadingCriterionId == inDto.TrialReadingCriterionId && y.ReadingSetType == ReadingSetType.ImageReading).Count() == 0) @@ -526,6 +526,7 @@ namespace IRaCIS.Core.Application.Service #region 方式二 var subjectVisitQuery = _subjectVisitRepository.Where(t => t.TrialId == inQuery.TrialId)/*.Where(t => t.IsLostVisit == false)*/ + .Where(t => t.Subject.IsSubjectQuit == false || (t.Subject.IsSubjectQuit == true && t.SubmitState == SubmitStateEnum.Submitted)) .Where(sv => sv.Subject.FinalSubjectVisitId == null ? true : sv.VisitNum <= sv.Subject.LatestSubjectVisit.VisitNum).Select(sv => new ReadModuleView() { Id = sv.Id, @@ -533,6 +534,7 @@ namespace IRaCIS.Core.Application.Service PDState = sv.PDState, IsBaseLine = sv.IsBaseLine, SubjectCode = sv.Subject.Code, + IsSubjectQuit = sv.Subject.IsSubjectQuit, IsEnrollmentConfirm = sv.IsEnrollmentConfirm, IsFinalVisit = sv.IsFinalVisit, SubjectId = sv.SubjectId, @@ -600,6 +602,7 @@ namespace IRaCIS.Core.Application.Service }); var readMouduleQuery = _readModuleRepository.Where(t => t.TrialId == inQuery.TrialId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId) + .Where(t => t.Subject.IsSubjectQuit == false || (t.Subject.IsSubjectQuit == true && t.SubjectVisit.SubmitState == SubmitStateEnum.Submitted)) .Select(rm => new ReadModuleView() { Id = rm.Id, @@ -607,6 +610,7 @@ namespace IRaCIS.Core.Application.Service PDState = PDStateEnum.None, IsBaseLine = false, SubjectCode = rm.SubjectVisit.Subject.Code, + IsSubjectQuit = rm.SubjectVisit.Subject.IsSubjectQuit, IsEnrollmentConfirm = false, IsFinalVisit = false, SubjectId = rm.SubjectId, @@ -699,13 +703,14 @@ namespace IRaCIS.Core.Application.Service var viewList = await query.Where(x => subjectIds.Contains(x.SubjectId)).SortToListAsync(inQuery); - var list = viewList.GroupBy(x => new { x.SubjectId, x.TrialSiteId, x.TrialSiteCode, x.SubjectCode }) + var list = viewList.GroupBy(x => new { x.SubjectId, x.TrialSiteId, x.TrialSiteCode, x.SubjectCode, x.IsSubjectQuit }) .Select(x => new GetReadModuleDtoOut() { TrialSiteCode = x.Key.TrialSiteCode, TrialSiteId = x.Key.TrialSiteId, SubjectCode = x.Key.SubjectCode, SubjectId = x.Key.SubjectId, + IsSubjectQuit = x.Key.IsSubjectQuit, Data = x.OrderBy(x => x.ModuleType).ThenBy(x => x.VisitNum).ToList(), }).ToList(); @@ -929,7 +934,7 @@ namespace IRaCIS.Core.Application.Service /// /// [HttpPost] - [TrialGlobalLimit( "AfterStopCannNotOpt" )] + [TrialGlobalLimit("AfterStopCannNotOpt")] public async Task AddReadModule(ReadModuleAddDto dto) { @@ -1095,7 +1100,7 @@ namespace IRaCIS.Core.Application.Service /// /// [HttpDelete("{readModuleId:guid}")] - [TrialGlobalLimit( "AfterStopCannNotOpt" )] + [TrialGlobalLimit("AfterStopCannNotOpt")] public async Task DeleteReadModule(Guid readModuleId) { diff --git a/IRaCIS.Core.Application/Service/Visit/DTO/ClinicalStudySubjects.cs b/IRaCIS.Core.Application/Service/Visit/DTO/ClinicalStudySubjects.cs index 7c2877d47..45de32885 100644 --- a/IRaCIS.Core.Application/Service/Visit/DTO/ClinicalStudySubjects.cs +++ b/IRaCIS.Core.Application/Service/Visit/DTO/ClinicalStudySubjects.cs @@ -156,6 +156,7 @@ namespace IRaCIS.Application.Contracts public bool? IsMissingImages { get; set; } public Guid? TrialSiteId { get; set; } public SubjectStatus? Status { get; set; } + public bool? IsSubjectQuit { get; set; } } diff --git a/IRaCIS.Core.Application/Service/Visit/SubjectService.cs b/IRaCIS.Core.Application/Service/Visit/SubjectService.cs index 11cc30eaa..9334ccdc0 100644 --- a/IRaCIS.Core.Application/Service/Visit/SubjectService.cs +++ b/IRaCIS.Core.Application/Service/Visit/SubjectService.cs @@ -110,6 +110,7 @@ namespace IRaCIS.Core.Application.Service .WhereIf(!string.IsNullOrWhiteSpace(inQuery.Name), t => t.ShortName.Contains(inQuery.Name)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.Sex), t => t.Sex.Contains(inQuery.Sex)) .WhereIf(inQuery.Status != null, t => t.Status == inQuery.Status) + .WhereIf(inQuery.IsSubjectQuit != null, t => t.IsSubjectQuit == inQuery.IsSubjectQuit) .WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId) // CRC 只负责他管理site的受试者