[增加其他角色统计 1]

IRC_NewDev
hang 2024-02-29 09:49:59 +08:00
parent e5f2d1cde9
commit 39882e43ce
2 changed files with 138 additions and 27 deletions

View File

@ -299,18 +299,68 @@ namespace IRaCIS.Core.Application.Contracts
public int? PendingResponseCount { get; set; }
#endregion
#region SPM
public int? SPM_ReReadingApprovalCount { get; set; }
public int? SPM_ReviewerSelectApprovalCount { get; set; }
#endregion
public bool IsIQCHaveToBeDone { get; set; }
public bool IsCRCHaveToBeDone { get; set; }
#region MIM
public bool IsMIMHaveToBeDone { get; set; }
public int? MIM_UrgentCount { get; set; }
public int? MIM_PendingReviewCount { get; set; }
public int? MIM_PendingResponseCount { get; set; }
#endregion
#region CRC
public int? CRC_UrgentCount { get; set; }
public int? CRC_QCQuestionCount { get; set; }
public int? CRC_CheckQuestionCount { get; set; }
#endregion
#region IQC
public int? IQC_UrgentCount { get; set; }
public int? IQC_ToBeClaimedCount { get; set; }
public int? IQC_AuditToBeDealedCount { get; set; }
public int? IQC_QuestionToBeDealedCount { get; set; }
#endregion
#region IR
public List<string>? IR_ReadingCriterionList { get; set; }
public List<string>? IR_PMEmailList { get; set; }
public int? IR_TotalReadCount { get; set; }
#endregion
public bool IsIRHaveToBeDone { get; set; }
//public bool IsIQCHaveToBeDone { get; set; }
//public bool IsCRCHaveToBeDone { get; set; }
public bool IsSPMOrCPMHaveToBeDone { get; set; }
//public bool IsMIMHaveToBeDone { get; set; }
//public bool IsIRHaveToBeDone { get; set; }
//public bool IsSPMOrCPMHaveToBeDone { get; set; }
}
@ -345,6 +395,9 @@ namespace IRaCIS.Core.Application.Contracts
public int? CRC_ImageReUploadCount { get; set; }
public int? CRC_ClinicalDataTobeDoneCount { get; set; }
public int? CRC_ClinialDataTobeConfirmCount { get; set; }
public int? CRC_TrialWaitSignDocCount { get; set; }
public int? CRC_SysWaitSignDocCount { get; set; }

View File

