代码整理
parent
8c5461aa74
commit
812c82a38b
|
@ -107,8 +107,4 @@
|
||||||
<ProjectReference Include="..\IRaCIS.Core.Infra.EFCore\IRaCIS.Core.Infra.EFCore.csproj" />
|
<ProjectReference Include="..\IRaCIS.Core.Infra.EFCore\IRaCIS.Core.Infra.EFCore.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Service\Reading\ReadingCriterionQuestion\" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -8109,12 +8109,6 @@
|
||||||
<param name="visitTaskId"></param>
|
<param name="visitTaskId"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.FinishReadUpdateState(System.Guid)">
|
|
||||||
<summary>
|
|
||||||
完成阅片修改状态
|
|
||||||
</summary>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.AddReadingTask(System.Guid)">
|
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.AddReadingTask(System.Guid)">
|
||||||
<summary>
|
<summary>
|
||||||
添加阅片期任务
|
添加阅片期任务
|
||||||
|
@ -8127,6 +8121,12 @@
|
||||||
</summary>
|
</summary>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.SaveJudgeTask(IRaCIS.Core.Application.Service.Reading.Dto.SaveJudgeTaskDto)">
|
||||||
|
<summary>
|
||||||
|
添加裁判任务
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.TriggerJudgeQuestion(System.Guid)">
|
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.TriggerJudgeQuestion(System.Guid)">
|
||||||
<summary>
|
<summary>
|
||||||
触发裁判任务(新)
|
触发裁判任务(新)
|
||||||
|
@ -8141,12 +8141,6 @@
|
||||||
<param name="groupTasks"></param>
|
<param name="groupTasks"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.SaveJudgeTask(IRaCIS.Core.Application.Service.Reading.Dto.SaveJudgeTaskDto)">
|
|
||||||
<summary>
|
|
||||||
添加裁判任务
|
|
||||||
</summary>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.VerifyTaskIsSign(System.Guid)">
|
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.VerifyTaskIsSign(System.Guid)">
|
||||||
<summary>
|
<summary>
|
||||||
验证任务是否签名
|
验证任务是否签名
|
||||||
|
@ -8155,6 +8149,12 @@
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
|
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.FinishReadUpdateState(System.Guid)">
|
||||||
|
<summary>
|
||||||
|
完成阅片修改状态
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="T:IRaCIS.Application.Services.ReadingPeriodSetService">
|
<member name="T:IRaCIS.Application.Services.ReadingPeriodSetService">
|
||||||
<summary>
|
<summary>
|
||||||
阅片期配置
|
阅片期配置
|
||||||
|
|
|
@ -2052,7 +2052,7 @@ namespace IRaCIS.Application.Services
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
#region 提交问题
|
#region 阅片任务 提交填写表单
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 验证访视提交
|
/// 验证访视提交
|
||||||
|
@ -2420,37 +2420,14 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
await _visitTaskRepository.SaveChangesAsync();
|
await _visitTaskRepository.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
#region 阅片期 -全局和肿瘤学任务的生成
|
||||||
/// 完成阅片修改状态
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
private async Task FinishReadUpdateState(Guid visitTaskId)
|
|
||||||
{
|
|
||||||
//var taskInfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).FirstNotNullAsync();
|
|
||||||
//if (!await _visitTaskRepository.AnyAsync(x => x.SourceSubjectVisitId == taskInfo.SourceSubjectVisitId && x.SouceReadModuleId == taskInfo.SouceReadModuleId && x.ReadingTaskState != ReadingTaskState.HaveSigned))
|
|
||||||
//{
|
|
||||||
// if (taskInfo.SouceReadModuleId != null)
|
|
||||||
// {
|
|
||||||
// await _readModuleRepository.UpdatePartialFromQueryAsync(taskInfo.SouceReadModuleId.Value, x => new ReadModule
|
|
||||||
// {
|
|
||||||
// ReadingStatus = ReadingStatusEnum.ReadCompleted
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// else if (taskInfo.SourceSubjectVisitId != null)
|
|
||||||
// {
|
|
||||||
// await _subjectVisitRepository.UpdatePartialFromQueryAsync(taskInfo.SourceSubjectVisitId.Value, x => new SubjectVisit
|
|
||||||
// {
|
|
||||||
// ReadingStatus = ReadingStatusEnum.ReadCompleted
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// await _subjectVisitRepository.SaveChangesAsync();
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 添加阅片期任务
|
/// 添加阅片期任务
|
||||||
|
@ -2477,12 +2454,12 @@ namespace IRaCIS.Application.Services
|
||||||
switch (taskInfo.ReadingCategory)
|
switch (taskInfo.ReadingCategory)
|
||||||
{
|
{
|
||||||
case ReadingCategory.Visit:
|
case ReadingCategory.Visit:
|
||||||
needReadList = await _readModuleRepository.Where(x => x.SubjectVisitId == taskInfo.SourceSubjectVisitId&&x.ReadingSetType==ReadingSetType.ImageReading)
|
needReadList = await _readModuleRepository.Where(x => x.SubjectVisitId == taskInfo.SourceSubjectVisitId && x.ReadingSetType == ReadingSetType.ImageReading)
|
||||||
.Select(x => new ReadingGenerataTaskDTO
|
.Select(x => new ReadingGenerataTaskDTO
|
||||||
{
|
{
|
||||||
IsUrgent = x.IsUrgent ?? false,
|
IsUrgent = x.IsUrgent ?? false,
|
||||||
SubjectId = x.SubjectId,
|
SubjectId = x.SubjectId,
|
||||||
VisitNum=x.VisitNum,
|
VisitNum = x.VisitNum,
|
||||||
ReadingName = x.ModuleName,
|
ReadingName = x.ModuleName,
|
||||||
ReadModuleId = x.Id,
|
ReadModuleId = x.Id,
|
||||||
ReadingCategory = typeChangeDic[x.ModuleType],
|
ReadingCategory = typeChangeDic[x.ModuleType],
|
||||||
|
@ -2494,16 +2471,16 @@ namespace IRaCIS.Application.Services
|
||||||
//needReadList = needReadList.Where(x => _visitTaskRepository.Where(y => y.SouceReadModuleId == x.ReadModuleId).Count() == 0).ToList();
|
//needReadList = needReadList.Where(x => _visitTaskRepository.Where(y => y.SouceReadModuleId == x.ReadModuleId).Count() == 0).ToList();
|
||||||
await _visitTaskHelpeService.AddTaskAsync(new GenerateTaskCommand()
|
await _visitTaskHelpeService.AddTaskAsync(new GenerateTaskCommand()
|
||||||
{
|
{
|
||||||
OriginalVisitId= visitTaskId,
|
OriginalVisitId = visitTaskId,
|
||||||
ReadingCategory = GenerateTaskCategory.Global,
|
ReadingCategory = GenerateTaskCategory.Global,
|
||||||
TrialId = taskInfo.TrialId,
|
TrialId = taskInfo.TrialId,
|
||||||
ReadingGenerataTaskList = needReadList
|
ReadingGenerataTaskList = needReadList
|
||||||
}) ;
|
});
|
||||||
break;
|
break;
|
||||||
// 肿瘤学
|
// 肿瘤学
|
||||||
case ReadingCategory.Global:
|
case ReadingCategory.Global:
|
||||||
var subjectVisitId = await _readModuleRepository.Where(x => x.Id == taskInfo.SouceReadModuleId).Select(x => x.SubjectVisitId).FirstOrDefaultAsync();
|
var subjectVisitId = await _readModuleRepository.Where(x => x.Id == taskInfo.SouceReadModuleId).Select(x => x.SubjectVisitId).FirstOrDefaultAsync();
|
||||||
var oncologyReadId= await _readModuleRepository.Where(x => x.SubjectVisitId == subjectVisitId && x.ModuleType == ModuleTypeEnum.Oncology).Select(x => x.Id).FirstOrDefaultAsync();
|
var oncologyReadId = await _readModuleRepository.Where(x => x.SubjectVisitId == subjectVisitId && x.ModuleType == ModuleTypeEnum.Oncology).Select(x => x.Id).FirstOrDefaultAsync();
|
||||||
await AddOncologyTask(oncologyReadId);
|
await AddOncologyTask(oncologyReadId);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2544,17 +2521,17 @@ namespace IRaCIS.Application.Services
|
||||||
&& x.ReadingTaskState == ReadingTaskState.HaveSigned).Select(x => x.JudgeVisitTaskId).FirstOrDefaultAsync();
|
&& x.ReadingTaskState == ReadingTaskState.HaveSigned).Select(x => x.JudgeVisitTaskId).FirstOrDefaultAsync();
|
||||||
|
|
||||||
// 获取系统配置
|
// 获取系统配置
|
||||||
var readingType = await _readingQuestionCriterionTrialRepository.Where(x=>x.Id== readModuleInfo.TrialReadingCriterionId).Select(x=>x.ReadingType).FirstOrDefaultAsync();
|
var readingType = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == readModuleInfo.TrialReadingCriterionId).Select(x => x.ReadingType).FirstOrDefaultAsync();
|
||||||
|
|
||||||
// 判断阅片是否完成
|
// 判断阅片是否完成
|
||||||
if (judgeVisitTaskId == null && (await _visitTaskRepository.Where(x => x.SouceReadModuleId == globalreadModuleId && x.TaskState == TaskState.Effect && x.ReadingCategory == ReadingCategory.Global
|
if (judgeVisitTaskId == null && (await _visitTaskRepository.Where(x => x.SouceReadModuleId == globalreadModuleId && x.TaskState == TaskState.Effect && x.ReadingCategory == ReadingCategory.Global
|
||||||
&& x.ReadingTaskState == ReadingTaskState.HaveSigned && !x.IsAnalysisCreate&&x.TrialReadingCriterionId== readModuleInfo.TrialReadingCriterionId
|
&& x.ReadingTaskState == ReadingTaskState.HaveSigned && !x.IsAnalysisCreate && x.TrialReadingCriterionId == readModuleInfo.TrialReadingCriterionId
|
||||||
).CountAsync() == (int)readingType))
|
).CountAsync() == (int)readingType))
|
||||||
{
|
{
|
||||||
|
|
||||||
finishReading = true;
|
finishReading = true;
|
||||||
}
|
}
|
||||||
else if(judgeVisitTaskId!=null&& (await _visitTaskRepository.AnyAsync(x=>x.Id== judgeVisitTaskId.Value&&x.ReadingTaskState== ReadingTaskState.HaveSigned)))
|
else if (judgeVisitTaskId != null && (await _visitTaskRepository.AnyAsync(x => x.Id == judgeVisitTaskId.Value && x.ReadingTaskState == ReadingTaskState.HaveSigned)))
|
||||||
{
|
{
|
||||||
finishReading = true;
|
finishReading = true;
|
||||||
}
|
}
|
||||||
|
@ -2601,6 +2578,33 @@ namespace IRaCIS.Application.Services
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region 阅片任务 -裁判任务的生成和触发
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 添加裁判任务
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
private async Task SaveJudgeTask(SaveJudgeTaskDto inDto)
|
||||||
|
{
|
||||||
|
var trialId = await _visitTaskRepository.Where(x => inDto.VisitTaskIds.Contains(x.Id)).Select(x => x.TrialId).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
await _visitTaskHelpeService.AddTaskAsync(new GenerateTaskCommand()
|
||||||
|
{
|
||||||
|
JudgeVisitTaskIdList = inDto.VisitTaskIds,
|
||||||
|
ReadingCategory = GenerateTaskCategory.Judge,
|
||||||
|
TrialId = trialId
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 触发裁判任务(新)
|
/// 触发裁判任务(新)
|
||||||
|
@ -2616,16 +2620,16 @@ namespace IRaCIS.Application.Services
|
||||||
// 判断是否是一致性核查产生
|
// 判断是否是一致性核查产生
|
||||||
if (visitTask.IsAnalysisCreate)
|
if (visitTask.IsAnalysisCreate)
|
||||||
{
|
{
|
||||||
visitTaskids=await _visitTaskRepository.Where(x=>x.ArmEnum== visitTask.ArmEnum&&x.TaskState==TaskState.Effect&&x.SourceSubjectVisitId== visitTask.SourceSubjectVisitId
|
visitTaskids = await _visitTaskRepository.Where(x => x.ArmEnum == visitTask.ArmEnum && x.TaskState == TaskState.Effect && x.SourceSubjectVisitId == visitTask.SourceSubjectVisitId
|
||||||
&&x.SouceReadModuleId==visitTask.SouceReadModuleId && x.ReadingCategory != ReadingCategory.Judge && x.ReadingTaskState == ReadingTaskState.HaveSigned).Select(x => x.Id).ToListAsync();
|
&& x.SouceReadModuleId == visitTask.SouceReadModuleId && x.ReadingCategory != ReadingCategory.Judge && x.ReadingTaskState == ReadingTaskState.HaveSigned).Select(x => x.Id).ToListAsync();
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// 这里是非一致性分析产生的
|
// 这里是非一致性分析产生的
|
||||||
visitTaskids = await _visitTaskRepository.Where(x => x.ReadingTaskState == ReadingTaskState.HaveSigned && x.ReadingCategory != ReadingCategory.Judge
|
visitTaskids = await _visitTaskRepository.Where(x => x.ReadingTaskState == ReadingTaskState.HaveSigned && x.ReadingCategory != ReadingCategory.Judge
|
||||||
&& x.TaskState== TaskState.Effect
|
&& x.TaskState == TaskState.Effect
|
||||||
&& x.IsAnalysisCreate==false
|
&& x.IsAnalysisCreate == false
|
||||||
&& x.SourceSubjectVisitId == visitTask.SourceSubjectVisitId && x.SouceReadModuleId == visitTask.SouceReadModuleId).Select(x => x.Id).ToListAsync();
|
&& x.SourceSubjectVisitId == visitTask.SourceSubjectVisitId && x.SouceReadModuleId == visitTask.SouceReadModuleId).Select(x => x.Id).ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2728,7 +2732,7 @@ namespace IRaCIS.Application.Services
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// 这里判断一致性分析产生的全局阅片
|
// 这里判断一致性分析产生的全局阅片
|
||||||
if (visitTask.ReadingCategory == ReadingCategory.Global && visitTask.IsAnalysisCreate&&(visitTask.IsSelfAnalysis??false))
|
if (visitTask.ReadingCategory == ReadingCategory.Global && visitTask.IsAnalysisCreate && (visitTask.IsSelfAnalysis ?? false))
|
||||||
{
|
{
|
||||||
var taskOneInfo = await this.GetGlobalReadingInfo(new GetGlobalReadingInfoInDto()
|
var taskOneInfo = await this.GetGlobalReadingInfo(new GetGlobalReadingInfoInDto()
|
||||||
{
|
{
|
||||||
|
@ -2743,12 +2747,13 @@ namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
noteEqual = true;
|
noteEqual = true;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
var query = from questionAnswet in _readingTaskQuestionAnswerRepository.Where(x =>
|
var query = from questionAnswet in _readingTaskQuestionAnswerRepository.Where(x =>
|
||||||
x.VisitTask.IsAnalysisCreate==false&&
|
x.VisitTask.IsAnalysisCreate == false &&
|
||||||
x.VisitTask.DoctorUserId==visitTask.DoctorUserId&&
|
x.VisitTask.DoctorUserId == visitTask.DoctorUserId &&
|
||||||
x.VisitTask.TaskState== TaskState.Effect&&
|
x.VisitTask.TaskState == TaskState.Effect &&
|
||||||
(x.VisitTask.SourceSubjectVisitId??default(Guid))== lastTask.VisitId)
|
(x.VisitTask.SourceSubjectVisitId ?? default(Guid)) == lastTask.VisitId)
|
||||||
join question in _readingQuestionTrialRepository.Where(x => x.IsJudgeQuestion) on new { ReadingQuestionTrialId = questionAnswet.ReadingQuestionTrialId } equals new { ReadingQuestionTrialId = question.Id }
|
join question in _readingQuestionTrialRepository.Where(x => x.IsJudgeQuestion) on new { ReadingQuestionTrialId = questionAnswet.ReadingQuestionTrialId } equals new { ReadingQuestionTrialId = question.Id }
|
||||||
select new GlobalQuestionInfo()
|
select new GlobalQuestionInfo()
|
||||||
{
|
{
|
||||||
|
@ -2760,7 +2765,7 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var visitTaskQuestions =await query.ToListAsync();
|
var visitTaskQuestions = await query.ToListAsync();
|
||||||
|
|
||||||
var newlist = visitTaskQuestions.Where(x => x.QuestionId != null).ToList().Union(
|
var newlist = visitTaskQuestions.Where(x => x.QuestionId != null).ToList().Union(
|
||||||
lastTask.AfterQuestionList.Where(x => x.QuestionId != null).ToList()
|
lastTask.AfterQuestionList.Where(x => x.QuestionId != null).ToList()
|
||||||
|
@ -2892,23 +2897,10 @@ namespace IRaCIS.Application.Services
|
||||||
return noteEqual;
|
return noteEqual;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
#endregion
|
||||||
/// 添加裁判任务
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
private async Task SaveJudgeTask(SaveJudgeTaskDto inDto)
|
|
||||||
{
|
|
||||||
var trialId = await _visitTaskRepository.Where(x => inDto.VisitTaskIds.Contains(x.Id)).Select(x => x.TrialId).FirstOrDefaultAsync();
|
|
||||||
|
|
||||||
await _visitTaskHelpeService.AddTaskAsync(new GenerateTaskCommand()
|
|
||||||
{
|
|
||||||
JudgeVisitTaskIdList= inDto.VisitTaskIds,
|
|
||||||
ReadingCategory= GenerateTaskCategory.Judge,
|
|
||||||
TrialId= trialId
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
#region 验证
|
#region 阅片任务 签名验证
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 验证任务是否签名
|
/// 验证任务是否签名
|
||||||
|
@ -2926,5 +2918,39 @@ namespace IRaCIS.Application.Services
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region 废弃
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 完成阅片修改状态
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
private async Task FinishReadUpdateState(Guid visitTaskId)
|
||||||
|
{
|
||||||
|
//var taskInfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).FirstNotNullAsync();
|
||||||
|
//if (!await _visitTaskRepository.AnyAsync(x => x.SourceSubjectVisitId == taskInfo.SourceSubjectVisitId && x.SouceReadModuleId == taskInfo.SouceReadModuleId && x.ReadingTaskState != ReadingTaskState.HaveSigned))
|
||||||
|
//{
|
||||||
|
// if (taskInfo.SouceReadModuleId != null)
|
||||||
|
// {
|
||||||
|
// await _readModuleRepository.UpdatePartialFromQueryAsync(taskInfo.SouceReadModuleId.Value, x => new ReadModule
|
||||||
|
// {
|
||||||
|
// ReadingStatus = ReadingStatusEnum.ReadCompleted
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// else if (taskInfo.SourceSubjectVisitId != null)
|
||||||
|
// {
|
||||||
|
// await _subjectVisitRepository.UpdatePartialFromQueryAsync(taskInfo.SourceSubjectVisitId.Value, x => new SubjectVisit
|
||||||
|
// {
|
||||||
|
// ReadingStatus = ReadingStatusEnum.ReadCompleted
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// await _subjectVisitRepository.SaveChangesAsync();
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue