一致性分析筛选+ 退回和重阅增加APM角色

This commit is contained in:
2024-06-28 11:30:20 +08:00
parent 49993edb37
commit 4585b7b732
3 changed files with 55 additions and 38 deletions
@@ -19,6 +19,7 @@ using Medallion.Threading;
using IRaCIS.Core.Infrastructure.Extention;
using System;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using NPOI.SS.Formula.Functions;
namespace IRaCIS.Core.Application.Service
{
@@ -178,9 +179,7 @@ namespace IRaCIS.Core.Application.Service
var list = await GetIQueryableDoctorSelfConsistentSubjectView(filterObj, doctorUserId, inCommand.SubejctIdList).ToListAsync();
//var (group, query) = GetIQueryableDoctorSelfConsistentRuleSubjectView(filterObj, inCommand.SubejctIdList);
//var list = query.OrderByDescending(t => t.IsHaveGeneratedTask).ToList();
var @lock = _distributedLockProvider.CreateLock($"VisitTaskCode");
@@ -552,7 +551,8 @@ namespace IRaCIS.Core.Application.Service
var subjectQuery = _subjectRepository.Where(t => t.TrialId == trialId &&
t.SubjectVisitTaskList.AsQueryable().Where(visitTaskFilter).Count() >= filterObj.PlanVisitCount)
.WhereIf(filterObj.IsHaveReadingPeriod == true, u => u.SubjectVisitTaskList.AsQueryable().Where(comonTaskFilter).Where(t => t.ReadingCategory == ReadingCategory.Visit || t.ReadingCategory == ReadingCategory.Global).OrderBy(t => t.VisitTaskNum).Take(filterObj.PlanVisitCount + 1).Any(t => t.ReadingCategory == ReadingCategory.Global))
.WhereIf(filterObj.IsHaveReadingPeriod == true, u => u.SubjectVisitTaskList.AsQueryable().Where(comonTaskFilter)
.Where(t => t.ReadingCategory == ReadingCategory.Visit || t.ReadingCategory == ReadingCategory.Global).Any(t => t.ReadingCategory == ReadingCategory.Global))
;
@@ -596,29 +596,27 @@ namespace IRaCIS.Core.Application.Service
IsClinicalDataSign = c.IsClinicalDataSign,
IsNeedClinicalDataSign = c.IsNeedClinicalDataSign,
//自身一致性才有意义
//IsHaveGeneratedTask = c.Subject.SubjectVisitTaskList.Any(t => t.ConsistentAnalysisOriginalTaskId == c.Id),
GlobalVisitTaskList = c.Subject.SubjectVisitTaskList.AsQueryable().Where(comonTaskFilter).Where(t => t.VisitTaskNum == c.VisitTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Global]).Select(c => new VisitTaskSimpleDTO()
{
Id = c.Id,
ReadingCategory = c.ReadingCategory,
ReadingTaskState = c.ReadingTaskState,
TaskBlindName = c.TaskBlindName,
TaskCode = c.TaskCode,
TaskName = c.TaskName,
TaskState = c.TaskState,
ArmEnum = c.ArmEnum,
SubjectId = c.SubjectId,
VisitTaskNum = c.VisitTaskNum,
TrialId = c.TrialId,
SourceSubjectVisitId = c.SourceSubjectVisitId,
SouceReadModuleId = c.SouceReadModuleId,
//GlobalVisitTaskList = c.Subject.SubjectVisitTaskList.AsQueryable().Where(comonTaskFilter).Where(t => t.VisitTaskNum == c.VisitTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Global]).Select(c => new VisitTaskSimpleDTO()
//{
// Id = c.Id,
// ReadingCategory = c.ReadingCategory,
// ReadingTaskState = c.ReadingTaskState,
// TaskBlindName = c.TaskBlindName,
// TaskCode = c.TaskCode,
// TaskName = c.TaskName,
// TaskState = c.TaskState,
// ArmEnum = c.ArmEnum,
// SubjectId = c.SubjectId,
// VisitTaskNum = c.VisitTaskNum,
// TrialId = c.TrialId,
// SourceSubjectVisitId = c.SourceSubjectVisitId,
// SouceReadModuleId = c.SouceReadModuleId,
TrialReadingCriterionId = c.TrialReadingCriterionId,
IsClinicalDataSign = c.IsClinicalDataSign,
IsNeedClinicalDataSign = c.IsNeedClinicalDataSign,
}).ToList(),
// TrialReadingCriterionId = c.TrialReadingCriterionId,
// IsClinicalDataSign = c.IsClinicalDataSign,
// IsNeedClinicalDataSign = c.IsNeedClinicalDataSign,
//}).ToList(),
}).ToList()
});
@@ -795,7 +793,14 @@ namespace IRaCIS.Core.Application.Service
t.SubjectVisitTaskList.AsQueryable().Where(comonTaskFilter)
.Where(t => t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId && t.SignTime!.Value.AddDays(taskConsistentRule.IntervalWeeks * 7) < DateTime.Now && t.DoctorUserId == user.Id)
.Where(t => t.ReadingCategory == ReadingCategory.Visit || t.ReadingCategory == ReadingCategory.Global).OrderBy(t => t.VisitTaskNum).Take(taskConsistentRule.PlanVisitCount + 1).Any(t => t.ReadingCategory == ReadingCategory.Global))
.Where(t => t.ReadingCategory == ReadingCategory.Visit || t.ReadingCategory == ReadingCategory.Global).Any(t => t.ReadingCategory == ReadingCategory.Global)
&&
t.SubjectVisitTaskList.AsQueryable().Where(visitTaskFilter)
.Where(t => t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId && t.SignTime!.Value.AddDays(taskConsistentRule.IntervalWeeks * 7) < DateTime.Now && t.DoctorUserId == user.Id)
.Count()>= taskConsistentRule.PlanVisitCount
)
.Count(),