From aa2bd91426e34674313a517db2ec0a2774644fed Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 25 Jun 2025 16:34:44 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=BC=E8=A1=A8?= =?UTF-8?q?=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Common/ExcelExportService.cs | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs index 198f4c228..c3502151e 100644 --- a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs +++ b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs @@ -764,6 +764,8 @@ namespace IRaCIS.Core.Application.Service.Common var svExpression = QCCommon.GetSubjectVisitFilter(inQuery.VisitPlanArray); var query = _subjectVisitRepository.Where(x => x.TrialId == inQuery.TrialId) + .Where(t => t.Subject.IsSubjectQuit == false || t.SubmitState >= SubmitStateEnum.ToSubmit) + .Where(t => t.Subject.FinalSubjectVisitId != null ? t.VisitNum <= t.Subject.FinalSubjectVisit.VisitNum : true) .WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId) .WhereIf(inQuery.SubjectId != null, t => t.Subject.Id == inQuery.SubjectId) @@ -811,6 +813,9 @@ namespace IRaCIS.Core.Application.Service.Common { var svExpression = QCCommon.GetSubjectVisitFilter(inQuery.VisitPlanArray); var query = _subjectVisitRepository.Where(x => x.TrialId == inQuery.TrialId) + + .Where(t => t.Subject.IsSubjectQuit == false || t.AuditState > AuditStateEnum.ToAudit) + .WhereIf(inQuery.VisitId != null, t => t.Id == inQuery.VisitId) .WhereIf(inQuery.CurrentActionUserId != null, t => t.CurrentActionUserId == inQuery.CurrentActionUserId) .WhereIf(inQuery.ChallengeState != null, t => t.ChallengeState == inQuery.ChallengeState) @@ -1221,6 +1226,9 @@ namespace IRaCIS.Core.Application.Service.Common var svExpression = QCCommon.GetDicomStudySubjectVisitFilter(studyQuery.VisitPlanArray); var dicomStudyQuery = _dicomStudyRepository.Where(t => t.TrialId == studyQuery.TrialId) + + .Where(t => t.Subject.IsSubjectQuit == false || t.SubjectVisit.CheckState >= CheckStateEnum.CVIng) + .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.UserRoleId)) .WhereIf(studyQuery.VisitPlanArray != null && studyQuery.VisitPlanArray?.Length > 0, svExpression) .WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo)) @@ -1249,6 +1257,9 @@ namespace IRaCIS.Core.Application.Service.Common var nodeDicomStudyQuery = _noneDicomStudyRepository.Where(t => t.TrialId == studyQuery.TrialId) + + .Where(t => t.Subject.IsSubjectQuit == false || t.SubjectVisit.CheckState >= CheckStateEnum.CVIng) + .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.UserRoleId)) .WhereIf(studyQuery.VisitPlanArray != null && studyQuery.VisitPlanArray?.Length > 0, svExpression2) .WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo)) @@ -1312,6 +1323,9 @@ namespace IRaCIS.Core.Application.Service.Common var svExpression = QCCommon.GetSubjectVisitFilter(inQuery.VisitPlanArray); var query = _subjectVisitRepository.Where(x => x.TrialId == inQuery.TrialId) + + .Where(t => t.Subject.IsSubjectQuit == false || t.CheckState >= CheckStateEnum.CVIng) + .Where(x => x.AuditState == AuditStateEnum.QCPassed) //一致性核查中的,或者还没一致性核查的 .WhereIf(inQuery.CheckState != null, t => t.CheckState == inQuery.CheckState) .WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId) @@ -1350,7 +1364,9 @@ namespace IRaCIS.Core.Application.Service.Common [FromServices] IRepository _trialRepository) { var list = await _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsAnalysisCreate == false) - //.Where(t => t.IsAnalysisCreate == false && t.DoctorUserId != null) + //.Where(t => t.IsAnalysisCreate == false && t.DoctorUserId != null) + + .Where(t => t.Subject.IsSubjectQuit == false || t.ReadingTaskState >= ReadingTaskState.Reading) .WhereIf(inQuery.IsEffect == true, t => t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze) .WhereIf(inQuery.IsEffect == false, t => t.TaskState == TaskState.Adbandon || t.TaskState == TaskState.HaveReturned) @@ -1734,7 +1750,7 @@ namespace IRaCIS.Core.Application.Service.Common //.WhereIf(inQuery.SystemLevel == null, t => t.SystemLevel == SysEmailLevel.not_sys) .WhereIf(inQuery.SystemLevel != null, t => t.SystemLevel == inQuery.SystemLevel) .WhereIf(inQuery.IsDistinguishCriteria != null, t => t.IsDistinguishCriteria == inQuery.IsDistinguishCriteria) - .WhereIf(inQuery.CriterionTypeEnum != null, t =>t.CriterionTypeList.Any(c=>c==inQuery.CriterionTypeEnum)) + .WhereIf(inQuery.CriterionTypeEnum != null, t => t.CriterionTypeList.Any(c => c == inQuery.CriterionTypeEnum)) .WhereIf(inQuery.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == inQuery.BusinessScenarioEnum) .WhereIf(inQuery.IsReturnRequired != null, t => t.IsReturnRequired == inQuery.IsReturnRequired) .WhereIf(inQuery.IsEnable != null, t => t.IsEnable == inQuery.IsEnable) @@ -2855,7 +2871,7 @@ namespace IRaCIS.Core.Application.Service.Common //多表格,增加的一列,就用Guid.Empty 标识 var extralNameList = new List() { new DynamicColumnConfig.ColumItem() { Id = Guid.Empty, Name = _userInfo.IsEn_Us ? "Table Name" : "表格名称" } }; - var tableQuestionNameList = trialConfigTableQuestionList.OrderBy(t=>t.TableName).Select(t => new DynamicColumnConfig.ColumItem() { Id = t.QuestionId, Name = t.TableName + "_" + t.QuestionName }).ToList(); + var tableQuestionNameList = trialConfigTableQuestionList.OrderBy(t => t.TableName).Select(t => new DynamicColumnConfig.ColumItem() { Id = t.QuestionId, Name = t.TableName + "_" + t.QuestionName }).ToList(); configCoumNameList = fistLeveLNameList.Union(extralNameList).Union(tableQuestionNameList).ToList(); } From efb920159856860ea737f8cc62f7b41685369e1e Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 26 Jun 2025 09:26:30 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=B1=E8=AE=BF?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=BB=9F=E8=AE=A1=E6=95=B0=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TrialSiteUser/PersonalWorkstation.cs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs index bc89c214d..75d05e1db 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs @@ -275,7 +275,7 @@ namespace IRaCIS.Core.Application ExperimentName = t.ExperimentName, TrialCode = t.TrialCode, - ToBeApprovalCount = t.SubjectVisitList.SelectMany(u => u.SubjectVisitImageBackRecordList.Where(t=>t.ImageBackState==ImageBackStateEnum.None)).Count() + ToBeApprovalCount = t.SubjectVisitList.SelectMany(u => u.SubjectVisitImageBackRecordList.Where(t => t.ImageBackState == ImageBackStateEnum.None)).Count() }).Where(x => x.ToBeApprovalCount > 0); @@ -819,7 +819,7 @@ namespace IRaCIS.Core.Application UrgentCount = c.VisitTaskList.AsQueryable().Where(t => t.DoctorUserId == _userInfo.UserRoleId && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect) // 前序 不存在 未一致性核查未通过的 - .Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum)) + .Where(t => !t.Subject.SubjectVisitList.Where(t => t.Trial.TrialExtraConfigJsonStr.Contains("\"IsOpenLostVistRead\":\"true\"") ? t.IsLostVisit == false : true).Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum)) //前序 不存在 未生成任务的访视 .Where(t => c.IsAutoCreate == false ? !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum) : true) @@ -829,7 +829,7 @@ namespace IRaCIS.Core.Application UnReadCount = c.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.UserRoleId && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect) // 前序 不存在 未一致性核查未通过的 - .Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum)) + .Where(t => !t.Subject.SubjectVisitList.Where(t => t.Trial.TrialExtraConfigJsonStr.Contains("\"IsOpenLostVistRead\":\"true\"") ? t.IsLostVisit == false : true).Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum)) //前序 不存在 未生成任务的访视 //.WhereIf(g.Key.IsAutoCreate == false, t => !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum)) .Where(t => c.IsAutoCreate == false ? !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum) : true) @@ -921,11 +921,11 @@ namespace IRaCIS.Core.Application .SelectMany(t => t.VisitTaskList) .Where(t => t.DoctorUserId == _userInfo.UserRoleId && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect && t.TrialReadingCriterion.IsSigned == true && t.TrialReadingCriterion.IsConfirm == true) // 前序 不存在 未一致性核查未通过的 - .Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum)) + .Where(t => !t.Subject.SubjectVisitList.Where(t => t.Trial.TrialExtraConfigJsonStr.Contains("\"IsOpenLostVistRead\":\"true\"") ? t.IsLostVisit == false : true).Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum)) //前序 不存在 未生成任务的访视 .Where(t => t.TrialReadingCriterion.IsAutoCreate == false ? !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum) : true) - - .Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)) + .Where(t => t.Trial.TrialExtraConfigJsonStr.Contains("\"IsOpenLostVistRead\":\"true\"") ? t.IsFrontTaskNeedSignButNotSign == false : true) + .Where(y =>/* y.IsFrontTaskNeedSignButNotSign == false &&*/ (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)) .Count(); return ResponseOutput.Ok(result, new { TotalUnReadCount = toBeDealedCount }); @@ -1252,7 +1252,7 @@ namespace IRaCIS.Core.Application PM_ImageBackApprovalCount = isPM ? await _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing) .Where(t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId))) - .Where(t=>t.SubjectVisitList.SelectMany(u=>u.SubjectVisitImageBackRecordList).Any(t=>t.ImageBackState==ImageBackStateEnum.None)).CountAsync():0, + .Where(t => t.SubjectVisitList.SelectMany(u => u.SubjectVisitImageBackRecordList).Any(t => t.ImageBackState == ImageBackStateEnum.None)).CountAsync() : 0, //await _subjectVisitImageBackRecordReposiotry.Where(t => t.SubjectVisit.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing) @@ -1505,11 +1505,12 @@ namespace IRaCIS.Core.Application IR_UnReadCount = isIR ? t.VisitTaskList .Where(c => c.DoctorUserId == _userInfo.UserRoleId && c.ReadingTaskState != ReadingTaskState.HaveSigned && c.TaskState == TaskState.Effect && c.TrialReadingCriterion.IsSigned) // 前序 不存在 未一致性核查未通过的 - .Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum)) + .Where(t => !t.Subject.SubjectVisitList.Where(t => t.Trial.TrialExtraConfigJsonStr.Contains("\"IsOpenLostVistRead\":\"true\"") ? t.IsLostVisit == false : true).Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum)) //前序 不存在 未生成任务的访视 .Where(t => t.TrialReadingCriterion.IsAutoCreate == false ? !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum) : true) - .Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)).Count() : 0, + .Where(t => t.Trial.TrialExtraConfigJsonStr.Contains("\"IsOpenLostVistRead\":\"true\"") ? t.IsFrontTaskNeedSignButNotSign == false : true) + .Where(y => /*y.IsFrontTaskNeedSignButNotSign == false &&*/ (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)).Count() : 0, IR_UrgentCount = isIR ? t.VisitTaskList.Where(t => t.SourceSubjectVisit.IsUrgent).Count() : 0, From 49a7d5fc296f83df86b8161216c602958d4664e7 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 26 Jun 2025 09:47:16 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=95=B0=E5=AD=97-bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/IRaCIS.Core.Application.xml | 5 +++++ .../Service/TrialSiteUser/PersonalWorkstation.cs | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 796298954..14b1b310a 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -19097,6 +19097,11 @@ 读片数量分类统计 + + + 打开失访可读 + + 导出文件 diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs index 75d05e1db..5f4d4ef47 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs @@ -822,8 +822,8 @@ namespace IRaCIS.Core.Application .Where(t => !t.Subject.SubjectVisitList.Where(t => t.Trial.TrialExtraConfigJsonStr.Contains("\"IsOpenLostVistRead\":\"true\"") ? t.IsLostVisit == false : true).Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum)) //前序 不存在 未生成任务的访视 .Where(t => c.IsAutoCreate == false ? !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum) : true) - - .Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)) + .Where(t => t.Trial.TrialExtraConfigJsonStr.Contains("\"IsOpenLostVistRead\":\"true\"") ? true : t.IsFrontTaskNeedSignButNotSign == false) + .Where(y => /*y.IsFrontTaskNeedSignButNotSign == false &&*/ (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)) .Count(t => t.IsUrgent), @@ -833,8 +833,8 @@ namespace IRaCIS.Core.Application //前序 不存在 未生成任务的访视 //.WhereIf(g.Key.IsAutoCreate == false, t => !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum)) .Where(t => c.IsAutoCreate == false ? !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum) : true) - - .Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)) + .Where(t => t.Trial.TrialExtraConfigJsonStr.Contains("\"IsOpenLostVistRead\":\"true\"") ? true : t.IsFrontTaskNeedSignButNotSign == false) + .Where(y => /*y.IsFrontTaskNeedSignButNotSign == false &&*/ (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)) .Count(), @@ -924,7 +924,7 @@ namespace IRaCIS.Core.Application .Where(t => !t.Subject.SubjectVisitList.Where(t => t.Trial.TrialExtraConfigJsonStr.Contains("\"IsOpenLostVistRead\":\"true\"") ? t.IsLostVisit == false : true).Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum)) //前序 不存在 未生成任务的访视 .Where(t => t.TrialReadingCriterion.IsAutoCreate == false ? !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum) : true) - .Where(t => t.Trial.TrialExtraConfigJsonStr.Contains("\"IsOpenLostVistRead\":\"true\"") ? t.IsFrontTaskNeedSignButNotSign == false : true) + .Where(t => t.Trial.TrialExtraConfigJsonStr.Contains("\"IsOpenLostVistRead\":\"true\"") ? true : t.IsFrontTaskNeedSignButNotSign == false) .Where(y =>/* y.IsFrontTaskNeedSignButNotSign == false &&*/ (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)) .Count(); @@ -1509,7 +1509,7 @@ namespace IRaCIS.Core.Application //前序 不存在 未生成任务的访视 .Where(t => t.TrialReadingCriterion.IsAutoCreate == false ? !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum) : true) - .Where(t => t.Trial.TrialExtraConfigJsonStr.Contains("\"IsOpenLostVistRead\":\"true\"") ? t.IsFrontTaskNeedSignButNotSign == false : true) + .Where(t => t.Trial.TrialExtraConfigJsonStr.Contains("\"IsOpenLostVistRead\":\"true\"") ? true : t.IsFrontTaskNeedSignButNotSign == false) .Where(y => /*y.IsFrontTaskNeedSignButNotSign == false &&*/ (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)).Count() : 0, IR_UrgentCount = isIR ? t.VisitTaskList.Where(t => t.SourceSubjectVisit.IsUrgent).Count() : 0,