肿瘤学修改
parent
9eabd9031b
commit
b90743ded1
|
@ -1317,6 +1317,13 @@
|
|||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.Interface.ILuganoCalculateService.CalculateMergeTargetLesionStatus(IRaCIS.Core.Application.ViewModel.CalculateTargetLesionStatusInDto)">
|
||||
<summary>
|
||||
计算靶病灶融合后状态
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="F:IRaCIS.Core.Application.Service.ReadingCalculate.IRECIST1Point1CalculateService.sODData">
|
||||
<summary>
|
||||
获取Sod的值
|
||||
|
@ -5314,6 +5321,11 @@
|
|||
是否显示详情
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.GetOncologyReadingInfoOutDto.ReadingCategory">
|
||||
<summary>
|
||||
任务类型
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.GetRelatedVisitTaskOutDto.IsConvertedTask">
|
||||
<summary>
|
||||
是否是转变的任务(转为IRECIST)
|
||||
|
|
|
@ -1293,9 +1293,15 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
//任务阅片状态
|
||||
public ReadingTaskState ReadingTaskState { get; set; }
|
||||
|
||||
public Guid GlobalTaskId { get; set; }
|
||||
public Guid GlobalOrVisitTaskId { get; set; }
|
||||
|
||||
public Guid RelatedTaskId { get; set; }
|
||||
/// <summary>
|
||||
/// 任务类型
|
||||
/// </summary>
|
||||
public ReadingCategory ReadingCategory { get; set; }
|
||||
|
||||
|
||||
public Guid RelatedTaskId { get; set; }
|
||||
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
|
|
|
@ -2978,8 +2978,7 @@ namespace IRaCIS.Application.Services
|
|||
case ReadingCategory.Visit:
|
||||
needReadList = await _readModuleRepository.Where(x => x.SubjectVisitId == taskInfo.SourceSubjectVisitId &&
|
||||
|
||||
x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId &&
|
||||
x.ReadingSetType == ReadingSetType.ImageReading)
|
||||
x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId )
|
||||
.Select(x => new ReadingGenerataTaskDTO
|
||||
{
|
||||
IsUrgent = x.IsUrgent ?? false,
|
||||
|
@ -2992,16 +2991,25 @@ namespace IRaCIS.Application.Services
|
|||
if (needReadList.Any(x => x.ReadingCategory == ReadingCategory.Global))
|
||||
{
|
||||
needReadList = needReadList.Where(x => x.ReadingCategory != ReadingCategory.Oncology).ToList();
|
||||
}
|
||||
//needReadList = needReadList.Where(x => _visitTaskRepository.Where(y => y.SouceReadModuleId == x.ReadModuleId).Count() == 0).ToList();
|
||||
await _visitTaskHelpeService.AddTaskAsync(new GenerateTaskCommand()
|
||||
{
|
||||
OriginalVisitId = visitTaskId,
|
||||
ReadingCategory = GenerateTaskCategory.Global,
|
||||
TrialId = taskInfo.TrialId,
|
||||
await _visitTaskHelpeService.AddTaskAsync(new GenerateTaskCommand()
|
||||
{
|
||||
OriginalVisitId = visitTaskId,
|
||||
ReadingCategory = GenerateTaskCategory.Global,
|
||||
TrialId = taskInfo.TrialId,
|
||||
|
||||
ReadingGenerataTaskList = needReadList
|
||||
});
|
||||
ReadingGenerataTaskList = needReadList
|
||||
});
|
||||
}
|
||||
else if (needReadList.Any(x => x.ReadingCategory == ReadingCategory.Oncology))
|
||||
{
|
||||
// 添加肿瘤学
|
||||
if (await _visitTaskRepository.AnyAsync(x => x.Id == visitTaskId && x.JudgeVisitTaskId == null))
|
||||
{
|
||||
await AddOncologyTask(needReadList.First().ReadModuleId);
|
||||
}
|
||||
}
|
||||
//needReadList = needReadList.Where(x => _visitTaskRepository.Where(y => y.SouceReadModuleId == x.ReadModuleId).Count() == 0).ToList();
|
||||
|
||||
break;
|
||||
// 肿瘤学
|
||||
case ReadingCategory.Global:
|
||||
|
|
|
@ -429,7 +429,18 @@ namespace IRaCIS.Application.Services
|
|||
await _visitTaskRepository.SaveChangesAsync();
|
||||
// 需要判断是否添加肿瘤学任务
|
||||
var taskInfo = await _visitTaskRepository.Where(x => x.JudgeVisitTaskId == inDto.VisitTaskId).FirstNotNullAsync();
|
||||
if (taskInfo.ReadingCategory == ReadingCategory.Global)
|
||||
|
||||
if (taskInfo.ReadingCategory == ReadingCategory.Visit)
|
||||
{
|
||||
var oncologModule = await _readModuleRepository
|
||||
.Where(x => x.SubjectVisitId == taskInfo.SourceSubjectVisitId &&x.TrialReadingCriterionId==taskInfo.TrialReadingCriterionId&& x.ModuleType == ModuleTypeEnum.Oncology).FirstOrDefaultAsync();
|
||||
if (oncologModule != null)
|
||||
{
|
||||
await AddOncologyTask(oncologModule.Id);
|
||||
}
|
||||
}
|
||||
|
||||
else if (taskInfo.ReadingCategory == ReadingCategory.Global)
|
||||
{
|
||||
if (taskInfo.SouceReadModuleId == null)
|
||||
{
|
||||
|
@ -438,13 +449,16 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
var visitId = await _readModuleRepository.Where(x => x.Id == taskInfo.SouceReadModuleId).Select(x => x.SubjectVisitId).FirstOrDefaultAsync();
|
||||
|
||||
var oncologModuleId = await _readModuleRepository.Where(x => x.SubjectVisitId == visitId && x.ModuleType == ModuleTypeEnum.Oncology
|
||||
var oncologModule = await _readModuleRepository.Where(x => x.SubjectVisitId == visitId && x.ModuleType == ModuleTypeEnum.Oncology
|
||||
&&x.TrialReadingCriterionId== taskInfo.TrialReadingCriterionId
|
||||
).Select(x => x.Id).FirstOrDefaultAsync();
|
||||
).FirstOrDefaultAsync();
|
||||
|
||||
await AddOncologyTask(oncologModuleId);
|
||||
if (oncologModule != null)
|
||||
{
|
||||
await AddOncologyTask(oncologModule.Id);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var result = await _visitTaskRepository.SaveChangesAsync();
|
||||
|
|
|
@ -11,6 +11,7 @@ using Newtonsoft.Json;
|
|||
using IRaCIS.Core.Application.Service;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using IRaCIS.Core.Application.Filter;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
|
@ -45,14 +46,14 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
//TrialEvaluationResult = trialCriterion.EvaluationResult,
|
||||
IsShowDetail = trialCriterion.IsShowDetail,
|
||||
TrialEvaluationReason = trialCriterion.EvaluationReason.IsNullOrEmpty() ? ReadingCommon.EvaluationReason : trialCriterion.EvaluationReason,
|
||||
TrialEvaluationReason = trialCriterion.EvaluationReason,
|
||||
OncologyTaskId = inDto.VisitTaskId,
|
||||
ReadingTaskState = taskInfo.ReadingTaskState,
|
||||
};
|
||||
|
||||
// 先找到是R1还是R2的阅片 先找到全局阅片
|
||||
|
||||
VisitTask? globalTaskInfo = null;
|
||||
VisitTask? globalOrVisitTaskInfo = null;
|
||||
var relatedVisitTaskIdList = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.RelatedVisitTaskIdList).FirstNotNullAsync();
|
||||
Guid? judgeResultTaskId = null;
|
||||
if (taskInfo.ReadingTaskState == ReadingTaskState.HaveSigned && relatedVisitTaskIdList.Count() > 0)
|
||||
|
@ -62,25 +63,32 @@ namespace IRaCIS.Application.Services
|
|||
// 说明是裁判 取裁判结果
|
||||
if (judgeResultTaskId != null)
|
||||
{
|
||||
globalTaskInfo = await _visitTaskRepository.Where(x =>x.Id== judgeResultTaskId).FirstNotNullAsync();
|
||||
globalOrVisitTaskInfo = await _visitTaskRepository.Where(x =>x.Id== judgeResultTaskId).FirstNotNullAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
globalTaskInfo = await _visitTaskRepository.Where(x => x.Id == relatedVisitTaskIdList[0]).FirstNotNullAsync();
|
||||
globalOrVisitTaskInfo = await _visitTaskRepository.Where(x => x.Id == relatedVisitTaskIdList[0]).FirstNotNullAsync();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var taskNums = new List<decimal>() {
|
||||
// 全局
|
||||
(decimal) (taskInfo.VisitTaskNum - ReadingCommon.TaskNumDic[ReadingCategory.Oncology] + ReadingCommon.TaskNumDic[ReadingCategory.Global]),
|
||||
|
||||
var taskNum = taskInfo.VisitTaskNum - ReadingCommon.TaskNumDic[ReadingCategory.Oncology] + ReadingCommon.TaskNumDic[ReadingCategory.Global];
|
||||
// 访视
|
||||
(decimal)(taskInfo.VisitTaskNum - ReadingCommon.TaskNumDic[ReadingCategory.Oncology])
|
||||
};
|
||||
|
||||
globalTaskInfo = await _visitTaskRepository
|
||||
|
||||
|
||||
globalOrVisitTaskInfo = await _visitTaskRepository
|
||||
.Where(x => x.SubjectId == taskInfo.SubjectId &&
|
||||
x.TaskState == TaskState.Effect &&
|
||||
x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId &&
|
||||
x.VisitTaskNum== taskNum &&
|
||||
taskNums.Contains(x.VisitTaskNum) &&
|
||||
x.ReadingCategory == ReadingCategory.Global &&
|
||||
x.IsAnalysisCreate == taskInfo.IsAnalysisCreate &&
|
||||
x.IsSelfAnalysis == taskInfo.IsSelfAnalysis &&
|
||||
|
@ -93,44 +101,111 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
|
||||
// 最后取哪组的数据
|
||||
VisitTask visitTask = new VisitTask();
|
||||
//VisitTask visitTask = new VisitTask();
|
||||
|
||||
List<Guid> visitTaskIdList = new List<Guid>();
|
||||
|
||||
// 判断是否产生裁判
|
||||
|
||||
if (globalTaskInfo!.JudgeVisitTaskId == null)
|
||||
if (globalOrVisitTaskInfo!.JudgeVisitTaskId == null)
|
||||
{
|
||||
visitTask = globalTaskInfo;
|
||||
//visitTask = globalTaskInfo;
|
||||
// 全局的关联访视
|
||||
visitTaskIdList = await _visitTaskRepository.Where(x => x.Id == visitTask.Id).Select(x => x.RelatedVisitTaskIdList).FirstNotNullAsync();
|
||||
visitTaskIdList = await _visitTaskRepository.Where(x => x.Id == globalOrVisitTaskInfo.Id).Select(x => x.RelatedVisitTaskIdList).FirstNotNullAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (judgeResultTaskId == null)
|
||||
{
|
||||
judgeResultTaskId = await _visitTaskRepository.Where(x => x.Id == globalTaskInfo.JudgeVisitTaskId).Select(x => x.JudgeResultTaskId).FirstOrDefaultAsync();
|
||||
judgeResultTaskId = await _visitTaskRepository.Where(x => x.Id == globalOrVisitTaskInfo.JudgeVisitTaskId).Select(x => x.JudgeResultTaskId).FirstOrDefaultAsync();
|
||||
if (judgeResultTaskId == null)
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["ReadingOncology_Abnormal"]);
|
||||
}
|
||||
}
|
||||
|
||||
visitTask = await _visitTaskRepository.Where(x => x.Id == judgeResultTaskId).FirstNotNullAsync();
|
||||
//visitTask = await _visitTaskRepository.Where(x => x.Id == judgeResultTaskId).FirstNotNullAsync();
|
||||
visitTaskIdList= await _visitTaskRepository.Where(x => x.Id == judgeResultTaskId).Select(x=>x.RelatedVisitTaskIdList).FirstNotNullAsync();
|
||||
}
|
||||
|
||||
result.RelatedTaskId = globalTaskInfo!.JudgeVisitTaskId ?? globalTaskInfo.Id;
|
||||
result.GlobalTaskId = visitTask.Id;
|
||||
result.SubjectId = visitTask.SubjectId;
|
||||
|
||||
// 获取全局阅片信息
|
||||
var globalTaskReadingInfo = await this.GetGlobalReadingInfo(new GetGlobalReadingInfoInDto()
|
||||
|
||||
result.RelatedTaskId = globalOrVisitTaskInfo!.JudgeVisitTaskId ?? globalOrVisitTaskInfo.Id;
|
||||
result.ReadingCategory = globalOrVisitTaskInfo.ReadingCategory;
|
||||
|
||||
result.GlobalOrVisitTaskId = globalOrVisitTaskInfo.Id;
|
||||
result.SubjectId = globalOrVisitTaskInfo.SubjectId;
|
||||
|
||||
|
||||
List<GlobalVisitInfo> globalVisits=new List<GlobalVisitInfo>();
|
||||
|
||||
if (result.ReadingCategory == ReadingCategory.Global)
|
||||
{
|
||||
UsingOriginalData = true,
|
||||
VisitTaskId = visitTask.Id
|
||||
});
|
||||
globalVisits = (await this.GetGlobalReadingInfo(new GetGlobalReadingInfoInDto()
|
||||
{
|
||||
UsingOriginalData = true,
|
||||
VisitTaskId = result.GlobalOrVisitTaskId
|
||||
})).TaskList;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// 按照全局那边的查询法
|
||||
globalVisits =await _visitTaskRepository.Where(x =>
|
||||
x.TrialId == taskInfo.TrialId &&
|
||||
x.SubjectId == taskInfo.SubjectId &&
|
||||
x.ReadingCategory == ReadingCategory.Visit &&
|
||||
x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId &&
|
||||
x.ReadingTaskState == ReadingTaskState.HaveSigned &&
|
||||
x.IsAnalysisCreate == taskInfo.IsAnalysisCreate &&
|
||||
x.ArmEnum == taskInfo.ArmEnum &&
|
||||
x.IsSelfAnalysis == taskInfo.IsSelfAnalysis &&
|
||||
x.DoctorUserId == taskInfo.DoctorUserId &&
|
||||
x.TaskState == TaskState.Effect &&
|
||||
x.VisitTaskNum < globalOrVisitTaskInfo.VisitTaskNum)
|
||||
.OrderBy(x => x.VisitTaskNum).Select(x => new GlobalVisitInfo()
|
||||
{
|
||||
VisitName = x.TaskName,
|
||||
BlindName = x.TaskBlindName,
|
||||
VisitTaskId = x.Id,
|
||||
IsConvertedTask = x.IsConvertedTask,
|
||||
IsFirstChangeTask = x.IsConvertedTask && x.BeforeConvertedTaskId != null,
|
||||
ArmEnum = taskInfo.ArmEnum,
|
||||
VisitNum = x.SourceSubjectVisit.VisitNum,
|
||||
IsBaseLine = x.SourceSubjectVisit.IsBaseLine,
|
||||
VisitId = x.SourceSubjectVisitId!.Value,
|
||||
LesionCountList = x.LesionList.GroupBy(y => y.ReadingQuestionTrial.LesionType).Select(x => new LesionDto
|
||||
{
|
||||
LesionType = x.Key!.Value,
|
||||
Count = x.ToList().Count()
|
||||
}).ToList(),
|
||||
//CrterionDictionaryGroup= x.CrterionDictionaryGroup,
|
||||
BeforeQuestionList = x.ReadingTaskQuestionAnswerList.Where(y => y.ReadingQuestionTrial.GlobalReadingShowType != GlobalReadingShowType.NotShow).OrderBy(y => y.ReadingQuestionTrial.ShowOrder)
|
||||
.Select(y => new GlobalQuestionInfo()
|
||||
{
|
||||
|
||||
QuestionId = y.ReadingQuestionTrialId,
|
||||
QuestionName = y.ReadingQuestionTrial.QuestionName.LanguageName(y.ReadingQuestionTrial.QuestionEnName, _userInfo.IsEn_Us),
|
||||
QuestionEnName = y.ReadingQuestionTrial.QuestionEnName,
|
||||
AnswerGroup = y.ReadingQuestionTrial.AnswerGroup,
|
||||
QuestionType = y.ReadingQuestionTrial.QuestionType,
|
||||
LimitEdit = y.ReadingQuestionTrial.LimitEdit,
|
||||
MaxAnswerLength = y.ReadingQuestionTrial.MaxAnswerLength,
|
||||
FileType = y.ReadingQuestionTrial.FileType,
|
||||
QuestionGenre = y.ReadingQuestionTrial.QuestionGenre,
|
||||
DictionaryCode = y.ReadingQuestionTrial.DictionaryCode,
|
||||
GlobalReadingShowType = y.ReadingQuestionTrial.GlobalReadingShowType,
|
||||
AnswerCombination = y.ReadingQuestionTrial.AnswerCombination,
|
||||
JudgeType = y.ReadingQuestionTrial.JudgeType,
|
||||
ShowOrder = y.ReadingQuestionTrial.ShowOrder,
|
||||
Type = y.ReadingQuestionTrial.Type,
|
||||
TypeValue = y.ReadingQuestionTrial.TypeValue,
|
||||
ValueType = y.ReadingQuestionTrial.ValueType,
|
||||
IsJudgeQuestion = y.ReadingQuestionTrial.IsJudgeQuestion,
|
||||
Answer = y.Answer,
|
||||
}).ToList()
|
||||
}).ToListAsync();
|
||||
}
|
||||
|
||||
// 找到对应的访视
|
||||
List<OncologyVisitTaskInfo> oncologyVisits = await _visitTaskRepository.Where(x => visitTaskIdList.Contains(x.Id))
|
||||
|
@ -199,7 +274,7 @@ namespace IRaCIS.Application.Services
|
|||
x.EvaluationResult = evaluationResult;
|
||||
x.EvaluationReason = evaluationReason;
|
||||
|
||||
x.QuestionList = globalTaskReadingInfo.TaskList.Where(y => x.VisitTaskId == y.VisitTaskId).SelectMany(y => y.AfterQuestionList).Where(x => x.GlobalAnswerType == GlobalAnswerType.Question)
|
||||
x.QuestionList = globalVisits.Where(y => x.VisitTaskId == y.VisitTaskId).SelectMany(y => y.AfterQuestionList).Where(x => x.GlobalAnswerType == GlobalAnswerType.Question)
|
||||
.Select(y => new OncologyQuestion
|
||||
{
|
||||
QuestionId = y.QuestionId ?? default(Guid),
|
||||
|
@ -208,8 +283,8 @@ namespace IRaCIS.Application.Services
|
|||
DictionaryCode=y.DictionaryCode,
|
||||
Answer = y.Answer
|
||||
}).ToList();
|
||||
x.IsHaveChange = globalTaskReadingInfo.TaskList.Where(y => x.VisitTaskId == y.VisitTaskId).SelectMany(y => y.AfterQuestionList).Any(y => y.IsHaveChange);
|
||||
x.VisitRemark = globalTaskReadingInfo.TaskList.Where(y => x.VisitTaskId == y.VisitTaskId).SelectMany(y => y.AfterQuestionList).Where(y => y.GlobalAnswerType == GlobalAnswerType.Reason).Select(x => x.Answer).FirstOrDefault() ?? string.Empty;
|
||||
x.IsHaveChange = result.ReadingCategory == ReadingCategory.Visit?false: globalVisits.Where(y => x.VisitTaskId == y.VisitTaskId).SelectMany(y => y.AfterQuestionList).Any(y => y.IsHaveChange);
|
||||
x.VisitRemark = result.ReadingCategory == ReadingCategory.Visit ? string.Empty : globalVisits.Where(y => x.VisitTaskId == y.VisitTaskId).SelectMany(y => y.AfterQuestionList).Where(y => y.GlobalAnswerType == GlobalAnswerType.Reason).Select(x => x.Answer).FirstOrDefault() ?? string.Empty;
|
||||
|
||||
});
|
||||
|
||||
|
|
|
@ -303,7 +303,7 @@ namespace IRaCIS.Application.Services
|
|||
var readModulequery = _readModuleRepository.AsQueryable().Where(x=>x.TrialReadingCriterionId == inDto.TrialReadingCriterionId);
|
||||
|
||||
var resultlist= await visitQuery.WhereIf(finalVisitNum!=0, x => x.VisitNum <= finalVisitNum)
|
||||
.WhereIf(inDto.ReadingSetType== ReadingSetType.TumorReading, x => readModulequery.Where(y => y.SubjectVisitId == x.Id&&y.TrialReadingCriterionId== inDto.TrialReadingCriterionId && y.ReadingSetType == ReadingSetType.ImageReading).Count() > 0)
|
||||
// .WhereIf(inDto.ReadingSetType== ReadingSetType.TumorReading, x => readModulequery.Where(y => y.SubjectVisitId == x.Id&&y.TrialReadingCriterionId== inDto.TrialReadingCriterionId && y.ReadingSetType == ReadingSetType.ImageReading).Count() > 0)
|
||||
.Where(x=>x.VisitNum> maxReadVisitNum)
|
||||
.Where(x=>!x.IsBaseLine) // 排除基线
|
||||
.Where(x => readModulequery.Where(y => y.SubjectVisitId == x.Id&& y.TrialReadingCriterionId == inDto.TrialReadingCriterionId && y.ReadingSetType == inDto.ReadingSetType).Count() == 0).OrderBy(x => finalVisitNum)
|
||||
|
|
|
@ -935,7 +935,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
//(当前融合靶病灶的ppd-最低点PPD)/最低点PPD ≥50 %
|
||||
|
||||
if (majorAxis >= 15 &&
|
||||
(pPdAnswer - lowPPDInfo.NadirPPD) * 100 / lowPPDInfo.NadirPPD >= 50
|
||||
(pPdAnswer - lowPPDInfo.NadirPPD) * 100 / lowPPDInfo.NadirPPD >= 50)
|
||||
{
|
||||
accord = true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue