Uat_Study
he 2023-03-28 17:00:57 +08:00
parent e8f2dfc5d6
commit b0a3aa4b18
4 changed files with 139 additions and 95 deletions

View File

@ -1,4 +1,4 @@
//--------------------------------------------------------------------
//--------------------------------------------------------------------
// 此代码由T4模板自动生成 byzhouhang 20210918
// 生成时间 2022-06-07 14:10:49
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
@ -109,7 +109,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
if (list.Count == 0)
{
throw new BusinessValidationFailedException("该项目还未确认任何一个阅片标准");
//---该项目还未确认任何一个阅片标准
throw new BusinessValidationFailedException(_localizer["VisitTask_VisitTask_TaskAlreadyApplied"]);
}
@ -136,7 +137,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
.WhereIf(querySubjectAssign.SubjectId != null, t => t.Id == querySubjectAssign.SubjectId)
.WhereIf(querySubjectAssign.DoctorUserId != null, t => t.SubjectDoctorList.Any(t => t.DoctorUserId == querySubjectAssign.DoctorUserId && t.TrialReadingCriterionId == querySubjectAssign.TrialReadingCriterionId))
.WhereIf(!string.IsNullOrEmpty(querySubjectAssign.SubjectCode), t => t.Code.Contains(querySubjectAssign.SubjectCode))
.WhereIf(isAddtinoarlCriterion, t => t.SubjectCriteriaEvaluationList.Where(t=>t.TrialReadingCriterionId==querySubjectAssign.TrialReadingCriterionId).Any(t=>t.IsJoinEvaluation))
.WhereIf(isAddtinoarlCriterion, t => t.SubjectCriteriaEvaluationList.Where(t => t.TrialReadingCriterionId == querySubjectAssign.TrialReadingCriterionId).Any(t => t.IsJoinEvaluation))
.ProjectTo<SubjectAssignStat>(_mapper.ConfigurationProvider, new { trialReadingCriterionId = querySubjectAssign.TrialReadingCriterionId });
@ -265,7 +266,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
{
if (await _visitTaskRepository.AnyAsync(t => t.TrialReadingCriterionId == cancelCommand.TrialReadingCriterionId && t.SubjectId == command.SubjectId && t.DoctorUserId == command.DoctorUserId && t.ArmEnum == command.ArmEnum && t.ReadingTaskState != ReadingTaskState.WaitReading))
{
throw new BusinessValidationFailedException("当前医生已开始做该Subject 该标准的任务,不允许取消分配");
//---当前医生已开始做该Subject 该标准的任务,不允许取消分配
throw new BusinessValidationFailedException(_localizer["VisitTask_DoctorConfigNotFound"]);
}
await _subjectUserRepository.DeleteFromQueryAsync(t => t.Id == command.Id);
@ -312,25 +314,29 @@ namespace IRaCIS.Core.Application.Service.Allocation
if (await _visitTaskRepository.AnyAsync(t => t.SourceSubjectVisitId == visitTask.SourceSubjectVisitId && t.TaskAllocationState == TaskAllocationState.Allocated && t.DoctorUserId == assignSubjectTaskToDoctorCommand.DoctorUserId && t.Id != visitTask.Id))
{
return ResponseOutput.NotOk("其中一个任务已分配给该医生,不允许分配");
//---其中一个任务已分配给该医生,不允许分配
return ResponseOutput.NotOk(_localizer["VisitTask_BackendDataError"]);
}
}
else if (visitTask.SouceReadModuleId != null)
{
if (await _visitTaskRepository.AnyAsync(t => t.SouceReadModuleId == visitTask.SouceReadModuleId && t.TaskAllocationState == TaskAllocationState.Allocated && t.DoctorUserId == assignSubjectTaskToDoctorCommand.DoctorUserId && t.Id != visitTask.Id))
{
return ResponseOutput.NotOk("其中一个任务已分配给该医生,不允许分配");
//---其中一个任务已分配给该医生,不允许分配
return ResponseOutput.NotOk(_localizer["VisitTask_BackendDataError"]);
}
}
else
{
throw new BusinessValidationFailedException("出现脏数据 任务来源字段没有值");
//---出现脏数据 任务来源字段没有值
throw new BusinessValidationFailedException(_localizer["VisitTask_DirtyData"]);
}
//PM 回退了 但是还没生成任务 当前任务编号前有访视进行了回退就不允许分配
if (await _subjectVisitRepository.AnyAsync(t => t.SubjectId == visitTask.SubjectId && t.IsPMBackOrReReading && t.VisitNum <= visitTask.VisitTaskNum))
{
return ResponseOutput.NotOk("该受试者有访视进入了退回流程,还未经过一致性核查通过,不允许分配");
//---该受试者有访视进入了退回流程,还未经过一致性核查通过,不允许分配
return ResponseOutput.NotOk(_localizer["VisitTask_MissingTaskSource"]);
}
@ -473,12 +479,14 @@ namespace IRaCIS.Core.Application.Service.Allocation
if (await _subjectUserRepository.AnyAsync(t => t.TrialId == trialId && t.SubjectId == subjectId && t.DoctorUserId == doctorUserId && t.ArmEnum != armEnum && t.OrignalSubjectUserId == null))
{
throw new BusinessValidationFailedException("有Subject 在其他Arm组已有该医生不允许在新的组添加该医生");
//---有Subject 在其他Arm组已有该医生不允许在新的组添加该医生
throw new BusinessValidationFailedException(_localizer["VisitTask_InconsistentSubjectStatus"]);
}
if (await _subjectUserRepository.AnyAsync(t => t.TrialId == trialId && t.SubjectId == subjectId && t.DoctorUserId == doctorUserId && t.ArmEnum == armEnum && t.OrignalSubjectUserId == null))
{
throw new BusinessValidationFailedException("有Subject 已有该Arm组的医生不允许继续分配,请刷新页面,确认页面数据是否过期");
//---有Subject 已有该Arm组的医生不允许继续分配,请刷新页面,确认页面数据是否过期
throw new BusinessValidationFailedException(_localizer["VisitTask_DuplicateDoctorInArm"]);
}
else
{
@ -510,7 +518,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
{
if (await _visitTaskRepository.AnyAsync(t => t.SubjectId == subjectId && t.DoctorUserId != null && t.ArmEnum == Arm.JudgeArm))
{
throw new BusinessValidationFailedException("有Subject任务已应用不允许取消分配");
//---有Subject任务已应用不允许取消分配
throw new BusinessValidationFailedException(_localizer["VisitTask_DoctorAlreadyInArm"]);
}
await _subjectUserRepository.DeleteFromQueryAsync(t => t.SubjectId == subjectId && t.ArmEnum == Arm.JudgeArm);
@ -522,7 +531,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
{
if (await _visitTaskRepository.AnyAsync(t => t.SubjectId == subjectId && t.DoctorUserId != null && t.ArmEnum != Arm.JudgeArm))
{
throw new BusinessValidationFailedException("有Subject任务已应用不允许取消分配");
//---有Subject任务已应用不允许取消分配
throw new BusinessValidationFailedException(_localizer["VisitTask_DoctorAlreadyInArm"]);
}
await _subjectUserRepository.DeleteFromQueryAsync(t => t.SubjectId == subjectId && t.ArmEnum != Arm.JudgeArm);
@ -614,7 +624,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
}
else
{
throw new BusinessValidationFailedException("在配置表中未找到配置的医生,无法应用绑定,请核对数据");
//---在配置表中未找到配置的医生,无法应用绑定,请核对数据
throw new BusinessValidationFailedException(_localizer["VisitTask_TaskAlreadyApplied"]);
}
}
@ -909,7 +920,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
#region 按照Subject 维度
if (isReadingTaskViewInOrder)
{
var visitTaskListInfo = await GetOrderReadingIQueryable(new GetOrderReadingIQueryableInDto()
{
@ -959,7 +970,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
{
var taskQuery = _visitTaskRepository.Where(x => x.TrialId == iRUnReadSubjectQuery.TrialId && x.DoctorUserId == _userInfo.Id && x.TaskState == TaskState.Effect && x.TrialReadingCriterionId == trialReadingCriterionId)
// .Where(x=>x.Subject.ClinicalDataList.Any(c => c.IsSign && (c.ReadingId == x.SouceReadModuleId || c.ReadingId == x.SourceSubjectVisitId)))
.Where(x => !x.Subject.IsDeleted).Where(x=>(x.IsNeedClinicalDataSign&&x.IsClinicalDataSign)||!x.IsNeedClinicalDataSign);
.Where(x => !x.Subject.IsDeleted).Where(x => (x.IsNeedClinicalDataSign && x.IsClinicalDataSign) || !x.IsNeedClinicalDataSign);
IRUnReadOutDto iRUnReadOut = new IRUnReadOutDto()
{
@ -1021,15 +1032,15 @@ namespace IRaCIS.Core.Application.Service.Allocation
var totalCount = await visitGroupQuery.CountAsync();
var currentPageData =await visitTaskQuery.ToListAsync();
var currentPageData = await visitTaskQuery.ToListAsync();
var result = new PageOutput<IRUnReadSubjectView>()
{
PageSize = iRUnReadSubjectQuery.PageSize,
PageIndex = iRUnReadSubjectQuery.PageIndex,
TotalCount = totalCount,
CurrentPageData = currentPageData,
};
{
PageSize = iRUnReadSubjectQuery.PageSize,
PageIndex = iRUnReadSubjectQuery.PageIndex,
TotalCount = totalCount,
CurrentPageData = currentPageData,
};
return (result, new
{
@ -1068,15 +1079,15 @@ namespace IRaCIS.Core.Application.Service.Allocation
var visitGroupQuery = _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.ImageFilterState != ImageFilterState.Finished) ?
t.VisitTaskNum <= t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Min(t => t.SubjectVisit.VisitNum) : true)
.WhereIf(critrion.IsAutoCreate == false, t => t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(t => t.ImageFilterState != ImageFilterState.Finished) ?
t.VisitTaskNum <= t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Min(t => t.SubjectVisit.VisitNum) : true)
.Where(t => t.TrialReadingCriterion.IsAutoCreate == false && t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(t => t.ImageFilterState != ImageFilterState.Finished) ?
t.VisitTaskNum <= t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).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)
.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))
@ -1217,7 +1228,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
if (requestRecordList.Count() != baseLineTaskIdList.Count())
{
return ResponseOutput.NotOk("后台数据有错误");
//---后台数据有错误
return ResponseOutput.NotOk(_localizer["VisitTask_DoctorConfiguration"]);
}
await ConfirmReReading(new ConfirmReReadingCommand()
@ -1253,7 +1265,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
var criterionConfig = (await _trialReadingCriterionRepository.Where(x => x.Id == trialReadingCriterionId).Select(x => new { x.ReadingTool, x.IsAutoCreate, x.IsReadingTaskViewInOrder }).FirstOrDefaultAsync()).IfNullThrowException();
foreach (var task in taskList)
{
@ -1261,12 +1273,14 @@ namespace IRaCIS.Core.Application.Service.Allocation
if (task.ReadingTaskState != ReadingTaskState.HaveSigned || task.TaskState != TaskState.Effect)
{
throw new BusinessValidationFailedException("未阅片完成,或者未生效的任务不允许申请重阅");
//---未阅片完成,或者未生效的任务不允许申请重阅
throw new BusinessValidationFailedException(_localizer["VisitTask_BackendData"]);
}
if (task.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed || task.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed || task.ReReadingApplyState == ReReadingApplyState.Agree)
{
throw new BusinessValidationFailedException("重阅已申请,或者重阅已同意状态下不允许申请重阅");
//---重阅已申请,或者重阅已同意状态下不允许申请重阅
throw new BusinessValidationFailedException(_localizer["VisitTask_UnreadTask"]);
}
@ -1281,12 +1295,14 @@ namespace IRaCIS.Core.Application.Service.Allocation
if (task.IsAnalysisCreate)
{
throw new BusinessValidationFailedException("PM 不允许对一致性分析任务进行申请重阅");
//---PM 不允许对一致性分析任务进行申请重阅
throw new BusinessValidationFailedException(_localizer["VisitTask_Reapply"]);
}
if (task.ReadingCategory != ReadingCategory.Visit)
{
throw new BusinessValidationFailedException("PM 仅仅允许对访视类型的任务申请重阅");
//---PM 仅仅允许对访视类型的任务申请重阅
throw new BusinessValidationFailedException(_localizer["VisitTask_ConsistencyAnalysis"]);
}
@ -1297,7 +1313,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
&& t.OriginalReReadingTask.TrialReadingCriterionId == task.TrialReadingCriterionId
&& t.OriginalReReadingTask.ReadingTaskState == ReadingTaskState.HaveSigned && t.RequestReReadingType == RequestReReadingType.TrialGroupApply && t.RequestReReadingResultEnum == RequestReReadingResult.Default))
{
return ResponseOutput.NotOk("当前为有序阅片,该受试者已有访视已申请重阅还未处理(项目组申请),暂不能继续申请重阅");
//---当前为有序阅片,该受试者已有访视已申请重阅还未处理(项目组申请),暂不能继续申请重阅
return ResponseOutput.NotOk(_localizer["VisitTask_VisitTypeRestriction"]);
}
}
@ -1318,7 +1335,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
&& t.OriginalReReadingTask.TrialReadingCriterionId == task.TrialReadingCriterionId
&& t.OriginalReReadingTask.ReadingTaskState == ReadingTaskState.HaveSigned && t.RequestReReadingType == RequestReReadingType.DocotorApply && t.RequestReReadingResultEnum == RequestReReadingResult.Default))
{
return ResponseOutput.NotOk("当前为有序阅片,该受试者已有访视已申请重阅还未处理,暂不能继续申请重阅");
//---当前为有序阅片,该受试者已有访视已申请重阅还未处理,暂不能继续申请重阅
return ResponseOutput.NotOk(_localizer["VisitTask_SequentialReading"]);
}
@ -1334,7 +1352,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
//PM 有序影响列表
if (await _visitTaskRepository.Where(t => t.TrialId == originalTask.TrialId && t.SubjectId == originalTask.SubjectId && t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.Allocated && t.IsAnalysisCreate == false && t.TrialReadingCriterionId == originalTask.TrialReadingCriterionId && t.VisitTaskNum > originalTask.VisitTaskNum).AnyAsync(t => t.VisitTaskNum == task.VisitTaskNum))
{
return ResponseOutput.NotOk("当前为有序阅片,影像存在问题,项目组已申请回退,暂不能申请重阅");
//---当前为有序阅片,影像存在问题,项目组已申请回退,暂不能申请重阅
return ResponseOutput.NotOk(_localizer["VisitTask_ImageProblem"]);
}
}
@ -1348,7 +1367,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
if (task.ReadingCategory == ReadingCategory.Judge && await _visitTaskRepository.AnyAsync(filterExpression.And(t => t.ReadingCategory == ReadingCategory.Global)))
{
throw new BusinessValidationFailedException("有序阅片,只允许申请该受试者阅片人最后一次完成全局任务重阅");
//---有序阅片,只允许申请该受试者阅片人最后一次完成全局任务重阅
throw new BusinessValidationFailedException(_localizer["VisitTask_LastReading"]);
}
if (task.ReadingCategory == ReadingCategory.Oncology && await _visitTaskRepository.AnyAsync(filterExpression.And(t => t.ReadingCategory == ReadingCategory.Oncology)))
@ -1419,7 +1439,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
}
else
{
throw new BusinessValidationFailedException("当前重阅任务状态不为已申请状态,不允许进行处理,请刷新页面");
//---当前重阅任务状态不为已申请状态,不允许进行处理,请刷新页面
throw new BusinessValidationFailedException(_localizer["VisitTask_InvalidReapplyStatus"]);
}
}
@ -1491,7 +1512,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
if (origenalTask.TaskState != TaskState.Effect)
{
return ResponseOutput.NotOk("当前申请重阅任务的状态,已被其他任务重阅已影响,不允许对该状态下的任务进行重阅同意与否操作");
//---当前申请重阅任务的状态,已被其他任务重阅已影响,不允许对该状态下的任务进行重阅同意与否操作
return ResponseOutput.NotOk(_localizer["VisitTask_ReapplyStatusConflict"]);
}
@ -1552,7 +1574,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
}
else
{
throw new BusinessValidationFailedException("仅允许同意访视类型的任务重阅");
//---仅允许同意访视类型的任务重阅
throw new BusinessValidationFailedException(_localizer["VisitTask_ReReadTaskNotApplied"]);
}
//有序阅片
@ -1768,7 +1791,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
default:
throw new BusinessValidationFailedException("不支持重阅的任务类型");
//---不支持重阅的任务类型
throw new BusinessValidationFailedException(_localizer["VisitTask_UnsupportedTaskType"]);
}
@ -1794,7 +1818,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
await SetMedicalReviewInvalidAsync(influenceTaskList, false);
await InfluenceAddtioncalEvaluationCritrionAsync(origenalTask ,influenceTaskList.Where(t => t.Id != origenalTask.Id).Where(t => t.SourceSubjectVisitId != null).Select(t => (Guid)t.SourceSubjectVisitId).Distinct().ToList());
await InfluenceAddtioncalEvaluationCritrionAsync(origenalTask, influenceTaskList.Where(t => t.Id != origenalTask.Id).Where(t => t.SourceSubjectVisitId != null).Select(t => (Guid)t.SourceSubjectVisitId).Distinct().ToList());
trakingOrigenalTask?.TaskInfluenceList.Add(new TaskInfluence() { InfluenceTaskId = influenceTask.Id, OptType = ReReadingOrBackOptType.Return });
}
@ -1996,7 +2020,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
}
else
{
throw new BusinessValidationFailedException("不符合 PM申请 SPM / CPM审批 | IR申请 PM 审批 ");
//---不符合 PM申请 SPM / CPM审批 | IR申请 PM 审批
throw new BusinessValidationFailedException(_localizer["VisitTask_ReReadTaskAlreadyAffected"]);
}
}
@ -2012,14 +2037,15 @@ namespace IRaCIS.Core.Application.Service.Allocation
}
else
{
throw new BusinessValidationFailedException("当前重阅任务状态不为已申请状态,不允许进行处理,请刷新页面");
//---当前重阅任务状态不为已申请状态,不允许进行处理,请刷新页面
throw new BusinessValidationFailedException(_localizer["VisitTask_InvalidReapplyStatus"]);
}
}
}
@ -2057,7 +2083,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
if (task.TaskState != TaskState.Effect || task.ReadingCategory != ReadingCategory.Visit || task.ReadingTaskState == ReadingTaskState.HaveSigned)
{
return ResponseOutput.NotOk("仅仅允许针对生效、未完成的访视任务进行退回操作,请刷新页面数据");
//---仅仅允许针对生效、未完成的访视任务进行退回操作,请刷新页面数据
return ResponseOutput.NotOk(_localizer["VisitTask_NonEffectiveTaskCannotBeReturned"]);
}
@ -2069,7 +2096,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
if (task.IsAnalysisCreate)
{
return ResponseOutput.NotOk("一致性分析的任务,不允许设置退回");
//---一致性分析的任务,不允许设置退回
return ResponseOutput.NotOk(_localizer["VisitTask_ConsistencyTaskCannotBeReturned"]);
}
Expression<Func<VisitTask, bool>> filterExpression = t => t.TrialId == trialId && t.SubjectId == task.SubjectId && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze) && t.TaskAllocationState == TaskAllocationState.Allocated;
@ -2345,7 +2373,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
}
else
{
return ResponseOutput.NotOk("仅PM 可以进行回退操作");
//---仅PM 可以进行回退操作
return ResponseOutput.NotOk(_localizer["VisitTask_PMOnlyAllowedForReturn"]);
}
@ -2363,9 +2392,9 @@ namespace IRaCIS.Core.Application.Service.Allocation
/// 如果是基线退回 影响附加评估标准 是否参与评估
/// </summary>
/// <returns></returns>
private async Task InfluenceAddtioncalEvaluationCritrionAsync(VisitTask task,List<Guid> otherVisitIdList)
private async Task InfluenceAddtioncalEvaluationCritrionAsync(VisitTask task, List<Guid> otherVisitIdList)
{
if (_subjectVisitRepository.Any(t => t.Id == task.SourceSubjectVisitId && t.IsBaseLine))
{
await _subjectCriteriaEvaluationRepository.UpdatePartialFromQueryAsync(t => t.TrialReadingCriterion.IsAutoCreate == false && t.SubjectId == task.SubjectId, u => new SubjectCriteriaEvaluation()
@ -2382,15 +2411,15 @@ namespace IRaCIS.Core.Application.Service.Allocation
else
{
//当前访视筛选状态重置,任务生成状态重置
if(task.SourceSubjectVisitId != null)
if (task.SourceSubjectVisitId != null)
{
await _subjectCriteriaEvaluationVisitFilterRepository.UpdatePartialFromQueryAsync(t => t.TrialReadingCriterion.IsAutoCreate == false && t.SubjectVisit.SubjectId == task.SubjectId && t.SubjectVisitId == task.SourceSubjectVisitId,
t => new SubjectCriteriaEvaluationVisitFilter()
{
ImageFilterState = ImageFilterState.None,
ImageDeterminationResultState = ImageDeterminationResultState.None,
IsGeneratedTask = false
});
await _subjectCriteriaEvaluationVisitFilterRepository.UpdatePartialFromQueryAsync(t => t.TrialReadingCriterion.IsAutoCreate == false && t.SubjectVisit.SubjectId == task.SubjectId && t.SubjectVisitId == task.SourceSubjectVisitId,
t => new SubjectCriteriaEvaluationVisitFilter()
{
ImageFilterState = ImageFilterState.None,
ImageDeterminationResultState = ImageDeterminationResultState.None,
IsGeneratedTask = false
});
//删除序列数据
await _subjectCriteriaEvaluationVisitStudyFilterRepository.BatchDeleteNoTrackingAsync(t => t.TrialReadingCriterion.IsAutoCreate == false && t.SubjectVisit.SubjectId == task.SubjectId && t.SubjectVisitId == task.SourceSubjectVisitId);
@ -2404,7 +2433,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
IsGeneratedTask = false
});
}
}
//包括临床数据签名状态
@ -2491,7 +2520,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
var criterionConfig = (await _trialReadingCriterionRepository.Where(x => x.Id == filterObj.TrialReadingCriterionId).Select(x => new { x.ReadingTool, x.IsReadingTaskViewInOrder }).FirstOrDefaultAsync()).IfNullThrowException();
Expression<Func<VisitTask, bool>> filterExpression = t => t.TrialId == trialId && t.SubjectId == filterObj.SubjectId && (t.TaskState == TaskState.Effect||t.TaskState==TaskState.Freeze) && t.TaskAllocationState == TaskAllocationState.Allocated;
Expression<Func<VisitTask, bool>> filterExpression = t => t.TrialId == trialId && t.SubjectId == filterObj.SubjectId && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze) && t.TaskAllocationState == TaskAllocationState.Allocated;
//是否是一致性分析任务 (一致性分析的任务 不会产生裁判 肿瘤学 仅仅有生成的访视和全局)
@ -2582,7 +2611,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
default:
throw new BusinessValidationFailedException("不支持重阅的任务类型");
//---不支持重阅的任务类型
throw new BusinessValidationFailedException(_localizer["VisitTask_UnsupportedTaskType"]);
}
}
//无序
@ -2614,7 +2644,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
break;
default:
throw new BusinessValidationFailedException("不支持重阅的任务类型");
//---不支持重阅的任务类型
throw new BusinessValidationFailedException(_localizer["VisitTask_UnsupportedTaskType"]);
}
if (await _visitTaskReReadingRepository.AnyAsync(t => t.RequestReReadingType == RequestReReadingType.DocotorApply && t.RequestReReadingResultEnum == RequestReReadingResult.Default &&
@ -2638,7 +2669,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
}
else
{
throw new BusinessValidationFailedException("当前用户查看列表未定义");
//---当前用户查看列表未定义
throw new BusinessValidationFailedException(_localizer["VisitTask_UndefinedList"]);
}
@ -2681,7 +2713,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
}
else
{
throw new BusinessValidationFailedException("仅仅访视类型的任务支持PM退回");
//---仅仅访视类型的任务支持PM退回
throw new BusinessValidationFailedException(_localizer["VisitTask_VisitTypeTaskAllowedForPMOnly"]);
}
}

View File

@ -1,4 +1,4 @@
//--------------------------------------------------------------------
//--------------------------------------------------------------------
// 此代码由T4模板自动生成 byzhouhang 20210918
// 生成时间 2022-03-31 13:18:56
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
@ -49,7 +49,8 @@ namespace IRaCIS.Core.Application.Service
var verifyExp1 = new EntityVerifyExp<CommonDocument>()
{
VerifyExp = t => t.Code == addOrEditCommonDocument.Code,
VerifyMsg = "文档的Code不能够重复。"
//---文档的Code不能够重复。
VerifyMsg = _localizer["Document_CodeDuplication"]
};
//var verifyExp3 = new EntityVerifyExp<CommonDocument>()
@ -61,10 +62,11 @@ namespace IRaCIS.Core.Application.Service
var verifyExp2 = new EntityVerifyExp<CommonDocument>()
{
VerifyExp = t => t.CriterionTypeEnum == addOrEditCommonDocument.CriterionTypeEnum && t.BusinessScenarioEnum==addOrEditCommonDocument.BusinessScenarioEnum &&
t.IsDeleted==addOrEditCommonDocument.IsDeleted,
VerifyMsg = "一个场景一个标准只允许有一个模板文档",
IsVerify=addOrEditCommonDocument.CriterionTypeEnum !=null && addOrEditCommonDocument.IsDeleted==false
VerifyExp = t => t.CriterionTypeEnum == addOrEditCommonDocument.CriterionTypeEnum && t.BusinessScenarioEnum == addOrEditCommonDocument.BusinessScenarioEnum &&
t.IsDeleted == addOrEditCommonDocument.IsDeleted,
//---一个场景一个标准只允许有一个模板文档
VerifyMsg = _localizer["Document_SingleTemplate"],
IsVerify = addOrEditCommonDocument.CriterionTypeEnum != null && addOrEditCommonDocument.IsDeleted == false
};
@ -91,10 +93,11 @@ namespace IRaCIS.Core.Application.Service
}
catch (Exception )
catch (Exception)
{
return ResponseOutput.NotOk("读取模板内容失败, 请将文件另存为docx格式尝试!");
//---读取模板内容失败, 请将文件另存为docx格式尝试!
return ResponseOutput.NotOk(_localizer["Document_ TemplateRead"]);
}

