This commit is contained in:
he
2023-01-15 14:20:57 +08:00
8 changed files with 77 additions and 17 deletions
@@ -298,7 +298,6 @@ namespace IRaCIS.Application.Services
var needSignCount = 0;
var haveSignedCount = _readingClinicalDataRepository.Where(t => t.TrialId == trialId && t.IsSign && t.ReadingClinicalDataState == ReadingClinicalDataStatus.HaveSigned && t.ReadingId == readingId && t.ClinicalDataTrialSet.UploadRole == UploadRole.PM).Count();
Expression<Func<VisitTask, bool>> visitTaskLambda = x => x.TrialId == trialId && x.SubjectId == subjectId && x.TrialReadingCriterionId == trialReadingCritrialId;
if (isVisit)
{
@@ -315,7 +314,8 @@ namespace IRaCIS.Application.Services
needSignCount = trialClinicalDataSetList.Where(t => t.CriterionEnumList.Any(c => c == (int)criterionType) && t.ClinicalDataLevel == ClinicalLevel.SubjectVisit && t.UploadRole == UploadRole.PM).Count();
}
if (needSignCount == haveSignedCount && needSignCount != 0)
//可能仅仅CRC 基线 没有PM
if (needSignCount == haveSignedCount /*&& needSignCount != 0*/)
{
//将该标准 该subject 该访视 任务临床数据状态变更
@@ -326,7 +326,7 @@ namespace IRaCIS.Application.Services
}
}
else
{
@@ -344,7 +344,8 @@ namespace IRaCIS.Application.Services
needSignCount = trialClinicalDataSetList.Where(t => t.CriterionEnumList.Any(c => c == (int)criterionType) && t.ClinicalDataLevel == ClinicalLevel.OncologyRead).Count();
}
if (needSignCount == haveSignedCount && needSignCount != 0)
//可能仅仅CRC 基线 没有PM
if (needSignCount == haveSignedCount /*&& needSignCount != 0*/)
{
//将该标准 该subject 该阅片期|肿瘤学 任务临床数据状态变更
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.TrialId == trialId && t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCritrialId && t.SouceReadModuleId == readingId, u => new VisitTask()
@@ -357,16 +358,32 @@ namespace IRaCIS.Application.Services
}
Expression<Func<VisitTask, bool>> 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)).Select(t => t.Id);
.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);
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => visitTaskIdQueryable2.Contains(t.Id), u => new VisitTask()
{
IsFrontTaskNeedSignButNotSign = false
});
}