diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs index abf867cf..f884bfb3 100644 --- a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs @@ -127,6 +127,9 @@ namespace IRaCIS.Core.Application.ViewModel public string FullName { get; set; } public string UserTypeShortName { get; set; } + + + public bool IsClinicalDataSigned { get; set; } = false; } public class UserSimpleInfo @@ -156,7 +159,6 @@ namespace IRaCIS.Core.Application.ViewModel public ReReadingApplyState ReReadingApplyState { get; set; } public DateTime? SuggesteFinishedTime { get; set; } - public bool IsClinicalDataSigned { get; set; } = false; } @@ -168,10 +170,7 @@ namespace IRaCIS.Core.Application.ViewModel public bool IsReReadingOrBackInfluenceAnalysis { get; set; } } - //public class IRReReadingTaskView: ReReadingTaskView - //{ - //} public class ReReadingTaskView { @@ -228,11 +227,6 @@ namespace IRaCIS.Core.Application.ViewModel public class IRUnReadSubjectView { - - //public Guid SiteId { get; set; } - //public String TrialSiteCode { get; set; } = String.Empty; - //public Guid TrialId { get; set; } - public int Index { get; set; } = 0; public Guid SubjectId { get; set; } @@ -271,6 +265,8 @@ namespace IRaCIS.Core.Application.ViewModel public DateTime? SuggesteFinishedTime { get; set; } public Guid TrialReadingCriterionId { get; set; } + + public bool IsClinicalDataSigned { get; set; } = false; } diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs index 8cf8ff24..48a3d7f0 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs @@ -380,7 +380,7 @@ namespace IRaCIS.Core.Application.Service #endregion } - //最近的未一致性核查通过的访视任务 + //后续最近的未一致性核查通过的访视任务 var followBackVisitTask = await _visitTaskRepository.Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.VisitTaskNum > subjectVisit.VisitNum && t.ReadingCategory == ReadingCategory.Visit && t.SourceSubjectVisit.CheckState != CheckStateEnum.CVPassed).OrderBy(t => t.VisitTaskNum).FirstOrDefaultAsync(); //大于当前访视 同时小于最近的未一致性核查通过的访视任务分配 或者生成 diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index 749aafaa..6ccacd9c 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -956,12 +956,10 @@ namespace IRaCIS.Core.Application.Service.Allocation public (int, IOrderedQueryable) GetOrderReadingIQueryable(Guid trialId, Guid? trialReadingCriterionId,string? subjectCode =null) { var visitGroupQuery = _visitTaskRepository.Where(x => x.TrialId == trialId && x.DoctorUserId == _userInfo.Id) - .Include(x=>x.TrialReadingCriterion) .WhereIf(trialReadingCriterionId != null, t => t.TrialReadingCriterionId == trialReadingCriterionId) .WhereIf(!string.IsNullOrEmpty(subjectCode), t => t.Subject.Code.Contains(subjectCode) || t.BlindSubjectCode.Contains(subjectCode)) - - .Where(x => !x.Subject.IsDeleted) - .Where(t => (t.ReadingTaskState != ReadingTaskState.HaveSigned || t.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed || t.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed) && t.TaskState == TaskState.Effect) + .Where(t => (t.ReadingTaskState != ReadingTaskState.HaveSigned || t.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed + || t.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed) && t.TaskState == TaskState.Effect) .GroupBy(x => new { x.SubjectId, x.Subject.Code, x.BlindSubjectCode }); var visitTaskQuery = visitGroupQuery.Select(x => new IRUnReadSubjectView() @@ -984,6 +982,8 @@ namespace IRaCIS.Core.Application.Service.Allocation IsAnalysisCreate = u.IsAnalysisCreate, TrialReadingCriterionId = u.TrialReadingCriterionId, + + IsClinicalDataSigned= u.Subject.ClinicalDataList.Any(c => c.IsSign && (c.ReadingId == u.SouceReadModuleId || c.ReadingId == u.SourceSubjectVisitId)) }).ToList(), }).Where(x => x.UnReadTaskCount > 0).OrderBy(x => x.SubjectId); diff --git a/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs b/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs index 440e7768..ad5f4efa 100644 --- a/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs @@ -124,7 +124,9 @@ namespace IRaCIS.Core.Application.Service .ForMember(o => o.UserCode, t => t.MapFrom(u => u.DoctorUser.UserCode)) .ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName)) .ForMember(o => o.FullName, t => t.MapFrom(u => u.DoctorUser.FullName)) - .ForMember(o => o.UserTypeShortName, t => t.MapFrom(u => u.DoctorUser.UserTypeRole.UserTypeShortName)); + .ForMember(o => o.UserTypeShortName, t => t.MapFrom(u => u.DoctorUser.UserTypeRole.UserTypeShortName)) + .ForMember(o => o.IsClinicalDataSigned, t => t.MapFrom(u => u.Subject.ClinicalDataList.Any(c => c.IsSign && (c.ReadingId == u.SouceReadModuleId || c.ReadingId == u.SourceSubjectVisitId)))) + ; @@ -135,7 +137,8 @@ namespace IRaCIS.Core.Application.Service .ForMember(o => o.HistoryReadingDoctorUserList, t => t.MapFrom(u => u.JudgeVisitList)); CreateMap().IncludeBase() - .ForMember(o => o.IsClinicalDataSigned, t => t.MapFrom(u => u.Subject.ClinicalDataList.Any(c=>c.IsSign && (c.ReadingId==u.SouceReadModuleId ||c.ReadingId==u.SourceSubjectVisitId)))); + + ; CreateMap().IncludeBase() .ForMember(o => o.IsReReadingOrBackInfluenceAnalysis, t => t.MapFrom(u => u.Subject.IsReReadingOrBackInfluenceAnalysis)); diff --git a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs index 8351fdf9..54d6a977 100644 --- a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs @@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Mvc; using IRaCIS.Core.Application.Contracts; using Microsoft.AspNetCore.Authorization; using IRaCIS.Core.Application.Auth; +using IRaCIS.Core.Domain.Share; namespace IRaCIS.Core.Application.Services { @@ -193,7 +194,6 @@ namespace IRaCIS.Core.Application.Services }; - var unionQuery = systemDocumentQueryable.Union(trialDocQueryable) .WhereIf(!string.IsNullOrEmpty(querySystemDocument.Name), t => t.Name.Contains(querySystemDocument.Name)) .WhereIf(querySystemDocument.FileTypeId != null, t => t.FileTypeId == querySystemDocument.FileTypeId) @@ -202,7 +202,7 @@ namespace IRaCIS.Core.Application.Services var result = await unionQuery.ToPagedListAsync(querySystemDocument.PageIndex, querySystemDocument.PageSize, querySystemDocument.SortField, querySystemDocument.Asc); - var needSignTrialDocCount = await _trialDocumentRepository.AsQueryable(true) + var needSignTrialDocCount = await _trialDocumentRepository.AsQueryable(true).Where(t => t.TrialId== querySystemDocument.TrialId && t.Trial.TrialStatusStr != StaticData.TrialState.TrialStopped) .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Where(t => t.IsDeleted == false && !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime!=null) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId)) .CountAsync();