From 961b76fd1e052f2fde05fca71ccd7d419e6481b2 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Mon, 12 Jun 2023 13:34:13 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=82=AE=E4=BB=B6?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96=E6=8F=90=E7=A4=BA=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ExtraController.cs | 4 +- .../ReadingClinicalDataService.cs | 56 +++++++++++-------- 2 files changed, 35 insertions(+), 25 deletions(-) diff --git a/IRaCIS.Core.API/Controllers/ExtraController.cs b/IRaCIS.Core.API/Controllers/ExtraController.cs index 08f00f072..2438d8199 100644 --- a/IRaCIS.Core.API/Controllers/ExtraController.cs +++ b/IRaCIS.Core.API/Controllers/ExtraController.cs @@ -205,6 +205,8 @@ namespace IRaCIS.Api.Controllers var token = decodeUrl.Substring(decodeUrl.IndexOf("access_token=") + "access_token=".Length); + var lang = decodeUrl.Substring(decodeUrl.IndexOf("lang=") + "lang=".Length, 2); + var domainStrList = decodeUrl.Split("/").ToList().Take(3).ToList(); var errorUrl = domainStrList[0]+"//"+ domainStrList[2]+ "/error"; @@ -212,7 +214,7 @@ namespace IRaCIS.Api.Controllers if (!await _userRepository.AnyAsync(t => t.Id == Guid.Parse(userId) && t.EmailToken == token && t.IsFirstAdd)) { - decodeUrl = errorUrl+ $"?ErrorMessage={System.Web.HttpUtility.UrlEncode("您的初始化链接已过期")} "; + decodeUrl = errorUrl+ $"?ErrorMessage={System.Web.HttpUtility.UrlEncode(lang=="zh"? "您的初始化链接已过期": "Error!The initialization link has expired. Return")} "; } return Redirect(decodeUrl); diff --git a/IRaCIS.Core.Application/Service/Reading/ClinicalData/ReadingClinicalDataService.cs b/IRaCIS.Core.Application/Service/Reading/ClinicalData/ReadingClinicalDataService.cs index ff4e9f236..7119001bb 100644 --- a/IRaCIS.Core.Application/Service/Reading/ClinicalData/ReadingClinicalDataService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ClinicalData/ReadingClinicalDataService.cs @@ -383,35 +383,43 @@ namespace IRaCIS.Application.Services } - Expression> visitTaskLambda = x => x.TrialId == trialId && x.SubjectId == subjectId && x.TrialReadingCriterionId == trialReadingCritrialId; - - - - - //维护 IsFrontTaskNeedSignButNotSign 在添加任务哪里用触发器也维护了 - var visitTaskIdQueryable = _visitTaskRepository.Where(visitTaskLambda) //该Subject 该标准的任务 - //小于自己任务号的任务 存在需要签名 但是没签名 - .Where(t => t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum) - && t.IsFrontTaskNeedSignButNotSign == false ) - .Select(t => t.Id); - - await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => visitTaskIdQueryable.Contains(t.Id), u => new VisitTask() + //有序阅片才维护 IsFrontTaskNeedSignButNotSign 这个状态 + if (_readingQuestionCriterionTrialRepository.Any(t=>t.Id==trialReadingCritrialId && t.IsReadingTaskViewInOrder == true)) { - IsFrontTaskNeedSignButNotSign = true - }); + + + Expression> visitTaskLambda = x => x.TrialId == trialId && x.SubjectId == subjectId && x.TrialReadingCriterionId == trialReadingCritrialId; + + + //维护 IsFrontTaskNeedSignButNotSign 在添加任务哪里用触发器也维护了 + var visitTaskIdQueryable = _visitTaskRepository.Where(visitTaskLambda) //该Subject 该标准的任务 + //小于自己任务号的任务 存在需要签名 但是没签名 + .Where(t => t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum) + && t.IsFrontTaskNeedSignButNotSign == false) + .Select(t => t.Id); + + await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => visitTaskIdQueryable.Contains(t.Id), u => new VisitTask() + { + IsFrontTaskNeedSignButNotSign = true + }); - var visitTaskIdQueryable2 = _visitTaskRepository.Where(visitTaskLambda) //该Subject 该标准的任务 - //小于自己任务号的任务 存在需要签名 但是没签名 - .Where(t => !t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum) - && t.IsFrontTaskNeedSignButNotSign == true ) - .Select(t => t.Id); + var visitTaskIdQueryable2 = _visitTaskRepository.Where(visitTaskLambda) //该Subject 该标准的任务 + //小于自己任务号的任务 存在需要签名 但是没签名 + .Where(t => !t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum) + && t.IsFrontTaskNeedSignButNotSign == true) + .Select(t => t.Id); - await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => visitTaskIdQueryable2.Contains(t.Id), u => new VisitTask() - { - IsFrontTaskNeedSignButNotSign = false - }); + await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => visitTaskIdQueryable2.Contains(t.Id), u => new VisitTask() + { + IsFrontTaskNeedSignButNotSign = false + }); + + + } + + } From 50ef2e83ce6603639b9c2db63a6d0206cc3545c8 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Mon, 12 Jun 2023 14:45:12 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9C=AA=E9=98=85?= =?UTF-8?q?=E7=89=87=E6=95=B0=E5=AD=97=E7=BB=9F=E8=AE=A1=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Allocation/VisitTaskService.cs | 10 +++- .../ReadingClinicalDataService.cs | 22 +++++-- ...askIsFrontTaskNeedSignButNotSignTrigger.cs | 58 +++++++++++++------ 3 files changed, 63 insertions(+), 27 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index 3d43b495d..5c292742b 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -1081,11 +1081,15 @@ namespace IRaCIS.Core.Application.Service.Allocation var visitQuery = _visitTaskRepository.Where(x => x.TrialId == inDto.TrialId && x.DoctorUserId == _userInfo.Id && x.TaskState == TaskState.Effect /*&& x.TrialReadingCriterionId== inDto.TrialReadingCriterionId*/) - .WhereIf(critrion.IsAutoCreate == false, t => t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(t => t.IsGeneratedTask == false) ? - t.VisitTaskNum <= t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.IsGeneratedTask == false).Min(t => t.SubjectVisit.VisitNum) : true) + //前序 不存在 未生成任务的访视 + .WhereIf(critrion.IsAutoCreate == false, t => !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum) ) - .Where(t => t.Subject.SubjectVisitList.Any(t => t.CheckState != CheckStateEnum.CVPassed) ? t.VisitTaskNum <= t.Subject.SubjectVisitList.Where(t => t.CheckState != CheckStateEnum.CVPassed).Min(t => t.VisitNum) : true) + // 前序 不存在 未一致性核查未通过的 + .Where( t=>! t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum)) + //.WhereIf(critrion.IsAutoCreate == false, t => t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(t => t.IsGeneratedTask == false) ? + //t.VisitTaskNum <= t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.IsGeneratedTask == false).Min(t => t.SubjectVisit.VisitNum) : true) + //.Where(t => t.Subject.SubjectVisitList.Any(t => t.CheckState != CheckStateEnum.CVPassed) ? t.VisitTaskNum <= t.Subject.SubjectVisitList.Where(t => t.CheckState != CheckStateEnum.CVPassed).Min(t => t.VisitNum) : true) //满足前序访视不存在 需要签署但是未签署 sql 相当复杂 同时想查询所有未读的统计数字 就无法统计 byzhouhang //但是加字段 IsFrontTaskNeedSignButNotSign 那么签名临床数据的时候,要对该subject 该标准的有效的任务 这个字段需要在签名的时候维护 采取这种方式 统计数字灵活 //.Where(t => t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum)) diff --git a/IRaCIS.Core.Application/Service/Reading/ClinicalData/ReadingClinicalDataService.cs b/IRaCIS.Core.Application/Service/Reading/ClinicalData/ReadingClinicalDataService.cs index 7119001bb..0c072ec28 100644 --- a/IRaCIS.Core.Application/Service/Reading/ClinicalData/ReadingClinicalDataService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ClinicalData/ReadingClinicalDataService.cs @@ -394,8 +394,14 @@ namespace IRaCIS.Application.Services //维护 IsFrontTaskNeedSignButNotSign 在添加任务哪里用触发器也维护了 var visitTaskIdQueryable = _visitTaskRepository.Where(visitTaskLambda) //该Subject 该标准的任务 //小于自己任务号的任务 存在需要签名 但是没签名 - .Where(t => t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum) - && t.IsFrontTaskNeedSignButNotSign == false) + .Where(t => t.IsFrontTaskNeedSignButNotSign == false && + + (t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum) + + // 前序存在 未一致性核查未通过的 + || t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum>sv.VisitNum) + + )) .Select(t => t.Id); await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => visitTaskIdQueryable.Contains(t.Id), u => new VisitTask() @@ -406,9 +412,15 @@ namespace IRaCIS.Application.Services var visitTaskIdQueryable2 = _visitTaskRepository.Where(visitTaskLambda) //该Subject 该标准的任务 - //小于自己任务号的任务 存在需要签名 但是没签名 - .Where(t => !t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum) - && t.IsFrontTaskNeedSignButNotSign == true) + + .Where(t => t.IsFrontTaskNeedSignButNotSign == true && + + //前序任务 不存在需要签名 但是没签名 + !t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum) + + // 前序 不存在 未一致性核查未通过的 + && !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum) + ) .Select(t => t.Id); await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => visitTaskIdQueryable2.Contains(t.Id), u => new VisitTask() diff --git a/IRaCIS.Core.Application/Triggers/VisitTaskIsFrontTaskNeedSignButNotSignTrigger.cs b/IRaCIS.Core.Application/Triggers/VisitTaskIsFrontTaskNeedSignButNotSignTrigger.cs index f528dbd6c..481420b17 100644 --- a/IRaCIS.Core.Application/Triggers/VisitTaskIsFrontTaskNeedSignButNotSignTrigger.cs +++ b/IRaCIS.Core.Application/Triggers/VisitTaskIsFrontTaskNeedSignButNotSignTrigger.cs @@ -50,33 +50,53 @@ namespace IRaCIS.Core.Application.Triggers Expression> visitTaskLambda = x => x.TrialId == visitTask.TrialId && x.SubjectId == visitTask.SubjectId && x.TrialReadingCriterionId == visitTask.TrialReadingCriterionId; if (context.ChangeType == ChangeType.Added) { - + + //判断是否需要临床数据签名 不需要 就不用维护 if (visitTask.IsNeedClinicalDataSign) { - var visitTaskIdQueryable = _visitTaskRepository.Where(visitTaskLambda) //该Subject 该标准的任务 - //小于自己任务号的任务 存在需要签名 但是没签名 - .Where(t => t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum) - && t.IsFrontTaskNeedSignButNotSign == false) - .Select(t => t.Id); - - await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => visitTaskIdQueryable.Contains(t.Id), u => new VisitTask() + //有序阅片 IsFrontTaskNeedSignButNotSign 维护才有意义 + if (_trialReadingCriterionRepository.Any(t => t.Id == visitTask.TrialReadingCriterionId && t.IsReadingTaskViewInOrder == true)) { - IsFrontTaskNeedSignButNotSign = true - }); + var visitTaskIdQueryable = _visitTaskRepository.Where(visitTaskLambda) //该Subject 该标准的任务 + //小于自己任务号的任务 存在需要签名 但是没签名 + .Where(t => t.IsFrontTaskNeedSignButNotSign == false && + + (t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum) + + // 前序存在 未一致性核查未通过的 + || t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum) + + )) + .Select(t => t.Id); + + await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => visitTaskIdQueryable.Contains(t.Id), u => new VisitTask() + { + IsFrontTaskNeedSignButNotSign = true + }); - var visitTaskIdQueryable2 = _visitTaskRepository.Where(visitTaskLambda) //该Subject 该标准的任务 - //小于自己任务号的任务 存在需要签名 但是没签名 - .Where(t => !t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum) - && t.IsFrontTaskNeedSignButNotSign == true) - .Select(t => t.Id); + var visitTaskIdQueryable2 = _visitTaskRepository.Where(visitTaskLambda) //该Subject 该标准的任务 + + .Where(t => t.IsFrontTaskNeedSignButNotSign == true && + + //前序任务 不存在需要签名 但是没签名 + !t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum) + + // 前序 不存在 未一致性核查未通过的 + && !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum) + ) + .Select(t => t.Id); + + await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => visitTaskIdQueryable2.Contains(t.Id), u => new VisitTask() + { + IsFrontTaskNeedSignButNotSign = false + }); + } + + - await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => visitTaskIdQueryable2.Contains(t.Id), u => new VisitTask() - { - IsFrontTaskNeedSignButNotSign = false - }); } } From 48ede0592672e74d0ef0fd2c214ae4b98f0bbd96 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Mon, 12 Jun 2023 15:23:27 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E9=87=8D=E6=96=B0=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DTO/PersonalWorkstationViewModel.cs | 6 +- .../TrialSiteUser/PersonalWorkstation.cs | 76 +++++++++++-------- 2 files changed, 51 insertions(+), 31 deletions(-) diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/PersonalWorkstationViewModel.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/PersonalWorkstationViewModel.cs index 863b85a5b..f017afe8d 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/PersonalWorkstationViewModel.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/PersonalWorkstationViewModel.cs @@ -149,6 +149,10 @@ namespace IRaCIS.Core.Application.Contracts public class IRImageReadingToBeDoneDto : TrialBaseInfoDto { + public Guid TrialReadingCriterionId { get; set; } + public string CriterionName { get; set; } + + public int? UrgentCount { get; set; } public int? UnReadCount { get; set; } @@ -167,7 +171,7 @@ namespace IRaCIS.Core.Application.Contracts public class MedicalCommentsToBeDoneDto : TrialBaseInfoDto { - + public Guid TrialReadingCriterionId { get; set; } public string CriterionName { get; set; } public int? UrgentCount { get; set; } diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs index 7a77d8697..1a86ffcbc 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs @@ -555,45 +555,61 @@ namespace IRaCIS.Core.Application [FromServices] IRepository _trialRepository) { - var query = _trialRepository - .Select(t => new IRImageReadingToBeDoneDto() - { - TrialId = t.Id, - ResearchProgramNo = t.ResearchProgramNo, - ExperimentName = t.ExperimentName, - TrialCode = t.TrialCode, + //var query = _trialRepository + // .Select(t => new IRImageReadingToBeDoneDto() + // { + // TrialId = t.Id, + // ResearchProgramNo = t.ResearchProgramNo, + // ExperimentName = t.ExperimentName, + // TrialCode = t.TrialCode, - UrgentCount = t.SubjectVisitList.SelectMany(c => c.QCChallengeList) - .Where(u => u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator && u.SubjectVisit.IsUrgent).Count(), + // UrgentCount = t.SubjectVisitList.SelectMany(c => c.QCChallengeList) + // .Where(u => u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator && u.SubjectVisit.IsUrgent).Count(), - UnReadCount=t.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.Id && t.ReadingTaskState != ReadingTaskState.HaveSigned && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze)) - .Where(y=>y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)) + // UnReadCount=t.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.Id && 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.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(), + + // HaveSignedCount = t.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.Id + // && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze) + // && t.ReadingTaskState==ReadingTaskState.HaveSigned).Count() + + // }); - .Count(), + var query = _visitTaskRepository.Where(t => t.DoctorUserId == _userInfo.Id && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze)) + .GroupBy(t => new { t.TrialId, t.Trial.ResearchProgramNo, t.Trial.TrialCode, t.Trial.ExperimentName,t.TrialReadingCriterionId,t.TrialReadingCriterion.CriterionName }) + .Select(g => new IRImageReadingToBeDoneDto() + { + TrialId = g.Key.TrialId, + ResearchProgramNo = g.Key.ResearchProgramNo, + ExperimentName = g.Key.ExperimentName, + TrialCode = g.Key.TrialCode, + CriterionName = g.Key.CriterionName, + TrialReadingCriterionId = g.Key.TrialReadingCriterionId, - HaveSignedCount = t.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.Id - && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze) - && t.ReadingTaskState==ReadingTaskState.HaveSigned).Count() + //UrgentCount = t.SubjectVisitList.SelectMany(c => c.QCChallengeList) + //.Where(u => u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator && u.SubjectVisit.IsUrgent).Count(), - }); + UnReadCount = g.Where(t => t.DoctorUserId == _userInfo.Id && 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.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(), - //var query = _visitTaskRepository.Where(t=>t.DoctorUserId==_userInfo.Id && (t.TaskState == TaskState.Effect ||t.TaskState==TaskState.Freeze)) - // .GroupBy(t=>new {t.SubjectId,t.TrialId,t.Subject.Code,t.Trial.ResearchProgramNo,t.Trial.ExperimentName, t.BlindSubjectCode}) - // .Select(t => new IRImageReadingToBeDoneDto() - // { - // TrialId = t.Id, - // ResearchProgramNo = t.ResearchProgramNo, - // ExperimentName = t.ExperimentName, - // TrialCode = t.TrialCode, - // UrgentCount = t.SubjectVisitList.SelectMany(c => c.QCChallengeList) - // .Where(u => u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator && u.SubjectVisit.IsUrgent).Count(), - // ToBeDealedCount = t.SubjectVisitList.SelectMany(c => c.QCChallengeList) - // .Where(u => u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count(), + HaveSignedCount = g.Where(t => t.DoctorUserId == _userInfo.Id && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze) + && t.ReadingTaskState==ReadingTaskState.HaveSigned).Count(), - // }); + }); var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc); @@ -624,7 +640,7 @@ namespace IRaCIS.Core.Application ExperimentName = g.Key.ExperimentName, TrialCode = g.Key.TrialCode, CriterionName=g.Key.CriterionName, - + TrialReadingCriterionId=g.Key.TrialReadingCriterionId, UrgentCount = g.Where(u => u.VisitTask.IsUrgent && u.ReadingMedicalReviewDialogList.OrderByDescending(l=>l.CreateTime).First().UserTypeEnumInt==(int) UserTypeEnum.MIM).Count(), From 44ad83790df4f64918d9b65a0bcf6db833c92588 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Mon, 12 Jun 2023 17:12:28 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=82=AE=E4=BB=B6?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=92=8C=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ExtraController.cs | 12 ++ .../wwwroot/EmailTemplate/AdminAddUser.html | 2 +- .../EmailTemplate/AdminAddUser_US.html | 12 +- .../wwwroot/EmailTemplate/AdminResetUser.html | 2 +- .../EmailTemplate/AdminResetUser_US.html | 8 +- .../SubjectEnrollConfirmOrPDProgress.html | 2 +- .../SubjectEnrollConfirmOrPDProgress_US.html | 8 +- .../EmailTemplate/TrialDoctorExistJoin.html | 2 +- .../TrialDoctorExistJoin_US.html | 18 ++- .../EmailTemplate/TrialDoctorFirstJoin.html | 2 +- .../TrialDoctorFirstJoin_US.html | 8 +- .../EmailTemplate/TrialSiteSurveyReject.html | 2 +- .../TrialSiteSurveyReject_US.html | 12 +- .../EmailTemplate/TrialUserExistJoin.html | 2 +- .../EmailTemplate/TrialUserExistJoin_US.html | 14 +- .../EmailTemplate/TrialUserFirstJoin.html | 2 +- .../EmailTemplate/TrialUserFirstJoin_US.html | 12 +- .../wwwroot/EmailTemplate/UserOptCommon.html | 2 +- .../EmailTemplate/UserOptCommon_US.html | 6 +- .../IRaCIS.Core.Application.xml | 3 +- .../TrialSiteUser/PersonalWorkstation.cs | 150 ++++++++++++------ .../ReadingQuestionCriterionTrial.cs | 5 + 22 files changed, 183 insertions(+), 103 deletions(-) diff --git a/IRaCIS.Core.API/Controllers/ExtraController.cs b/IRaCIS.Core.API/Controllers/ExtraController.cs index 2438d8199..46daf138f 100644 --- a/IRaCIS.Core.API/Controllers/ExtraController.cs +++ b/IRaCIS.Core.API/Controllers/ExtraController.cs @@ -93,6 +93,7 @@ namespace IRaCIS.Api.Controllers [FromServices] ITokenService _tokenService, [FromServices] IConfiguration configuration) { + var returnModel = await _userService.Login(loginUser.UserName, loginUser.Password); if (returnModel.IsSuccess) @@ -160,6 +161,17 @@ namespace IRaCIS.Api.Controllers returnModel.Data.JWTStr = _tokenService.GetToken(IRaCISClaims.Create(returnModel.Data.BasicInfo)); + // 创建一个 CookieOptions 对象,用于设置 Cookie 的属性 + var option = new CookieOptions + { + Expires = DateTime.Now.AddMonths(1), // 设置过期时间为 30 分钟之后 + HttpOnly = false, // 确保 cookie 只能通过 HTTP 访问 + SameSite = Microsoft.AspNetCore.Http.SameSiteMode.None, // 设置 SameSite 属性 + Secure = false // 确保 cookie 只能通过 HTTPS 访问 + }; + + HttpContext.Response.Cookies.Append("access_token", returnModel.Data.JWTStr, option); + } var userId = returnModel.Data.BasicInfo.Id.ToString(); diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/AdminAddUser.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/AdminAddUser.html index 9191707f8..ba530acb4 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/AdminAddUser.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/AdminAddUser.html @@ -32,7 +32,7 @@
祝您顺利!/Best Regards
-
上海展影医疗科技有限公司
+
展影医疗
diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/AdminAddUser_US.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/AdminAddUser_US.html index 0cfd47bf6..fb1ff4e02 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/AdminAddUser_US.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/AdminAddUser_US.html @@ -11,28 +11,28 @@ Dear {0} ,
- Extimaging has added an account for you. The account information is as follows: + Extensive Imaging has generated a user account for you.
The account information is as follows:
- User name: {1} + User ID: {1}
Role: {2}
- Before logging in for the first time, please modify your account information by this link: + Before logging in for the first time, please initialize your account information through this link: - Initialize the account information + Initialize Account Information
-
Best Regards
-
Shanghai Extensive Imaging Medical Technology Co., LTD
+
Best regards,
+
Extensive Imaging
diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/AdminResetUser.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/AdminResetUser.html index e81216184..ad1130293 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/AdminResetUser.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/AdminResetUser.html @@ -29,7 +29,7 @@
祝您顺利!/Best Regards
-
上海展影医疗科技有限公司
+
展影医疗
diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/AdminResetUser_US.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/AdminResetUser_US.html index 274ee9053..05f730795 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/AdminResetUser_US.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/AdminResetUser_US.html @@ -11,12 +11,12 @@ Dear {0} ,
- Extimaging has reset your account password, and the account information is as follows: + Extensive Imaging has reset your password.
The account information is as follows:
- User name: {1} + User ID: {1}
Role: {2} @@ -28,8 +28,8 @@
-
Best Regards
-
Shanghai Extensive Imaging Medical Technology Co., LTD
+
Best regards,
+
Extensive Imaging
diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/SubjectEnrollConfirmOrPDProgress.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/SubjectEnrollConfirmOrPDProgress.html index 0d184d0a3..368b1884c 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/SubjectEnrollConfirmOrPDProgress.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/SubjectEnrollConfirmOrPDProgress.html @@ -19,7 +19,7 @@
祝您顺利!/Best Regards
-
上海展影医疗科技有限公司
+
展影医疗
diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/SubjectEnrollConfirmOrPDProgress_US.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/SubjectEnrollConfirmOrPDProgress_US.html index aaf96e71f..4ab2379c8 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/SubjectEnrollConfirmOrPDProgress_US.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/SubjectEnrollConfirmOrPDProgress_US.html @@ -8,18 +8,18 @@
- Dear: + Dear Sir or Madam:
- Thank you for using Extensive Imaging Cloud System. + Thank you for using our IRC imaging system.
{0}。
-
Best Regards
-
Shanghai Extensive Imaging Medical Technology Co., LTD
+
Best regards,
+
Extensive Imaging
diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorExistJoin.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorExistJoin.html index 99d20f468..0bf1fb2ad 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorExistJoin.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorExistJoin.html @@ -41,7 +41,7 @@
祝您顺利!/Best Regards
-
上海展影医疗科技有限公司
+
展影医疗
diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorExistJoin_US.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorExistJoin_US.html index 572e2a5df..a2bda514d 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorExistJoin_US.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorExistJoin_US.html @@ -11,10 +11,10 @@ Dear {0},
- Hello, as the IRC supplier of [ {1} (Protocol ID is {2}) ] project,Extiming sincerely invites you to participate in the IRC related work of this project. Your guidance and suggestions are welcome. + As the IRC service provider of {1} trial(Protocol ID is {2}), Extensive Imaging invites you to participate in the independent assessment work of this trial.
- This project adopts electronic workflow. The system and your account information are as follows: + Digital workflow is implemented for this trial, and your account information is as follows:
@@ -25,23 +25,25 @@ Protocol ID: {2}
- Study name: {1} + Study Name: {1}
- User name: {4} + User Name: {4}
Role: {5}
- System login address:{6} + Login URL: {6}
- +
+ Your opinions and suggestions will be greatly appreciated! +
-
Best Regards
-
Shanghai Extensive Imaging Medical Technology Co., LTD
+
Best regards,
+
Extensive Imaging
diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorFirstJoin.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorFirstJoin.html index 4bfce0de5..cb7f00034 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorFirstJoin.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorFirstJoin.html @@ -44,7 +44,7 @@
祝您顺利!/Best Regards
-
上海展影医疗科技有限公司
+
展影医疗
diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorFirstJoin_US.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorFirstJoin_US.html index ba80405ee..7f047145e 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorFirstJoin_US.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorFirstJoin_US.html @@ -11,10 +11,10 @@ Dear {0},
- Hello, as the IRC supplier of [ {1} (Protocol ID is {2}) ] project,Extiming sincerely invites you to participate in the IRC related work of this project. Your guidance and suggestions are welcome. + As the IRC service provider of {1}trial (Protocol ID is {2}), Extensive Imaging invites you to participate in the independent assessment work of this trial. Your opinions and suggestions will be greatly appreciated!
- This project adopts electronic workflow. The system and your account information are as follows: + Digital workflow is implemented for this trial, and your account information is as follows:
@@ -43,8 +43,8 @@
-
Best Regards
-
Shanghai Extensive Imaging Medical Technology Co., LTD
+
Best regards,
+
Extensive Imaging
diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialSiteSurveyReject.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialSiteSurveyReject.html index 29b84eedc..a2b8f771c 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialSiteSurveyReject.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialSiteSurveyReject.html @@ -41,7 +41,7 @@
祝您顺利!/Best Regards
-
上海展影医疗科技有限公司
+
展影医疗
diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialSiteSurveyReject_US.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialSiteSurveyReject_US.html index 0deb87dad..7c69afd20 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialSiteSurveyReject_US.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialSiteSurveyReject_US.html @@ -11,7 +11,7 @@ Dear {0} ,
- Hello, the center survey form you filled in has been rejected. The details are as follows: + The site survey you filled in has been rejected. The details are as follows:
@@ -22,13 +22,13 @@ Protocol ID: {2}
- Study name: {3} + Study Name: {3}
Site ID: {4}
- Site name: {5} + Site Name: {5}
Reason for rejection: {6} @@ -36,12 +36,12 @@
- Login and view + Login & View
-
Best Regards
-
Shanghai Extensive Imaging Medical Technology Co., LTD
+
Best regards,
+
Extensive Imaging
diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserExistJoin.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserExistJoin.html index 14cbda11e..260ad6bba 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserExistJoin.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserExistJoin.html @@ -41,7 +41,7 @@
祝您顺利!/Best Regards
-
上海展影医疗科技有限公司
+
展影医疗
diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserExistJoin_US.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserExistJoin_US.html index 572e2a5df..4c4c9a5a6 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserExistJoin_US.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserExistJoin_US.html @@ -11,10 +11,10 @@ Dear {0},
- Hello, as the IRC supplier of [ {1} (Protocol ID is {2}) ] project,Extiming sincerely invites you to participate in the IRC related work of this project. Your guidance and suggestions are welcome. + As the IRC service provider of {1}trial(Protocol ID is {2}), Extensive Imaging invites you to participate in the independent assessment work of this trial.
- This project adopts electronic workflow. The system and your account information are as follows: + Digital workflow is implemented for this trial, and your account information is as follows:
@@ -25,23 +25,23 @@ Protocol ID: {2}
- Study name: {1} + Study Name: {1}
- User name: {4} + User Name: {4}
Role: {5}
- System login address:{6} + System login URL:{6}
-
Best Regards
-
Shanghai Extensive Imaging Medical Technology Co., LTD
+
Best regards,
+
Extensive Imaging
diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserFirstJoin.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserFirstJoin.html index 83cb9d4be..46c2a7b80 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserFirstJoin.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserFirstJoin.html @@ -44,7 +44,7 @@
祝您顺利!/Best Regards
-
上海展影医疗科技有限公司
+
展影医疗
diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserFirstJoin_US.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserFirstJoin_US.html index ba80405ee..eb260fff1 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserFirstJoin_US.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserFirstJoin_US.html @@ -11,10 +11,10 @@ Dear {0},
- Hello, as the IRC supplier of [ {1} (Protocol ID is {2}) ] project,Extiming sincerely invites you to participate in the IRC related work of this project. Your guidance and suggestions are welcome. + As the IRC service provider of {1}trial(Protocol ID is {2}). Extiming sincerely invites you to participate in the IRC related work of this project. Your guidance and suggestions are welcome.
- This project adopts electronic workflow. The system and your account information are as follows: + Digital workflow is implemented for this trial, and your account information is as follows:
@@ -25,10 +25,10 @@ Protocol ID: {2}
- Study name: {1} + Study Name: {1}
- User name: {4} + User Name: {4}
Role: {5} @@ -43,8 +43,8 @@
-
Best Regards
-
Shanghai Extensive Imaging Medical Technology Co., LTD
+
Best regards,
+
Extensive Imaging
diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/UserOptCommon.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/UserOptCommon.html index e114d9fa9..da4236584 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/UserOptCommon.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/UserOptCommon.html @@ -19,7 +19,7 @@
祝您顺利!/Best Regards
-
上海展影医疗科技有限公司
+
展影医疗
diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/UserOptCommon_US.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/UserOptCommon_US.html index f9bc2f21b..b9fe3583e 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/UserOptCommon_US.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/UserOptCommon_US.html @@ -11,7 +11,7 @@ Dear {0},
- Thank you for using Extensive Imaging Cloud System. + Thank you for using our IRC imaging system.
{1}, the verification code is {2}. Enter the verification code within 3 minutes for subsequent operations. Please ignore this email if not by yourself. @@ -19,8 +19,8 @@
-
Best Regards
-
Shanghai Extensive Imaging Medical Technology Co., LTD
+
Best regards,
+
Extensive Imaging
diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index ecee6e76d..7a9addc24 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -10001,12 +10001,13 @@ - + IR 影像阅片 待阅量 复杂 --未完成 + diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs index 1a86ffcbc..e38888ceb 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs @@ -1,5 +1,6 @@ using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Infrastructure.Extention; using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application @@ -309,14 +310,14 @@ namespace IRaCIS.Core.Application { var query = _trialRepository - .Where(t=>t.clinicalDataTrialSets.Any(t=>t.ClinicalDataLevel==ClinicalLevel.Subject && t.IsConfirm)) + .Where(t => t.clinicalDataTrialSets.Any(t => t.ClinicalDataLevel == ClinicalLevel.Subject && t.IsConfirm)) .Select(t => new ImageClinicalDataToBeDoneDto() { TrialId = t.Id, ResearchProgramNo = t.ResearchProgramNo, ExperimentName = t.ExperimentName, TrialCode = t.TrialCode, - UrgentCount = t.SubjectVisitList.Where(u => u.IsBaseLine&& u.SubmitState != SubmitStateEnum.Submitted && u.IsUrgent ).Count(), + UrgentCount = t.SubjectVisitList.Where(u => u.IsBaseLine && u.SubmitState != SubmitStateEnum.Submitted && u.IsUrgent).Count(), ToBeDealedCount = t.SubjectVisitList.Where(u => u.IsBaseLine && u.SubmitState != SubmitStateEnum.Submitted).Count(), }); @@ -350,12 +351,12 @@ namespace IRaCIS.Core.Application ResearchProgramNo = t.ResearchProgramNo, ExperimentName = t.ExperimentName, TrialCode = t.TrialCode, - UrgentCount = t.SubjectVisitList.SelectMany(c=>c.QCChallengeList) - .Where(u => u.IsClosed==false && u.LatestReplyUser.UserTypeEnum==UserTypeEnum.IQC && u.SubjectVisit.IsUrgent).Count(), + UrgentCount = t.SubjectVisitList.SelectMany(c => c.QCChallengeList) + .Where(u => u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC && u.SubjectVisit.IsUrgent).Count(), ToBeDealedCount = t.SubjectVisitList.SelectMany(c => c.QCChallengeList) - .Where(u => u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC ).Count(), - + .Where(u => u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC).Count(), + }); var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc); @@ -383,9 +384,9 @@ namespace IRaCIS.Core.Application ResearchProgramNo = t.ResearchProgramNo, ExperimentName = t.ExperimentName, TrialCode = t.TrialCode, - UrgentCount = t.SubjectVisitList.Where(u => u.CheckState == CheckStateEnum.CVIng && u.CheckChallengeState==CheckChanllengeTypeEnum.PMWaitCRCReply && u.IsUrgent).Count(), - ToBeDealedCount = t.SubjectVisitList.Where(u => u.CheckState == CheckStateEnum.CVIng && u.CheckChallengeState == CheckChanllengeTypeEnum.PMWaitCRCReply ).Count() - + UrgentCount = t.SubjectVisitList.Where(u => u.CheckState == CheckStateEnum.CVIng && u.CheckChallengeState == CheckChanllengeTypeEnum.PMWaitCRCReply && u.IsUrgent).Count(), + ToBeDealedCount = t.SubjectVisitList.Where(u => u.CheckState == CheckStateEnum.CVIng && u.CheckChallengeState == CheckChanllengeTypeEnum.PMWaitCRCReply).Count() + }); var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc); @@ -418,14 +419,14 @@ namespace IRaCIS.Core.Application ToBeDealedCount = t.SubjectVisitList.Where(u => u.SubmitState == SubmitStateEnum.ToSubmit && u.IsPMBackOrReReading).Count(), }); - + var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc); return result; } - + /// @@ -447,8 +448,8 @@ namespace IRaCIS.Core.Application ResearchProgramNo = t.ResearchProgramNo, ExperimentName = t.ExperimentName, TrialCode = t.TrialCode, - UrgentCount = t.SubjectVisitList.Where(u => u.SubmitState ==SubmitStateEnum.ToSubmit && u.IsUrgent).Count(), - ToBeDealedCount = t.SubjectVisitList.Where(u => u.SubmitState == SubmitStateEnum.ToSubmit ).Count(), + UrgentCount = t.SubjectVisitList.Where(u => u.SubmitState == SubmitStateEnum.ToSubmit && u.IsUrgent).Count(), + ToBeDealedCount = t.SubjectVisitList.Where(u => u.SubmitState == SubmitStateEnum.ToSubmit).Count(), }); @@ -478,7 +479,7 @@ namespace IRaCIS.Core.Application [FromServices] IRepository _trialRepository) { - var query = _trialRepository.Where(t=>t.QCProcessEnum != TrialQCProcess.NotAudit) + var query = _trialRepository.Where(t => t.QCProcessEnum != TrialQCProcess.NotAudit) .Select(t => new ImageQualityToBeDoneDto() { TrialId = t.Id, @@ -487,14 +488,14 @@ namespace IRaCIS.Core.Application TrialCode = t.TrialCode, // 待审核 加急的(待领取 已领取)-- 领取了 还没做 就是待审核 - UrgentCount = t.SubjectVisitList.Where(u => u.CurrentActionUserId==_userInfo.Id && u.IsUrgent).Count(), + UrgentCount = t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.Id && u.IsUrgent).Count(), //待领取量 ToBeClaimedCount = t.SubjectVisitList.Where(u => u.SubmitState == SubmitStateEnum.ToSubmit).Count(), //已领取 待审核 审核中 (审核完成 领取人就会清理 所以只用查询当前领取人是自己的就好了) - ToBeReviewedCount= t.SubjectVisitList.Where(u => u.CurrentActionUserId==_userInfo.Id ).Count() + ToBeReviewedCount = t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.Id).Count() }); @@ -547,12 +548,14 @@ namespace IRaCIS.Core.Application /// /// /// + /// /// /// [HttpPost] public async Task> GetIRImageReadingToBeDoneList(IRImageReadingToBeDoneQuery inQuery, [FromServices] IRepository _visitTaskRepository, - [FromServices] IRepository _trialRepository) + [FromServices] IRepository _trialReadingCriterionRepository, + [FromServices] IRepository _trialRepository) { //var query = _trialRepository @@ -583,35 +586,84 @@ namespace IRaCIS.Core.Application // }); - var query = _visitTaskRepository.Where(t => t.DoctorUserId == _userInfo.Id && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze)) - .GroupBy(t => new { t.TrialId, t.Trial.ResearchProgramNo, t.Trial.TrialCode, t.Trial.ExperimentName,t.TrialReadingCriterionId,t.TrialReadingCriterion.CriterionName }) - .Select(g => new IRImageReadingToBeDoneDto() - { - TrialId = g.Key.TrialId, - ResearchProgramNo = g.Key.ResearchProgramNo, - ExperimentName = g.Key.ExperimentName, - TrialCode = g.Key.TrialCode, - CriterionName = g.Key.CriterionName, - TrialReadingCriterionId = g.Key.TrialReadingCriterionId, + var newQuery= _trialReadingCriterionRepository.Where(t=>t.IsConfirm==true && t.Trial.TrialUserList.Any(t=>t.UserId==_userInfo.Id)) + .Select(c => new IRImageReadingToBeDoneDto() + { + TrialId = c.TrialId, + ResearchProgramNo = c.Trial.ResearchProgramNo, + ExperimentName = c.Trial.ExperimentName, + TrialCode = c.Trial.TrialCode, + CriterionName = c.CriterionName, + TrialReadingCriterionId = c.Id, - //UrgentCount = t.SubjectVisitList.SelectMany(c => c.QCChallengeList) - //.Where(u => u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator && u.SubjectVisit.IsUrgent).Count(), + UrgentCount = c.VisitTaskList.AsQueryable().Where(t => t.DoctorUserId == _userInfo.Id && 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 => g.Key.IsAutoCreate ? !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum) : true) - UnReadCount = g.Where(t => t.DoctorUserId == _userInfo.Id && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect) + .Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)) + .Count(t => t.IsUrgent), + + + UnReadCount = c.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.Id && 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.TrialReadingCriterion.IsAutoCreate == false ? !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum) : true) + //前序 不存在 未生成任务的访视 + //.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 => g.Key.IsAutoCreate ? !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(), - HaveSignedCount = g.Where(t => t.DoctorUserId == _userInfo.Id && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze) - && t.ReadingTaskState==ReadingTaskState.HaveSigned).Count(), - }); - var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc); + HaveSignedCount = c.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.Id && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze) + && t.ReadingTaskState == ReadingTaskState.HaveSigned).Count(), + }) + + ; + + + + + + //var query = _visitTaskRepository.Where(t => t.DoctorUserId == _userInfo.Id && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze)) + // .GroupBy(t => new { t.TrialId, t.Trial.ResearchProgramNo, t.Trial.TrialCode, t.Trial.ExperimentName, t.TrialReadingCriterionId, t.TrialReadingCriterion.CriterionName, t.TrialReadingCriterion.IsAutoCreate }) + // .Select(g => new IRImageReadingToBeDoneDto() + // { + // TrialId = g.Key.TrialId, + // ResearchProgramNo = g.Key.ResearchProgramNo, + // ExperimentName = g.Key.ExperimentName, + // TrialCode = g.Key.TrialCode, + // CriterionName = g.Key.CriterionName, + // TrialReadingCriterionId = g.Key.TrialReadingCriterionId, + + // //UrgentCount = g.AsQueryable().Where(t => t.DoctorUserId == _userInfo.Id && 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 => g.Key.IsAutoCreate ? !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(t=>t.IsUrgent), + + // UnReadCount = g.Where(t => t.DoctorUserId == _userInfo.Id && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect) + // // 前序 不存在 未一致性核查未通过的 + // .Where(t => !t.Subject.SubjectVisitList.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 => g.Key.IsAutoCreate ? !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(), + + // HaveSignedCount = g.Where(t => t.DoctorUserId == _userInfo.Id && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze) + // && t.ReadingTaskState == ReadingTaskState.HaveSigned).Count(), + + // }); + + var result = await newQuery.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ?nameof(IRImageReadingToBeDoneDto.TrialId): inQuery.SortField, inQuery.Asc); return result; @@ -630,21 +682,28 @@ namespace IRaCIS.Core.Application { var query = _taskMedicalReviewRepository - .Where(t=>t.IsClosedDialog==false) - .GroupBy(t=>new {t.TrialId, t.Trial.ResearchProgramNo, t.Trial.ExperimentName, t.Trial.TrialCode , - t.VisitTask.TrialReadingCriterionId,t.VisitTask.TrialReadingCriterion.CriterionName}) + .Where(t => t.IsClosedDialog == false) + .GroupBy(t => new + { + t.TrialId, + t.Trial.ResearchProgramNo, + t.Trial.ExperimentName, + t.Trial.TrialCode, + t.VisitTask.TrialReadingCriterionId, + t.VisitTask.TrialReadingCriterion.CriterionName + }) .Select(g => new MedicalCommentsToBeDoneDto() { TrialId = g.Key.TrialId, ResearchProgramNo = g.Key.ResearchProgramNo, ExperimentName = g.Key.ExperimentName, TrialCode = g.Key.TrialCode, - CriterionName=g.Key.CriterionName, - TrialReadingCriterionId=g.Key.TrialReadingCriterionId, - UrgentCount = g.Where(u => u.VisitTask.IsUrgent - && u.ReadingMedicalReviewDialogList.OrderByDescending(l=>l.CreateTime).First().UserTypeEnumInt==(int) UserTypeEnum.MIM).Count(), + CriterionName = g.Key.CriterionName, + TrialReadingCriterionId = g.Key.TrialReadingCriterionId, + UrgentCount = g.Where(u => u.VisitTask.IsUrgent + && u.ReadingMedicalReviewDialogList.OrderByDescending(l => l.CreateTime).First().UserTypeEnumInt == (int)UserTypeEnum.MIM).Count(), - ToBeDealedCount = g.Where(u => + ToBeDealedCount = g.Where(u => u.ReadingMedicalReviewDialogList.OrderByDescending(l => l.CreateTime).First().UserTypeEnumInt == (int)UserTypeEnum.MIM).Count(), }); @@ -675,7 +734,8 @@ namespace IRaCIS.Core.Application var query = _taskMedicalReviewRepository .Where(t => t.IsClosedDialog == false) - .GroupBy(t => new { + .GroupBy(t => new + { t.TrialId, t.Trial.ResearchProgramNo, t.Trial.ExperimentName, diff --git a/IRaCIS.Core.Domain/Reading/ReadingCriterion/ReadingQuestionCriterionTrial.cs b/IRaCIS.Core.Domain/Reading/ReadingCriterion/ReadingQuestionCriterionTrial.cs index a91ec42f9..df2bf30f4 100644 --- a/IRaCIS.Core.Domain/Reading/ReadingCriterion/ReadingQuestionCriterionTrial.cs +++ b/IRaCIS.Core.Domain/Reading/ReadingCriterion/ReadingQuestionCriterionTrial.cs @@ -256,6 +256,11 @@ namespace IRaCIS.Core.Domain.Models [JsonIgnore] public List TrialCriterionAdditionalAssessmentTypeList { get; set; } = new List(); + + + [JsonIgnore] + + public List VisitTaskList { get; set; } } From fa58ac741984a4dd2524a7e33b3be6f81dd713b3 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 13 Jun 2023 11:11:47 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E9=87=8D=E9=98=85=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E8=A1=A8=20=E5=A2=9E=E5=8A=A0TrialId=20=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=86=97=E4=BD=99=20=E6=96=B9=E4=BE=BF=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ExtraController.cs | 2 +- .../wwwroot/EmailTemplate/UserOptCommon.html | 2 +- .../EmailTemplate/UserOptCommon_US.html | 2 +- .../IRaCIS.Core.Application.xml | 10 +- .../Service/Allocation/VisitTaskService.cs | 2 +- .../DTO/PersonalWorkstationViewModel.cs | 36 +- .../TrialSiteUser/PersonalWorkstation.cs | 314 +++++++++++++----- .../Allocation/VisitTaskReReading.cs | 2 +- 8 files changed, 281 insertions(+), 89 deletions(-) diff --git a/IRaCIS.Core.API/Controllers/ExtraController.cs b/IRaCIS.Core.API/Controllers/ExtraController.cs index 46daf138f..de3d78b2c 100644 --- a/IRaCIS.Core.API/Controllers/ExtraController.cs +++ b/IRaCIS.Core.API/Controllers/ExtraController.cs @@ -226,7 +226,7 @@ namespace IRaCIS.Api.Controllers if (!await _userRepository.AnyAsync(t => t.Id == Guid.Parse(userId) && t.EmailToken == token && t.IsFirstAdd)) { - decodeUrl = errorUrl+ $"?ErrorMessage={System.Web.HttpUtility.UrlEncode(lang=="zh"? "您的初始化链接已过期": "Error!The initialization link has expired. Return")} "; + decodeUrl = errorUrl+ $"?lang={lang}&ErrorMessage={System.Web.HttpUtility.UrlEncode(lang=="zh"? "您的初始化链接已过期": "Error!The initialization link has expired. Return")} "; } return Redirect(decodeUrl); diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/UserOptCommon.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/UserOptCommon.html index da4236584..f9ed9d945 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/UserOptCommon.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/UserOptCommon.html @@ -8,7 +8,7 @@
- Dear {0}, + 亲爱的用户 {0},
感谢您使用展影云平台。 diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/UserOptCommon_US.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/UserOptCommon_US.html index b9fe3583e..0ec66aabd 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/UserOptCommon_US.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/UserOptCommon_US.html @@ -8,7 +8,7 @@
- Dear {0}, + Dear Sir or Madam {0},
Thank you for using our IRC imaging system. diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 7a9addc24..dcda22ad5 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -9922,6 +9922,7 @@ + @@ -9929,6 +9930,8 @@ 重阅申请待审核 + + @@ -9936,6 +9939,8 @@ 阅片人筛选 + + vvv @@ -9943,6 +9948,8 @@ 重阅审批 + + @@ -9959,6 +9966,7 @@ + @@ -10003,7 +10011,7 @@ - IR 影像阅片 待阅量 复杂 --未完成 + IR 影像阅片 待阅量 diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index 5c292742b..cd1501d3f 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -1416,7 +1416,7 @@ namespace IRaCIS.Core.Application.Service.Allocation //添加申请记录 var visitTaskReReading = await _visitTaskReReadingRepository.AddAsync(new VisitTaskReReading() { - + TrialId=applyReReadingCommand.TrialId, RootReReadingTaskId = rootReReadingTaskId == Guid.Empty ? task.Id : rootReReadingTaskId, OriginalReReadingTaskId = task.Id, RequestReReadingTime = DateTime.Now, diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/PersonalWorkstationViewModel.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/PersonalWorkstationViewModel.cs index f017afe8d..d3604a473 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/PersonalWorkstationViewModel.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/PersonalWorkstationViewModel.cs @@ -175,7 +175,7 @@ namespace IRaCIS.Core.Application.Contracts public string CriterionName { get; set; } public int? UrgentCount { get; set; } - public int? ToBeDealedCount { get; set; } + public int? ToBeReplyedCount { get; set; } } public class ImageCheckQuestionToBeDoneQuery : PageInput @@ -187,7 +187,7 @@ namespace IRaCIS.Core.Application.Contracts { public int? UrgentCount { get; set; } - public int? ToBeDealedCount { get; set; } + public int? ToBeReplyedCount { get; set; } } public class ImageSubmittedToBeDoneQuery : PageInput @@ -228,7 +228,7 @@ namespace IRaCIS.Core.Application.Contracts { public int? UrgentCount { get; set; } - public int? ToBeDealedCount { get; set; } + public int? ToBeReUploadCount { get; set; } } public class ImageClinicalDataToBeDoneQuery : PageInput @@ -243,7 +243,37 @@ namespace IRaCIS.Core.Application.Contracts public int? ToBeDealedCount { get; set; } } + public class TrialToBeDoneQuery : PageInput + { + public string ExperimentName { get; set; } = string.Empty; + public string Code { get; set; } = string.Empty; + + public string ResearchProgramNo { get; set; } = string.Empty; + + public Guid? SponsorId { get; set; } + + + } + + public class TrialToBeDoneDto : TrialBaseInfoDto + { + + public Guid Id => TrialId; + + public DateTime? CreateTime { get; set; } + + public string Sponsor { get; set; } + + public string TrialStatusStr { get; set; } + + + + public int? ExpetiedTaskCount { get; set; } + + public int? ReReadingApprovalCount { get; set; } + + } diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs index e38888ceb..49710b2be 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs @@ -1,4 +1,6 @@ -using IRaCIS.Core.Application.Contracts; +using IRaCIS.Application.Contracts; +using IRaCIS.Core.Application.Contracts; +using IRaCIS.Core.Domain.Models; using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure.Extention; using Microsoft.AspNetCore.Mvc; @@ -164,19 +166,22 @@ namespace IRaCIS.Core.Application #region PM APM 待办 + /// /// 一致性核查待处理 /// /// /// + /// /// [HttpPost] - public async Task> GetCheckToBeDoneList(CheckToBeDoneQuery inQuery, + public async Task>> GetCheckToBeDoneList(CheckToBeDoneQuery inQuery, [FromServices] IRepository _subjectVisitRepository, [FromServices] IRepository _trialRepository) { var query = _trialRepository + .Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Select(t => new CheckToBeDoneDto() { TrialId = t.Id, @@ -184,14 +189,25 @@ namespace IRaCIS.Core.Application ExperimentName = t.ExperimentName, TrialCode = t.TrialCode, UrgentCount = t.SubjectVisitList.Where(u => (u.CheckState == CheckStateEnum.ToCheck || u.CheckState == CheckStateEnum.CVIng) && u.IsUrgent).Count(), + ToBeCheckedCount = t.SubjectVisitList.Where(u => u.CheckState == CheckStateEnum.ToCheck).Count(), + ToBeRepliedCount = t.SubjectVisitList.Where(u => u.CheckState == CheckStateEnum.ToCheck && u.CheckChallengeDialogList.Any(t => t.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator)).Count(), }); + + var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc); - return result; + var totalToBeCheckedCount = await _subjectVisitRepository.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) + .Where(u => u.CheckState == CheckStateEnum.ToCheck).CountAsync(); + + var totalToBeRepliedCount = await _subjectVisitRepository.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) + .Where(u => u.CheckState == CheckStateEnum.ToCheck && + u.CheckChallengeDialogList.Any(t => t.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator)).CountAsync(); + + return ResponseOutput.Ok(result, new { TotalToBeCheckedCount = totalToBeCheckedCount, TotalToBeRepliedCount = totalToBeRepliedCount }); } @@ -199,14 +215,18 @@ namespace IRaCIS.Core.Application /// 重阅申请待审核 /// /// + /// + /// /// [HttpPost] - public async Task> GetReReadingApplyToBeDoneList(ReReadingApplyToBeDoneQuery inQuery, + public async Task>> GetReReadingApplyToBeDoneList(ReReadingApplyToBeDoneQuery inQuery, [FromServices] IRepository _visitTaskReReadingRepository, [FromServices] IRepository _trialRepository) { - var query = _visitTaskReReadingRepository.Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed) + var query = _visitTaskReReadingRepository + .Where(t => t.OriginalReReadingTask.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) + .Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed) .GroupBy(t => new { t.OriginalReReadingTask.Trial.ExperimentName, t.OriginalReReadingTask.Trial.ResearchProgramNo, t.OriginalReReadingTask.Trial.TrialCode, t.OriginalReReadingTask.TrialId }) .Select(g => new ReReadingApplyToBeDoneDto() { @@ -222,11 +242,17 @@ namespace IRaCIS.Core.Application var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc); - return result; + + var toBeApprovalCount = _visitTaskReReadingRepository + .Where(t => t.OriginalReReadingTask.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) + .Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed).Count(); + + return ResponseOutput.Ok(result, new { TotalToBeApprovalCount = toBeApprovalCount }); } + #endregion @@ -236,13 +262,16 @@ namespace IRaCIS.Core.Application /// 阅片人筛选 /// /// + /// + /// /// vvv [HttpPost] - public async Task> GetReviewerSelectToBeDoneList(ReviewerSelectToBeDoneQuery inQuery + public async Task>> GetReviewerSelectToBeDoneList(ReviewerSelectToBeDoneQuery inQuery , [FromServices] IRepository _enrollRepository, [FromServices] IRepository _trialRepository) { var query = _trialRepository + .Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Select(t => new ReviewerSelectToBeDoneDto() { TrialId = t.Id, @@ -256,7 +285,10 @@ namespace IRaCIS.Core.Application var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc); - return result; + var toBeApprovalCount = await _enrollRepository.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) + .Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).CountAsync(); + + return ResponseOutput.Ok(result, new { ToBeApprovalCount = toBeApprovalCount }); ; } @@ -264,14 +296,18 @@ namespace IRaCIS.Core.Application /// 重阅审批 /// /// + /// + /// /// [HttpPost] - public async Task> GetReReadingApprovalToBeDoneToBeDoneList(ReReadingApprovalToBeDoneQuery inQuery, + public async Task>> GetReReadingApprovalToBeDoneToBeDoneList(ReReadingApprovalToBeDoneQuery inQuery, [FromServices] IRepository _visitTaskReReadingRepository, [FromServices] IRepository _trialRepository) { - var query = _visitTaskReReadingRepository.Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed) + var query = _visitTaskReReadingRepository + .Where(t => t.OriginalReReadingTask.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) + .Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed) .GroupBy(t => new { t.OriginalReReadingTask.Trial.ExperimentName, t.OriginalReReadingTask.Trial.ResearchProgramNo, t.OriginalReReadingTask.Trial.TrialCode, t.OriginalReReadingTask.TrialId }) .Select(g => new ReReadingApprovalToBeDoneDto() { @@ -287,7 +323,11 @@ namespace IRaCIS.Core.Application var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc); - return result; + var toBeApprovalCount = _visitTaskReReadingRepository + .Where(t => t.OriginalReReadingTask.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) + .Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed).Count(); + + return ResponseOutput.Ok(result, new { TotalToBeApprovalCount = toBeApprovalCount }); } @@ -304,12 +344,13 @@ namespace IRaCIS.Core.Application /// /// [HttpPost] - public async Task> GetImageClinicalDataToBeDoneList(ImageClinicalDataToBeDoneQuery inQuery, + public async Task>> GetImageClinicalDataToBeDoneList(ImageClinicalDataToBeDoneQuery inQuery, [FromServices] IRepository _subjectVisitRepository, [FromServices] IRepository _trialRepository) { var query = _trialRepository + .Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Where(t => t.clinicalDataTrialSets.Any(t => t.ClinicalDataLevel == ClinicalLevel.Subject && t.IsConfirm)) .Select(t => new ImageClinicalDataToBeDoneDto() { @@ -324,7 +365,11 @@ namespace IRaCIS.Core.Application var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc); - return result; + var toBeDealedCount = _subjectVisitRepository + .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id) && t.Trial.clinicalDataTrialSets.Any(t => t.ClinicalDataLevel == ClinicalLevel.Subject && t.IsConfirm)) + .Where(u => u.IsBaseLine && u.SubmitState != SubmitStateEnum.Submitted).Count(); + + return ResponseOutput.Ok(result, new { TotalToBeDealedCount = toBeDealedCount }); } @@ -337,14 +382,16 @@ namespace IRaCIS.Core.Application /// /// /// + /// /// [HttpPost] - public async Task> GetCRCImageQuestionToBeDoneList(ImageQuestionToBeDoneQuery inQuery, + public async Task>> GetCRCImageQuestionToBeDoneList(ImageQuestionToBeDoneQuery inQuery, [FromServices] IRepository _subjectVisitRepository, [FromServices] IRepository _trialRepository) { var query = _trialRepository + .Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Select(t => new ImageQuestionToBeDoneDto() { TrialId = t.Id, @@ -353,6 +400,7 @@ namespace IRaCIS.Core.Application TrialCode = t.TrialCode, UrgentCount = t.SubjectVisitList.SelectMany(c => c.QCChallengeList) .Where(u => u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC && u.SubjectVisit.IsUrgent).Count(), + ToBeDealedCount = t.SubjectVisitList.SelectMany(c => c.QCChallengeList) .Where(u => u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC).Count(), @@ -361,7 +409,12 @@ namespace IRaCIS.Core.Application var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc); - return result; + var toBeDealedCount = _subjectVisitRepository + .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) + .SelectMany(c => c.QCChallengeList) + .Where(u => u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC).Count(); + + return ResponseOutput.Ok(result, new { TotalToBeDealedCount = toBeDealedCount }); } @@ -372,12 +425,13 @@ namespace IRaCIS.Core.Application /// /// [HttpPost] - public async Task> GetImageCheckQuestionToBeDoneList(ImageCheckQuestionToBeDoneQuery inQuery, + public async Task>> GetImageCheckQuestionToBeDoneList(ImageCheckQuestionToBeDoneQuery inQuery, [FromServices] IRepository _subjectVisitRepository, [FromServices] IRepository _trialRepository) { var query = _trialRepository + .Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Select(t => new ImageCheckQuestionToBeDoneDto() { TrialId = t.Id, @@ -385,13 +439,21 @@ namespace IRaCIS.Core.Application ExperimentName = t.ExperimentName, TrialCode = t.TrialCode, UrgentCount = t.SubjectVisitList.Where(u => u.CheckState == CheckStateEnum.CVIng && u.CheckChallengeState == CheckChanllengeTypeEnum.PMWaitCRCReply && u.IsUrgent).Count(), - ToBeDealedCount = t.SubjectVisitList.Where(u => u.CheckState == CheckStateEnum.CVIng && u.CheckChallengeState == CheckChanllengeTypeEnum.PMWaitCRCReply).Count() + ToBeReplyedCount = t.SubjectVisitList.Where(u => u.CheckState == CheckStateEnum.CVIng && u.CheckChallengeState == CheckChanllengeTypeEnum.PMWaitCRCReply).Count() }); + + + var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc); - return result; + var toBeDealedCount = _subjectVisitRepository + .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) + .Where(u => u.CheckState == CheckStateEnum.CVIng && u.CheckChallengeState == CheckChanllengeTypeEnum.PMWaitCRCReply).Count(); + + return ResponseOutput.Ok(result, new { TotalToBeReplyedCount = toBeDealedCount }); + } @@ -403,12 +465,13 @@ namespace IRaCIS.Core.Application /// /// [HttpPost] - public async Task> GetImageReUploadToBeDoneList(ImageReUploadToBeDoneQuery inQuery, + public async Task>> GetImageReUploadToBeDoneList(ImageReUploadToBeDoneQuery inQuery, [FromServices] IRepository _subjectVisitRepository, [FromServices] IRepository _trialRepository) { var query = _trialRepository + .Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Select(t => new ImageReUploadToBeDoneDto() { TrialId = t.Id, @@ -416,13 +479,17 @@ namespace IRaCIS.Core.Application ExperimentName = t.ExperimentName, TrialCode = t.TrialCode, UrgentCount = t.SubjectVisitList.Where(u => u.SubmitState == SubmitStateEnum.ToSubmit && u.IsUrgent && u.IsPMBackOrReReading).Count(), - ToBeDealedCount = t.SubjectVisitList.Where(u => u.SubmitState == SubmitStateEnum.ToSubmit && u.IsPMBackOrReReading).Count(), + ToBeReUploadCount = t.SubjectVisitList.Where(u => u.SubmitState == SubmitStateEnum.ToSubmit && u.IsPMBackOrReReading).Count(), }); var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc); - return result; + var toBeDealedCount = _subjectVisitRepository + .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) + .Where(u => u.SubmitState == SubmitStateEnum.ToSubmit && u.IsPMBackOrReReading).Count(); + + return ResponseOutput.Ok(result, new { TotalToBeReUploadCount = toBeDealedCount }); } @@ -436,12 +503,13 @@ namespace IRaCIS.Core.Application /// /// [HttpPost] - public async Task> GetImageSubmittedToBeDoneList(ImageSubmittedToBeDoneQuery inQuery, + public async Task>> GetImageSubmittedToBeDoneList(ImageSubmittedToBeDoneQuery inQuery, [FromServices] IRepository _subjectVisitRepository, [FromServices] IRepository _trialRepository) { var query = _trialRepository + .Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Select(t => new ImageSubmittedToBeDoneDto() { TrialId = t.Id, @@ -455,7 +523,11 @@ namespace IRaCIS.Core.Application var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc); - return result; + var toBeDealedCount = _subjectVisitRepository + .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) + .Where(u => u.SubmitState == SubmitStateEnum.ToSubmit).Count(); + + return ResponseOutput.Ok(result, new { TotalToBeReUploadCount = toBeDealedCount }); } @@ -474,12 +546,14 @@ namespace IRaCIS.Core.Application /// /// [HttpPost] - public async Task> GetImageQualityToBeDoneList(ImageQualityToBeDoneQuery inQuery, + public async Task>> GetImageQualityToBeDoneList(ImageQualityToBeDoneQuery inQuery, [FromServices] IRepository _subjectVisitRepository, [FromServices] IRepository _trialRepository) { - var query = _trialRepository.Where(t => t.QCProcessEnum != TrialQCProcess.NotAudit) + var query = _trialRepository + .Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id)) + .Where(t => t.QCProcessEnum != TrialQCProcess.NotAudit) .Select(t => new ImageQualityToBeDoneDto() { TrialId = t.Id, @@ -501,7 +575,12 @@ namespace IRaCIS.Core.Application var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc); - return result; + + var toBeDealedCount = _subjectVisitRepository + .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) + .Where(u => u.SubmitState == SubmitStateEnum.ToSubmit).Count(); + + return ResponseOutput.Ok(result, new { TotalToBeReUploadCount = toBeDealedCount }); } @@ -513,12 +592,13 @@ namespace IRaCIS.Core.Application /// /// [HttpPost] - public async Task> GetQCImageQuestionToBeDoneList(ImageQuestionToBeDoneQuery inQuery, + public async Task>> GetQCImageQuestionToBeDoneList(ImageQuestionToBeDoneQuery inQuery, [FromServices] IRepository _subjectVisitRepository, [FromServices] IRepository _trialRepository) { var query = _trialRepository + .Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Select(t => new ImageQuestionToBeDoneDto() { TrialId = t.Id, @@ -534,7 +614,12 @@ namespace IRaCIS.Core.Application var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc); - return result; + var toBeDealedCount = _subjectVisitRepository + .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) + .SelectMany(c => c.QCChallengeList) + .Where(u => u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count(); + + return ResponseOutput.Ok(result, new { TotalToBeReUploadCount = toBeDealedCount }); } @@ -544,7 +629,7 @@ namespace IRaCIS.Core.Application #region IR待办 /// - /// IR 影像阅片 待阅量 复杂 --未完成 + /// IR 影像阅片 待阅量 /// /// /// @@ -552,12 +637,52 @@ namespace IRaCIS.Core.Application /// /// [HttpPost] - public async Task> GetIRImageReadingToBeDoneList(IRImageReadingToBeDoneQuery inQuery, + public async Task>> GetIRImageReadingToBeDoneList(IRImageReadingToBeDoneQuery inQuery, [FromServices] IRepository _visitTaskRepository, [FromServices] IRepository _trialReadingCriterionRepository, [FromServices] IRepository _trialRepository) { + + var newQuery = _trialReadingCriterionRepository.Where(t => t.IsConfirm == true && t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) + .Select(c => new IRImageReadingToBeDoneDto() + { + TrialId = c.TrialId, + ResearchProgramNo = c.Trial.ResearchProgramNo, + ExperimentName = c.Trial.ExperimentName, + TrialCode = c.Trial.TrialCode, + CriterionName = c.CriterionName, + TrialReadingCriterionId = c.Id, + + UrgentCount = c.VisitTaskList.AsQueryable().Where(t => t.DoctorUserId == _userInfo.Id && 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 => g.Key.IsAutoCreate ? !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(t => t.IsUrgent), + + + UnReadCount = c.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.Id && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect) + // 前序 不存在 未一致性核查未通过的 + .Where(t => !t.Subject.SubjectVisitList.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 => g.Key.IsAutoCreate ? !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(), + + + + HaveSignedCount = c.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.Id && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze) + && t.ReadingTaskState == ReadingTaskState.HaveSigned).Count(), + }) + + ; + + #region 废弃 //var query = _trialRepository // .Select(t => new IRImageReadingToBeDoneDto() // { @@ -585,48 +710,7 @@ namespace IRaCIS.Core.Application // }); - - var newQuery= _trialReadingCriterionRepository.Where(t=>t.IsConfirm==true && t.Trial.TrialUserList.Any(t=>t.UserId==_userInfo.Id)) - .Select(c => new IRImageReadingToBeDoneDto() - { - TrialId = c.TrialId, - ResearchProgramNo = c.Trial.ResearchProgramNo, - ExperimentName = c.Trial.ExperimentName, - TrialCode = c.Trial.TrialCode, - CriterionName = c.CriterionName, - TrialReadingCriterionId = c.Id, - - UrgentCount = c.VisitTaskList.AsQueryable().Where(t => t.DoctorUserId == _userInfo.Id && 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 => g.Key.IsAutoCreate ? !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(t => t.IsUrgent), - - - UnReadCount = c.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.Id && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect) - // 前序 不存在 未一致性核查未通过的 - .Where(t => !t.Subject.SubjectVisitList.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 => g.Key.IsAutoCreate ? !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(), - - - - HaveSignedCount = c.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.Id && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze) - && t.ReadingTaskState == ReadingTaskState.HaveSigned).Count(), - }) - - ; - - - - + // 不能对包含聚合或子查询的表达式执行聚合函数 //var query = _visitTaskRepository.Where(t => t.DoctorUserId == _userInfo.Id && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze)) // .GroupBy(t => new { t.TrialId, t.Trial.ResearchProgramNo, t.Trial.TrialCode, t.Trial.ExperimentName, t.TrialReadingCriterionId, t.TrialReadingCriterion.CriterionName, t.TrialReadingCriterion.IsAutoCreate }) @@ -662,10 +746,25 @@ namespace IRaCIS.Core.Application // && t.ReadingTaskState == ReadingTaskState.HaveSigned).Count(), // }); + #endregion - var result = await newQuery.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ?nameof(IRImageReadingToBeDoneDto.TrialId): inQuery.SortField, inQuery.Asc); - return result; + + var result = await newQuery.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(IRImageReadingToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc); + + var toBeDealedCount = _trialRepository + .Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id)) + .SelectMany(t => t.VisitTaskList) + .Where(t => t.DoctorUserId == _userInfo.Id && 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.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(); + + return ResponseOutput.Ok(result, new { TotalUnReadCount = toBeDealedCount }); } @@ -677,11 +776,12 @@ namespace IRaCIS.Core.Application /// [HttpPost] - public async Task> GetIRMedicalCommentsToBeDoneList(MedicalCommentsToBeDoneQuery inQuery, + public async Task>> GetIRMedicalCommentsToBeDoneList(MedicalCommentsToBeDoneQuery inQuery, [FromServices] IRepository _taskMedicalReviewRepository) { var query = _taskMedicalReviewRepository + .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Where(t => t.IsClosedDialog == false) .GroupBy(t => new { @@ -703,14 +803,19 @@ namespace IRaCIS.Core.Application UrgentCount = g.Where(u => u.VisitTask.IsUrgent && u.ReadingMedicalReviewDialogList.OrderByDescending(l => l.CreateTime).First().UserTypeEnumInt == (int)UserTypeEnum.MIM).Count(), - ToBeDealedCount = g.Where(u => + ToBeReplyedCount = g.Where(u => u.ReadingMedicalReviewDialogList.OrderByDescending(l => l.CreateTime).First().UserTypeEnumInt == (int)UserTypeEnum.MIM).Count(), }); var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc); - return result; + var toBeDealedCount = _taskMedicalReviewRepository + .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) + .Where(t => t.IsClosedDialog == false) + .Where(u => u.ReadingMedicalReviewDialogList.OrderByDescending(l => l.CreateTime).First().UserTypeEnumInt == (int)UserTypeEnum.MIM).Count(); + + return ResponseOutput.Ok(result, new { TotalToBeReUploadCount = toBeDealedCount }); } @@ -728,11 +833,12 @@ namespace IRaCIS.Core.Application /// [HttpPost] - public async Task> GetMIMMedicalCommentsToBeDoneList(MedicalCommentsToBeDoneQuery inQuery, + public async Task>> GetMIMMedicalCommentsToBeDoneList(MedicalCommentsToBeDoneQuery inQuery, [FromServices] IRepository _taskMedicalReviewRepository) { var query = _taskMedicalReviewRepository + .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Where(t => t.IsClosedDialog == false) .GroupBy(t => new { @@ -754,15 +860,63 @@ namespace IRaCIS.Core.Application UrgentCount = g.Where(u => u.VisitTask.IsUrgent && u.ReadingMedicalReviewDialogList.OrderByDescending(l => l.CreateTime).First().UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer).Count(), - ToBeDealedCount = g.Where(u => + ToBeReplyedCount = g.Where(u => u.ReadingMedicalReviewDialogList.OrderByDescending(l => l.CreateTime).First().UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer).Count(), }); var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc); - return result; + var toBeDealedCount = _taskMedicalReviewRepository + .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) + .Where(t => t.IsClosedDialog == false) + .Where(u => u.ReadingMedicalReviewDialogList.OrderByDescending(l => l.CreateTime).First().UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer).Count(); + return ResponseOutput.Ok(result, new { TotalToBeReUploadCount = toBeDealedCount }); + + } + + #endregion + + + #region 项目列表查询 + + + [HttpPost] + public async Task>> GetTrialToBeDoneList(TrialToBeDoneQuery inQuery, + [FromServices] IRepository _taskMedicalReviewRepository) + { + + + + var query = _trialRepository.AsQueryable().IgnoreQueryFilters() + + .WhereIf(inQuery.SponsorId != null, o => o.SponsorId == inQuery.SponsorId) + .WhereIf(!string.IsNullOrEmpty(inQuery.Code), o => o.TrialCode.Contains(inQuery.Code)) + .WhereIf(!string.IsNullOrEmpty(inQuery.ResearchProgramNo), o => o.ResearchProgramNo.Contains(inQuery.ResearchProgramNo)) + .WhereIf(!string.IsNullOrWhiteSpace(inQuery.ExperimentName), o => o.ExperimentName.Contains(inQuery.ExperimentName)) + .WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin, t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id && t.IsDeleted == false) && t.IsDeleted == false) + .Select(t => new TrialToBeDoneDto() + { + TrialId = t.Id, + ResearchProgramNo = t.ResearchProgramNo, + ExperimentName = t.ExperimentName, + TrialCode = t.TrialCode, + CreateTime=t.CreateTime, + Sponsor= _userInfo.IsEn_Us? t.Sponsor.SponsorName:t.Sponsor.SponsorNameCN, + TrialStatusStr=t.TrialStatusStr, + + + + }); + + + + //.ProjectTo(_mapper.ConfigurationProvider, new { userTypeEnumInt = _userInfo.UserTypeEnumInt, userId = _userInfo.Id }); + + var result= await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? "CreateTime" : inQuery.SortField, inQuery.Asc); + + return ResponseOutput.Ok(result, new { TotalToBeReUploadCount = 0 }); } #endregion diff --git a/IRaCIS.Core.Domain/Allocation/VisitTaskReReading.cs b/IRaCIS.Core.Domain/Allocation/VisitTaskReReading.cs index f33650584..55e949d0c 100644 --- a/IRaCIS.Core.Domain/Allocation/VisitTaskReReading.cs +++ b/IRaCIS.Core.Domain/Allocation/VisitTaskReReading.cs @@ -17,7 +17,7 @@ namespace IRaCIS.Core.Domain.Models [Table("VisitTaskReReading")] public class VisitTaskReReading : Entity, IAuditUpdate, IAuditAdd { - + public Guid TrialId { get; set; } //重阅原始任务Id 重阅会产生新的任务 public Guid OriginalReReadingTaskId { get; set; } From 7a2a05063ba1e38faee803c753056735bd2c0c92 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 13 Jun 2023 11:43:14 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=82=AE=E4=BB=B6?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EmailTemplate/AdminAddUser_US.html | 16 +++++------ .../EmailTemplate/AdminResetUser_US.html | 14 +++++----- .../SubjectEnrollConfirmOrPDProgress_US.html | 14 +++++----- .../EmailTemplate/TrialDoctorExistJoin.html | 2 +- .../TrialDoctorExistJoin_US.html | 17 +++++------- .../TrialDoctorFirstJoin_US.html | 27 ++++++++++--------- .../TrialSiteSurveyReject_US.html | 20 +++++++------- .../EmailTemplate/TrialUserExistJoin_US.html | 22 +++++++-------- .../EmailTemplate/TrialUserFirstJoin.html | 2 +- .../EmailTemplate/TrialUserFirstJoin_US.html | 20 +++++++------- .../wwwroot/EmailTemplate/UserOptCommon.html | 4 +-- .../EmailTemplate/UserOptCommon_US.html | 20 +++++++------- .../Service/Common/MailService.cs | 3 --- .../DTO/PersonalWorkstationViewModel.cs | 6 ++++- .../TrialSiteUser/PersonalWorkstation.cs | 9 +++++++ IRaCIS.Core.Domain/SQLFile/20230613.sql | 8 ++++++ IRaCIS.Core.Domain/Trial/Trial.cs | 3 +++ 17 files changed, 114 insertions(+), 93 deletions(-) create mode 100644 IRaCIS.Core.Domain/SQLFile/20230613.sql diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/AdminAddUser_US.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/AdminAddUser_US.html index fb1ff4e02..81f3aa200 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/AdminAddUser_US.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/AdminAddUser_US.html @@ -4,17 +4,17 @@ Title - -
+ +
-
+
Dear {0} ,
-
+
Extensive Imaging has generated a user account for you.
The account information is as follows:
-
+
User ID: {1}
@@ -23,16 +23,16 @@
Before logging in for the first time, please initialize your account information through this link: - + Initialize Account Information
-
+
Best regards,
-
Extensive Imaging
+
Extensive Imaging
diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/AdminResetUser_US.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/AdminResetUser_US.html index 05f730795..37b035715 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/AdminResetUser_US.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/AdminResetUser_US.html @@ -4,17 +4,17 @@ Title - -
+ +
-
+
Dear {0} ,
-
+
Extensive Imaging has reset your password.
The account information is as follows:
-
+
User ID: {1}
@@ -27,9 +27,9 @@
-
+
Best regards,
-
Extensive Imaging
+
Extensive Imaging
diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/SubjectEnrollConfirmOrPDProgress_US.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/SubjectEnrollConfirmOrPDProgress_US.html index 4ab2379c8..4607c5af2 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/SubjectEnrollConfirmOrPDProgress_US.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/SubjectEnrollConfirmOrPDProgress_US.html @@ -4,22 +4,22 @@ Title - -
+ +
-
+
Dear Sir or Madam:
-
+
Thank you for using our IRC imaging system.
-
+
{0}。
-
+
Best regards,
-
Extensive Imaging
+
Extensive Imaging
diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorExistJoin.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorExistJoin.html index 0bf1fb2ad..5e154e16f 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorExistJoin.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorExistJoin.html @@ -11,7 +11,7 @@ 尊敬的 {0} ,您好:
- 展影医疗作为 [{1} (试验方案号:{2 })] 项目的IRC供应商,诚邀您参加该项目IRC阅片相关工作,欢迎您提供指导和建议,非常感谢! + 展影医疗作为 [{1} (试验方案号:{2 })] 项目的IRC供应商,诚邀您参加该项目IRC阅片相关工作。
该项目采用电子化工作流,系统及您的账号信息如下: diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorExistJoin_US.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorExistJoin_US.html index a2bda514d..af5a32a3e 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorExistJoin_US.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorExistJoin_US.html @@ -4,20 +4,20 @@ Title - +
-
+
Dear {0},
-
+
As the IRC service provider of {1} trial(Protocol ID is {2}), Extensive Imaging invites you to participate in the independent assessment work of this trial.
-
+
Digital workflow is implemented for this trial, and your account information is as follows:
-
+
Trial ID: {3}
@@ -37,13 +37,10 @@ Login URL: {6}
-
- Your opinions and suggestions will be greatly appreciated! -
-
+
Best regards,
-
Extensive Imaging
+
Extensive Imaging
diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorFirstJoin_US.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorFirstJoin_US.html index 7f047145e..83d919950 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorFirstJoin_US.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialDoctorFirstJoin_US.html @@ -4,20 +4,21 @@ Title - +
-
+
Dear {0},
-
- As the IRC service provider of {1}trial (Protocol ID is {2}), Extensive Imaging invites you to participate in the independent assessment work of this trial. Your opinions and suggestions will be greatly appreciated! +
+ As the IRC service provider of {1}trial (Protocol ID is {2}), Extensive Imaging invites you to participate in the independent assessment work of this trial.
-
+
+
Digital workflow is implemented for this trial, and your account information is as follows:
-
+
Trial ID: {3}
@@ -25,26 +26,26 @@ Protocol ID: {2}
- Study name: {1} + Study Name: {1}
- User name: {4} + User ID: {4}
Role: {5}
-
+
Best regards,
-
Extensive Imaging
+
Extensive Imaging
diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialSiteSurveyReject_US.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialSiteSurveyReject_US.html index 7c69afd20..caa38e3b7 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialSiteSurveyReject_US.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialSiteSurveyReject_US.html @@ -4,17 +4,17 @@ Title - -
-
-
+ +
+
+
Dear {0} ,
-
- The site survey you filled in has been rejected. The details are as follows: +
+ The site survey questionnaire you filled in has been rejected. Details are as follows:
-
+
Trial ID: {1}
@@ -35,13 +35,13 @@
- + Login & View -
+
Best regards,
-
Extensive Imaging
+
Extensive Imaging
diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserExistJoin_US.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserExistJoin_US.html index 4c4c9a5a6..5e33fc801 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserExistJoin_US.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserExistJoin_US.html @@ -4,20 +4,20 @@ Title - -
-
-
+ +
+
+
Dear {0},
-
- As the IRC service provider of {1}trial(Protocol ID is {2}), Extensive Imaging invites you to participate in the independent assessment work of this trial. +
+ As the IRC service provider of {1} trial (Protocol ID is {2}), Extensive Imaging invites you to participate in IRC-related work of this trial.
-
+
Digital workflow is implemented for this trial, and your account information is as follows:
-
+
Trial ID: {3}
@@ -34,14 +34,14 @@ Role: {5}
- System login URL:{6} + Login URL: {6}
-
+
Best regards,
-
Extensive Imaging
+
Extensive Imaging
diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserFirstJoin.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserFirstJoin.html index 46c2a7b80..48019299e 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserFirstJoin.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserFirstJoin.html @@ -11,7 +11,7 @@ 尊敬的 {0} ,您好:
- 展影医疗作为 [{1} (试验方案号:{2 })] 项目的IRC供应商,诚邀您参加该项目IRC相关工作,欢迎您提供指导和建议,非常感谢! + 展影医疗作为 [{1} (试验方案号:{2 })] 项目的IRC供应商,诚邀您参加该项目IRC相关工作。
该项目采用电子化工作流,系统及您的账号信息如下: diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserFirstJoin_US.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserFirstJoin_US.html index eb260fff1..e402530d6 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserFirstJoin_US.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/TrialUserFirstJoin_US.html @@ -4,20 +4,20 @@ Title - +
-
+
Dear {0},
-
- As the IRC service provider of {1}trial(Protocol ID is {2}). Extiming sincerely invites you to participate in the IRC related work of this project. Your guidance and suggestions are welcome. +
+ As the IRC service provider of {1} trial (Protocol ID is {2}), Extensive Imaging invites you to participate in IRC-related work of this trial.
Digital workflow is implemented for this trial, and your account information is as follows:
-
+
Trial ID: {3}
@@ -34,17 +34,17 @@ Role: {5}
-
+
Best regards,
-
Extensive Imaging
+
Extensive Imaging
diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/UserOptCommon.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/UserOptCommon.html index f9ed9d945..d6bfd963e 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/UserOptCommon.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/UserOptCommon.html @@ -8,13 +8,13 @@
- 亲爱的用户 {0}, + 亲爱的用户 ,
感谢您使用展影云平台。
- {1},验证码是: {2},请在3分钟内输入该验证码,进行后续操作。如非本人操作,请忽略该邮件。 + {0},验证码是: {1},请在3分钟内输入该验证码,进行后续操作。如非本人操作,请忽略该邮件。
diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/UserOptCommon_US.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/UserOptCommon_US.html index 0ec66aabd..b5edfaf7c 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/UserOptCommon_US.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/UserOptCommon_US.html @@ -4,23 +4,25 @@ Title - +
-
- Dear Sir or Madam {0}, +
+ Dear Sir or Madam:
-
+
Thank you for using our IRC imaging system.
-
- {1}, the verification code is {2}. Enter the verification code within 3 minutes for subsequent operations. Please ignore this email if not by yourself. +
+ {1}, the verification code is {2}. Please enter this code within 3 minutes for follow-up operations. +
+
+ If you are not the intended person, please ignore this email.
- -
+
Best regards,
-
Extensive Imaging
+
Extensive Imaging
diff --git a/IRaCIS.Core.Application/Service/Common/MailService.cs b/IRaCIS.Core.Application/Service/Common/MailService.cs index f784e4c89..5f6e58120 100644 --- a/IRaCIS.Core.Application/Service/Common/MailService.cs +++ b/IRaCIS.Core.Application/Service/Common/MailService.cs @@ -186,7 +186,6 @@ namespace IRaCIS.Application.Services builder.HtmlBody = string.Format(templateInfo, - "", //---您正在进行邮箱重置密码操作 _localizer["Mail_ResettingPassword "], verificationCode @@ -254,7 +253,6 @@ namespace IRaCIS.Application.Services builder.HtmlBody = string.Format(templateInfo, - "", //---您正在参与展影医疗IRC项目 _localizer["Mail_IRCProject"], verificationCode @@ -321,7 +319,6 @@ namespace IRaCIS.Application.Services builder.HtmlBody = string.Format(templateInfo, - "", //---您正在参与展影医疗IRC项目中心调研工作 _localizer["Mail_CenterResearchReminder"], verificationCode diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/PersonalWorkstationViewModel.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/PersonalWorkstationViewModel.cs index d3604a473..f7672f53f 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/PersonalWorkstationViewModel.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/PersonalWorkstationViewModel.cs @@ -268,11 +268,15 @@ namespace IRaCIS.Core.Application.Contracts public string TrialStatusStr { get; set; } - public int? ExpetiedTaskCount { get; set; } + public int? ReReadingApprovalCount { get; set; } + + public int? PendingReconciliation { get; set; } + + } diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs index 49710b2be..8268127c3 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs @@ -887,6 +887,11 @@ namespace IRaCIS.Core.Application [FromServices] IRepository _taskMedicalReviewRepository) { + var isPM = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager; + var isCRC = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator; + 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 query = _trialRepository.AsQueryable().IgnoreQueryFilters() @@ -906,6 +911,10 @@ namespace IRaCIS.Core.Application Sponsor= _userInfo.IsEn_Us? t.Sponsor.SponsorName:t.Sponsor.SponsorNameCN, TrialStatusStr=t.TrialStatusStr, + ExpetiedTaskCount= isPM ? t.VisitTaskList.Where(t=>t.IsUrgent).Count():0, + ReReadingApprovalCount= isPM? t.VisitTaskReReadingList.Where(t=>t.OriginalReReadingTask.ReReadingApplyState==ReReadingApplyState.DocotorHaveApplyed).Count():0, + PendingReconciliation=isPM? t.SubjectVisitList.Where(t=>t.CheckState==CheckStateEnum.ToCheck).Count():0, + }); diff --git a/IRaCIS.Core.Domain/SQLFile/20230613.sql b/IRaCIS.Core.Domain/SQLFile/20230613.sql new file mode 100644 index 000000000..0eafb3ce4 --- /dev/null +++ b/IRaCIS.Core.Domain/SQLFile/20230613.sql @@ -0,0 +1,8 @@ +--同步重阅申请表结构后,再维护该字段 + +UPDATE VisitTaskReReading +SET TrialId = VisitTask.TrialId +FROM VisitTaskReReading +INNER JOIN VisitTask ON VisitTaskReReading.OriginalReReadingTaskId = VisitTask.Id; + +delete VisitTaskReReading where TrialId is NULL \ No newline at end of file diff --git a/IRaCIS.Core.Domain/Trial/Trial.cs b/IRaCIS.Core.Domain/Trial/Trial.cs index ad71a19eb..86afacb29 100644 --- a/IRaCIS.Core.Domain/Trial/Trial.cs +++ b/IRaCIS.Core.Domain/Trial/Trial.cs @@ -27,6 +27,9 @@ namespace IRaCIS.Core.Domain.Models public List SubjectDoctorUserList { get; set; } = new List(); [JsonIgnore] public List VisitTaskList { get; set; } = new List() { }; + + [JsonIgnore] + public List VisitTaskReReadingList { get; set; } [JsonIgnore] public List TrialSiteSurveyList { get; set; } = new List(); From 2aea40d26f43891a58a05ed140ecc8263d522df1 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 13 Jun 2023 11:56:07 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E6=B5=8B=E8=AF=95html=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.API/wwwroot/EmailTemplate/UserOptCommon_US.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.API/wwwroot/EmailTemplate/UserOptCommon_US.html b/IRaCIS.Core.API/wwwroot/EmailTemplate/UserOptCommon_US.html index b5edfaf7c..e828eb2ea 100644 --- a/IRaCIS.Core.API/wwwroot/EmailTemplate/UserOptCommon_US.html +++ b/IRaCIS.Core.API/wwwroot/EmailTemplate/UserOptCommon_US.html @@ -14,7 +14,7 @@ Thank you for using our IRC imaging system.
- {1}, the verification code is {2}. Please enter this code within 3 minutes for follow-up operations. + {0}, the verification code is {1}. Please enter this code within 3 minutes for follow-up operations.
If you are not the intended person, please ignore this email. From 779b07b1b5d495ecb923a6f451e9ebb05b459e87 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 13 Jun 2023 16:56:13 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=99=90=E5=88=B6?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=B8=AD=E9=97=B4=E4=BB=B6=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LimitUserRequestAuthorization.cs | 8 ++++--- .../DTO/PersonalWorkstationViewModel.cs | 13 +++++++++- .../TrialSiteUser/PersonalWorkstation.cs | 24 ++++++++++++------- 3 files changed, 32 insertions(+), 13 deletions(-) diff --git a/IRaCIS.Core.Application/BusinessFilter/LimitUserRequestAuthorization.cs b/IRaCIS.Core.Application/BusinessFilter/LimitUserRequestAuthorization.cs index 4bdcc0761..dda88370f 100644 --- a/IRaCIS.Core.Application/BusinessFilter/LimitUserRequestAuthorization.cs +++ b/IRaCIS.Core.Application/BusinessFilter/LimitUserRequestAuthorization.cs @@ -3,6 +3,7 @@ using IRaCIS.Core.Domain.Share; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.Extensions.Localization; using Microsoft.Extensions.Options; using Newtonsoft.Json; @@ -11,9 +12,9 @@ namespace IRaCIS.Core.Application.Filter; -public class LimitUserRequestAuthorization :BaseService, IAsyncAuthorizationFilter +public class LimitUserRequestAuthorization : IAsyncAuthorizationFilter { - + public IStringLocalizer _localizer { get; set; } private readonly IEasyCachingProvider _provider; @@ -21,11 +22,12 @@ public class LimitUserRequestAuthorization :BaseService, IAsyncAuthorizationFilt private readonly IOptionsMonitor _verifyConfig; - public LimitUserRequestAuthorization(IEasyCachingProvider provider, IUserInfo userInfo, IOptionsMonitor verifyConfig) + public LimitUserRequestAuthorization(IEasyCachingProvider provider, IUserInfo userInfo, IStringLocalizer localizer ,IOptionsMonitor verifyConfig) { _provider = provider; _userInfo = userInfo; _verifyConfig = verifyConfig; + _localizer = localizer; } diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/PersonalWorkstationViewModel.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/PersonalWorkstationViewModel.cs index f7672f53f..6976ac903 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/PersonalWorkstationViewModel.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/PersonalWorkstationViewModel.cs @@ -274,8 +274,19 @@ namespace IRaCIS.Core.Application.Contracts public int? ReReadingApprovalCount { get; set; } - public int? PendingReconciliation { get; set; } + public int? PendingReconciliationCount { get; set; } + public int? PendingResponseCount { get; set; } + + public bool IsIQCHaveToBeDone { get; set; } + public bool IsCRCHaveToBeDone { get; set; } + + public bool IsMIMHaveToBeDone { get; set; } + + + public bool IsIRHaveToBeDone { get; set; } + + public bool IsSPMOrCPMHaveToBeDone { get; set; } } diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs index 8268127c3..d96ae367b 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs @@ -561,14 +561,14 @@ namespace IRaCIS.Core.Application ExperimentName = t.ExperimentName, TrialCode = t.TrialCode, - // 待审核 加急的(待领取 已领取)-- 领取了 还没做 就是待审核 + // 待审核 加急的(待领取 已领取)-- 领取了 还没做完 就是待审核 UrgentCount = t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.Id && u.IsUrgent).Count(), //待领取量 - ToBeClaimedCount = t.SubjectVisitList.Where(u => u.SubmitState == SubmitStateEnum.ToSubmit).Count(), + ToBeClaimedCount = t.SubjectVisitList.Where(u =>u.CurrentActionUserId==null &&(u.PreliminaryAuditUserId==null ||(u.PreliminaryAuditUserId!=_userInfo.Id && u.ReviewAuditUserId==null)) ).Count(), - //已领取 待审核 审核中 (审核完成 领取人就会清理 所以只用查询当前领取人是自己的就好了) + //待审核通过,统计从已领取到QC提交之间的 已领取 待审核 审核中 (审核完成 领取人就会清理 所以只用查询当前领取人是自己的就好了) ToBeReviewedCount = t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.Id).Count() }); @@ -576,11 +576,16 @@ namespace IRaCIS.Core.Application var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc); - var toBeDealedCount = _subjectVisitRepository + var toBeClaimedCount = _subjectVisitRepository .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) - .Where(u => u.SubmitState == SubmitStateEnum.ToSubmit).Count(); + .Where(u => u.CurrentActionUserId == null && (u.PreliminaryAuditUserId == null || (u.PreliminaryAuditUserId != _userInfo.Id && u.ReviewAuditUserId == null))).Count(); - return ResponseOutput.Ok(result, new { TotalToBeReUploadCount = toBeDealedCount }); + + var toBeReviwedCount = _subjectVisitRepository.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) + .Where(u => u.CurrentActionUserId == _userInfo.Id).Count(); + + + return ResponseOutput.Ok(result, new { TotalToBeClaimedCount = toBeClaimedCount, TotalToBeReviewedCount= toBeReviwedCount }); } @@ -658,7 +663,7 @@ namespace IRaCIS.Core.Application // 前序 不存在 未一致性核查未通过的 .Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum)) //前序 不存在 未生成任务的访视 - //.Where(t => g.Key.IsAutoCreate ? !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum) : true) + .Where(t => c.IsAutoCreate ? !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(t => t.IsUrgent), @@ -669,7 +674,7 @@ namespace IRaCIS.Core.Application .Where(t => !t.Subject.SubjectVisitList.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 => g.Key.IsAutoCreate ? !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum) : true) + .Where(t => c.IsAutoCreate ? !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(), @@ -913,7 +918,8 @@ namespace IRaCIS.Core.Application ExpetiedTaskCount= isPM ? t.VisitTaskList.Where(t=>t.IsUrgent).Count():0, ReReadingApprovalCount= isPM? t.VisitTaskReReadingList.Where(t=>t.OriginalReReadingTask.ReReadingApplyState==ReReadingApplyState.DocotorHaveApplyed).Count():0, - PendingReconciliation=isPM? t.SubjectVisitList.Where(t=>t.CheckState==CheckStateEnum.ToCheck).Count():0, + PendingReconciliationCount=isPM? t.SubjectVisitList.Where(t=>t.CheckState==CheckStateEnum.ToCheck).Count():0, +