View File

@ -121,9 +121,10 @@ namespace IRaCIS.Application.Services
{
var verifyExp1 = new EntityVerifyExp<Dictionary>()
{
VerifyExp = t => t.Code == addOrEditBasic.Code&&t.ParentId== addOrEditBasic.ParentId,
VerifyMsg = $"已有{addOrEditBasic.Code}名称的字典",
IsVerify= addOrEditBasic.ParentId ==null
VerifyExp = t => t.Code == addOrEditBasic.Code && t.ParentId == addOrEditBasic.ParentId,
//---------- $"已有{addOrEditBasic.Code}名称的字典"
VerifyMsg = _localizer["Dictionary_DictionaryName", addOrEditBasic.Code],
IsVerify = addOrEditBasic.ParentId == null
};
@ -138,7 +139,7 @@ namespace IRaCIS.Application.Services
//}
if (addOrEditBasic.Id != null && addOrEditBasic.ParentId==null)
if (addOrEditBasic.Id != null && addOrEditBasic.ParentId == null)
{
await _dicRepository.UpdatePartialFromQueryAsync(t => t.ParentId == addOrEditBasic.Id, c => new Dictionary() { DataTypeEnum = addOrEditBasic.DataTypeEnum });
@ -174,12 +175,14 @@ namespace IRaCIS.Application.Services
if (await _readingCriterionDictionaryRepository.AnyAsync(x => x.DictionaryId == id))
{
await _readingCriterionDictionaryRepository.BatchDeleteNoTrackingAsync(t => t.DictionaryId == id);
//return ResponseOutput.NotOk("当前字典在标准中被引用,不允许删除!");
//---当前字典在标准中被引用,不允许删除!
//return ResponseOutput.NotOk(_localizer["Dictionary_DictionaryDeletion"]);
}
if (await _dicRepository.AnyAsync(t => t.ParentId == id))
{
return ResponseOutput.NotOk("有子项数据,不允许直接删除!");
//---有子项数据,不允许直接删除!
return ResponseOutput.NotOk(_localizer["Dictionary_SubitemDeletion"]);
}
if ((await _doctorDictionaryRepository.AnyAsync(t => t.DictionaryId == id)) ||
@ -187,19 +190,22 @@ namespace IRaCIS.Application.Services
)
{
return ResponseOutput.NotOk("当前条目已经在阅片人的简历中被引用。");
//---当前条目已经在阅片人的简历中被引用。
return ResponseOutput.NotOk(_localizer["Dictionary_ResumeReference"]);
}
if (await _trialDictionaryRepository.AnyAsync(t => t.DictionaryId == id) ||
await _trialRepository.AnyAsync(t => t.ReviewModeId == id))
{
return ResponseOutput.NotOk("当前条目已经在项目信息中被引用。");
//---当前条目已经在项目信息中被引用。
return ResponseOutput.NotOk(_localizer["Dictionary_ProjectReference"]);
}
if (await _readingCriterionDictionaryRepository.AnyAsync(x => x.DictionaryId == id))
{
await _readingCriterionDictionaryRepository.BatchDeleteNoTrackingAsync(t => t.DictionaryId == id);
//return ResponseOutput.NotOk("当前条目已经在阅片标准中被引用。");
//---当前条目已经在阅片标准中被引用。
//return ResponseOutput.NotOk(_localizer["Dictionary_StandardReference"]);
}
var success = await _dicRepository.BatchDeleteNoTrackingAsync(t => t.Id == id);
@ -243,7 +249,7 @@ namespace IRaCIS.Application.Services
/// <returns></returns>
public async Task<List<BasicDicSelect>> GetBasicConfigSelect(string searchKey)
{
var searchList = await _dicRepository.Where(t => t.ConfigDictionary.Code == searchKey && t.ParentId == null && t.IsEnable).ProjectTo<BasicDicSelect>(_mapper.ConfigurationProvider).OrderBy(x=>x.ShowOrder).ToListAsync();
var searchList = await _dicRepository.Where(t => t.ConfigDictionary.Code == searchKey && t.ParentId == null && t.IsEnable).ProjectTo<BasicDicSelect>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ToListAsync();
return searchList;
}
@ -254,12 +260,12 @@ namespace IRaCIS.Application.Services
/// <returns></returns>
public async Task<List<GetCriterionDictionaryListOutDto>> GetCriterionDictionaryList(GetCriterionDictionaryListInDto inDto)
{
var criterionCodes= await _systemCriterionDictionaryCodeRepository.Where(x => x.SystemCriterionId == inDto.SystemCriterionId).ToListAsync();
var criterionCodes = await _systemCriterionDictionaryCodeRepository.Where(x => x.SystemCriterionId == inDto.SystemCriterionId).ToListAsync();
var parentCodes = await _readingCriterionDictionaryRepository.Where(x => x.CriterionId== inDto.SystemCriterionId).Select(x => x.ParentCode).ToListAsync();
var parentCodes = await _readingCriterionDictionaryRepository.Where(x => x.CriterionId == inDto.SystemCriterionId).Select(x => x.ParentCode).ToListAsync();
var codes = criterionCodes.Select(x=>x.Code).ToList();
var codes = criterionCodes.Select(x => x.Code).ToList();
var dictionaryList = await _dicRepository.Where(x => codes.Contains(x.Code) && x.ParentId == null)
.OrderBy(x => x.ShowOrder).Select(x => new GetCriterionDictionaryListOutDto()
@ -269,7 +275,8 @@ namespace IRaCIS.Application.Services
Description = x.Description
}).ToListAsync();
dictionaryList.ForEach(x => {
dictionaryList.ForEach(x =>
{
x.Count = parentCodes.Count(y => y == x.Code);
x.Id = criterionCodes.Where(y => y.Code == x.Code).Select(x => x.Id).FirstOrDefault();
});
@ -299,7 +306,8 @@ namespace IRaCIS.Application.Services
Description = x.Description
}).ToListAsync();
dictionaryList.ForEach(x => {
dictionaryList.ForEach(x =>
{
x.Count = parentCodes.Count(y => y == x.Code);
x.Id = criterionCodes.Where(y => y.Code == x.Code).Select(x => x.Id).FirstOrDefault();
});
@ -317,8 +325,8 @@ namespace IRaCIS.Application.Services
public async Task<Dictionary<string, List<BasicDicSelect>>> GetCriterionDictionary(GetCriterionDictionaryInDto inDto)
{
var searchList = await _dicRepository.Where(t => t.ParentId != null && t.IsEnable)
.WhereIf(!inDto.DictionaryCode.IsNullOrEmpty(), x =>x.Parent.Code==inDto.DictionaryCode)
.WhereIf(inDto.DictionaryCodeList.Count()>0, x => inDto.DictionaryCodeList.Contains(x.Parent.Code))
.WhereIf(!inDto.DictionaryCode.IsNullOrEmpty(), x => x.Parent.Code == inDto.DictionaryCode)
.WhereIf(inDto.DictionaryCodeList.Count() > 0, x => inDto.DictionaryCodeList.Contains(x.Parent.Code))
.ProjectTo<BasicDicSelect>(_mapper.ConfigurationProvider).ToListAsync();
var result = searchList.GroupBy(t => t.ParentCode).ToDictionary(g => g.Key, g => g.OrderBy(t => t.ShowOrder).ToList());
@ -348,7 +356,7 @@ namespace IRaCIS.Application.Services
{
if (result.ContainsKey(item))
{
result[item] = new List<BasicDicSelect> ();
result[item] = new List<BasicDicSelect>();
}
}
@ -361,7 +369,7 @@ namespace IRaCIS.Application.Services
ParentChildCodeEnum = x.Dictionary.Parent.ChildCodeEnum,
ShowOrder = x.Dictionary.ShowOrder,
ParentCode = x.ParentCode,
CrterionDictionaryGroup=x.CrterionDictionaryGroup,
CrterionDictionaryGroup = x.CrterionDictionaryGroup,
Id = x.DictionaryId,
ParentId = x.Dictionary.ParentId,
Value = x.Dictionary.Value,
@ -380,7 +388,7 @@ namespace IRaCIS.Application.Services
result[item.Key] = item.Value;
}
}
return result;
@ -396,7 +404,7 @@ namespace IRaCIS.Application.Services
[AllowAnonymous]
public async Task<Dictionary<string, List<BasicDicSelect>>> GetBasicDataAllSelect(GetBasicDataAllSelectInDto inDto)
{
var searchList = await _dicRepository.Where(t => t.ParentId != null && t.IsEnable ).ProjectTo<BasicDicSelect>(_mapper.ConfigurationProvider).ToListAsync();
var searchList = await _dicRepository.Where(t => t.ParentId != null && t.IsEnable).ProjectTo<BasicDicSelect>(_mapper.ConfigurationProvider).ToListAsync();
var result = searchList.GroupBy(t => t.ParentCode).ToDictionary(g => g.Key, g => g.OrderBy(t => t.ShowOrder).ToList());
@ -406,7 +414,7 @@ namespace IRaCIS.Application.Services
}
else
{
List<string> selectCode = await _trialCriterionDictionaryCodeRepository.Where(x => x.TrialCriterionId == inDto.TrialReadingCriterionId).Select(x => x.Code).ToListAsync();
List<string> selectCode = await _trialCriterionDictionaryCodeRepository.Where(x => x.TrialCriterionId == inDto.TrialReadingCriterionId).Select(x => x.Code).ToListAsync();
var criterionCode = await _dicRepository.Where(x => x.ConfigDictionary.Code == "Reading_eCRF_Criterion").Select(x => x.Code).ToListAsync();
@ -427,13 +435,13 @@ namespace IRaCIS.Application.Services
{
ChildGroup = x.Dictionary.ChildGroup,
Code = x.Dictionary.Code,
Description=x.Dictionary.Description,
Description = x.Dictionary.Description,
DataTypeEnum = x.Dictionary.DataTypeEnum,
ParentChildCodeEnum = x.Dictionary.Parent.ChildCodeEnum,
ShowOrder = x.Dictionary.ShowOrder,
ParentCode = x.ParentCode,
Id = x.DictionaryId,
CrterionDictionaryGroup=x.CrterionDictionaryGroup,
CrterionDictionaryGroup = x.CrterionDictionaryGroup,
ParentId = x.Dictionary.ParentId,
Value = x.Dictionary.Value,
ValueCN = x.Dictionary.ValueCN
@ -452,7 +460,7 @@ namespace IRaCIS.Application.Services
return result;
}
}
#region 稽查相关

Binary file not shown.