@ -468,7 +468,7 @@ namespace IRaCIS.Core.Application
ToBeVisitCount = t.ReadingClinicalDataList.Where(x => !x.IsSign && x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC && x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.SubjectVisit).Count(),
ToAllCount = t.ReadingClinicalDataList.Where(x => !x.IsSign && x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC).Count(),
ReadModuleCount = t.ReadModuleList.Where(x => !x.IsPMConfirm).Count(),
}).Where(x => x.ToBeDealedCount > 0);
}).Where(x => x.ToAllCount > 0);
var defalutSortArray = new string[] { nameof(ImageClinicalDataToBeDoneDto.UrgentCount) + " desc", nameof(ImageClinicalDataToBeDoneDto.ReadModuleCount) + " desc" };
@ -1322,6 +1322,15 @@ namespace IRaCIS.Core.Application
.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
.Where(u => (u.SubmitState == SubmitStateEnum.ToSubmit && u.IsPMBackOrReReading) || (u.IsQCConfirmedReupload)).Count() > 0).CountAsync() : 0,
CRC_ClinicalDataTobeDoneCount = isCRC ? await _trialRepository
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(t => t.ReadingClinicalDataList.Where(x => !x.IsSign && x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC).Count() > 0).CountAsync() : 0,
CRC_ClinialDataTobeConfirmCount = isCRC ? await _trialRepository
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(t => t.ReadModuleList.Where(x => !x.IsCRCConfirm).Count() > 0).CountAsync() : 0,
#endregion
@ -1435,6 +1444,7 @@ namespace IRaCIS.Core.Application
var isIQC = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.IQC;
var isMIM = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.MIM;
var isSPMOrCPM = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM;
var isIR = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer;
var query = _trialRepository.AsQueryable().IgnoreQueryFilters()
@ -1461,7 +1471,55 @@ namespace IRaCIS.Core.Application
PendingReconciliationCount = isPM ? t.SubjectVisitList.Where(t => t.CheckState == CheckStateEnum.ToCheck).Count() : 0,
PendingResponseCount = isPM ? t.SubjectVisitList.Where(u => u.CheckState == CheckStateEnum.CVIng &&
u.CheckChallengeDialogList.OrderByDescending(t => t.CreateTime).First().UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count() : 0
u.CheckChallengeDialogList.OrderByDescending(t => t.CreateTime).First().UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count() : 0,
SPM_ReReadingApprovalCount = isSPMOrCPM ? t.VisitTaskReReadingList.Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed).Count() : 0,
SPM_ReviewerSelectApprovalCount = isSPMOrCPM ? t.EnrollList.Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).Count() : 0,
MIM_UrgentCount = isMIM ? t.TaskMedicalReviewList.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.Id)
.Where(u=>u.VisitTask.IsUrgent &&(
u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IndependentReviewer && u.AuditState == MedicalReviewAuditState.Auditing
|| u.AuditState != MedicalReviewAuditState.HaveSigned && u.LatestReplyUser.UserTypeEnum != UserTypeEnum.IndependentReviewer)).Count() : 0,
MIM_PendingResponseCount = isMIM ? t.TaskMedicalReviewList.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.Id)
.Where(u => u.AuditState != MedicalReviewAuditState.HaveSigned && u.LatestReplyUser.UserTypeEnum != UserTypeEnum.IndependentReviewer).Count() : 0,
MIM_PendingReviewCount = isMIM ? t.TaskMedicalReviewList.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.Id)
.Where(u=>u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IndependentReviewer && u.AuditState == MedicalReviewAuditState.Auditing).Count() : 0,
CRC_UrgentCount = isCRC? t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id) &&t.IsUrgent).Count() : 0,
CRC_CheckQuestionCount=isCRC? t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
.Where(u => u.CheckState == CheckStateEnum.CVIng && u.CheckChallengeState == CheckChanllengeTypeEnum.PMWaitCRCReply).Count() : 0,
CRC_QCQuestionCount=isCRC? t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id)).SelectMany(c => c.QCChallengeList)
.Where(u => u.IsClosed == false && (u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC || u.LatestReplyUserId == null)).Count() : 0,
//待审核 审核中 加急的数量
IQC_UrgentCount = isIQC ? t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.Id && t.QCProcessEnum != TrialQCProcess.NotAudit && t.IsUrgent ).Count() : 0,
//审核未完成
IQC_AuditToBeDealedCount= isIQC ? t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.Id && t.QCProcessEnum != TrialQCProcess.NotAudit).Count() : 0,
//质疑待处理
IQC_QuestionToBeDealedCount= isIQC ? t.SubjectVisitList.SelectMany(c => c.QCChallengeList)
.Where(u => u.CreateUserId == _userInfo.Id && u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count() : 0,
//待领取
IQC_ToBeClaimedCount= isIQC ? t.SubjectVisitList.Where(t => t.SubmitState == SubmitStateEnum.Submitted && t.AuditState != AuditStateEnum.QCPassed)
.Where(u => u.CurrentActionUserId == null && (u.PreliminaryAuditUserId == null || (u.PreliminaryAuditUserId != _userInfo.Id && u.ReviewAuditUserId == null))).Count() : 0,
IR_ReadingCriterionList =isIR ? t.ReadingQuestionCriterionTrialList.Where(t=>t.IsConfirm).Select(t=>t.CriterionName).ToList():null,
IR_PMEmailList= isIR ? t.TrialUserList.Select(t => t.User.EMail).ToList() : null,
IR_TotalReadCount= isIR ? t.VisitTaskList.Where(t=>t.DoctorUserId==_userInfo.Id && t.TaskState==TaskState.Effect && t.ReadingTaskState==ReadingTaskState.HaveSigned).Count():0,