Uat_Study
parent
a59f71a01e
commit
424174636e
|
@ -133,12 +133,12 @@ namespace IRaCIS.Application.Services
|
||||||
/// <param name="inDto"></param>
|
/// <param name="inDto"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<(List<TrialAdditionaQuestion>,bool)> GetTaskAdditionalQuestion(GetTaskAdditionalQuestionInDto inDto)
|
public async Task<(List<TrialAdditionaQuestion>, bool)> GetTaskAdditionalQuestion(GetTaskAdditionalQuestionInDto inDto)
|
||||||
{
|
{
|
||||||
|
|
||||||
var answerList = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).IgnoreAutoIncludes().ToListAsync();
|
var answerList = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).IgnoreAutoIncludes().ToListAsync();
|
||||||
var taskInfo = await _visitTaskRepository.Where(x => inDto.VisitTaskId == x.Id).FirstNotNullAsync();
|
var taskInfo = await _visitTaskRepository.Where(x => inDto.VisitTaskId == x.Id).FirstNotNullAsync();
|
||||||
var result= await _readingQuestionTrialRepository.Where(x => x.IsAdditional && x.ReadingQuestionCriterionTrialId == taskInfo.TrialReadingCriterionId).IgnoreAutoIncludes().IgnoreQueryFilters().ProjectTo<TrialAdditionaQuestion>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ToListAsync();
|
var result = await _readingQuestionTrialRepository.Where(x => x.IsAdditional && x.ReadingQuestionCriterionTrialId == taskInfo.TrialReadingCriterionId).IgnoreAutoIncludes().IgnoreQueryFilters().ProjectTo<TrialAdditionaQuestion>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ToListAsync();
|
||||||
|
|
||||||
result.ForEach(x =>
|
result.ForEach(x =>
|
||||||
{
|
{
|
||||||
|
@ -223,7 +223,7 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
relatedIds = JsonConvert.DeserializeObject<List<Guid>>(item.RelatedVisitTaskIds)?? new List<Guid>();
|
relatedIds = JsonConvert.DeserializeObject<List<Guid>>(item.RelatedVisitTaskIds) ?? new List<Guid>();
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
@ -270,7 +270,7 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
var questionAnswerList = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).ToListAsync();
|
var questionAnswerList = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).ToListAsync();
|
||||||
|
|
||||||
var tableQuestionAnswerList= await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).ToListAsync();
|
var tableQuestionAnswerList = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).ToListAsync();
|
||||||
|
|
||||||
var rowInfoList = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).ToListAsync();
|
var rowInfoList = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).ToListAsync();
|
||||||
|
|
||||||
|
@ -284,25 +284,26 @@ namespace IRaCIS.Application.Services
|
||||||
Answer = item.Answer,
|
Answer = item.Answer,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await _readingTaskQuestionAnswerRepository.AddAsync(new ReadingTaskQuestionAnswer() {
|
await _readingTaskQuestionAnswerRepository.AddAsync(new ReadingTaskQuestionAnswer()
|
||||||
Answer=item.Answer,
|
{
|
||||||
ReadingQuestionCriterionTrialId= visitTask.TrialReadingCriterionId,
|
Answer = item.Answer,
|
||||||
ReadingQuestionTrialId= item.QuestionId,
|
ReadingQuestionCriterionTrialId = visitTask.TrialReadingCriterionId,
|
||||||
SubjectId= visitTask.SubjectId,
|
ReadingQuestionTrialId = item.QuestionId,
|
||||||
VisitTaskId=inDto.VisitTaskId,
|
SubjectId = visitTask.SubjectId,
|
||||||
TrialId= visitTask.TrialId
|
VisitTaskId = inDto.VisitTaskId,
|
||||||
|
TrialId = visitTask.TrialId
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var item in inDto.TableQuestionAnswer)
|
foreach (var item in inDto.TableQuestionAnswer)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (tableQuestionAnswerList.Any(x => x.QuestionId == item.QuestionId&&x.RowId==item.RowId&&x.TableQuestionId==item.TableQuestionId))
|
if (tableQuestionAnswerList.Any(x => x.QuestionId == item.QuestionId && x.RowId == item.RowId && x.TableQuestionId == item.TableQuestionId))
|
||||||
{
|
{
|
||||||
await _readingTableQuestionAnswerRepository.UpdatePartialFromQueryAsync(x => x.VisitTaskId == inDto.VisitTaskId && x.RowId == item.RowId && x.TableQuestionId == item.TableQuestionId, x => new ReadingTableQuestionAnswer()
|
await _readingTableQuestionAnswerRepository.UpdatePartialFromQueryAsync(x => x.VisitTaskId == inDto.VisitTaskId && x.RowId == item.RowId && x.TableQuestionId == item.TableQuestionId, x => new ReadingTableQuestionAnswer()
|
||||||
{
|
{
|
||||||
|
@ -312,21 +313,21 @@ namespace IRaCIS.Application.Services
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
var rowInfo = rowInfoList.Where(x => x.Id == item.RowId).FirstOrDefault()??new ReadingTableAnswerRowInfo ();
|
var rowInfo = rowInfoList.Where(x => x.Id == item.RowId).FirstOrDefault() ?? new ReadingTableAnswerRowInfo();
|
||||||
|
|
||||||
await _readingTableQuestionAnswerRepository.AddAsync(new ReadingTableQuestionAnswer()
|
await _readingTableQuestionAnswerRepository.AddAsync(new ReadingTableQuestionAnswer()
|
||||||
{
|
{
|
||||||
Answer = item.Answer,
|
Answer = item.Answer,
|
||||||
QuestionId=item.QuestionId,
|
QuestionId = item.QuestionId,
|
||||||
TableQuestionId=item.TableQuestionId,
|
TableQuestionId = item.TableQuestionId,
|
||||||
RowIndex= rowInfo.RowIndex,
|
RowIndex = rowInfo.RowIndex,
|
||||||
RowId=rowInfo.Id,
|
RowId = rowInfo.Id,
|
||||||
VisitTaskId = inDto.VisitTaskId,
|
VisitTaskId = inDto.VisitTaskId,
|
||||||
TrialId = visitTask.TrialId
|
TrialId = visitTask.TrialId
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
||||||
|
@ -417,21 +418,21 @@ namespace IRaCIS.Application.Services
|
||||||
var baselineVisitId = await _subjectVisitRepository.Where(x => x.SubjectId == taskInfo.SubjectId && x.IsBaseLine && !x.IsLostVisit).Select(x => x.Id).FirstNotNullAsync();
|
var baselineVisitId = await _subjectVisitRepository.Where(x => x.SubjectId == taskInfo.SubjectId && x.IsBaseLine && !x.IsLostVisit).Select(x => x.Id).FirstNotNullAsync();
|
||||||
|
|
||||||
|
|
||||||
var taskQuery = _visitTaskRepository.Where(x =>
|
var taskQuery = _visitTaskRepository.Where(x =>
|
||||||
(x.TrialId == taskInfo.TrialId &&
|
(x.TrialId == taskInfo.TrialId &&
|
||||||
x.SubjectId == taskInfo.SubjectId &&
|
x.SubjectId == taskInfo.SubjectId &&
|
||||||
x.ArmEnum == taskInfo.ArmEnum &&
|
x.ArmEnum == taskInfo.ArmEnum &&
|
||||||
x.DoctorUserId == taskInfo.DoctorUserId &&
|
x.DoctorUserId == taskInfo.DoctorUserId &&
|
||||||
x.ReadingTaskState == ReadingTaskState.HaveSigned &&
|
x.ReadingTaskState == ReadingTaskState.HaveSigned &&
|
||||||
x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId &&
|
x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId &&
|
||||||
x.TaskState == TaskState.Effect &&
|
x.TaskState == TaskState.Effect &&
|
||||||
x.VisitTaskNum <= taskInfo.VisitTaskNum &&
|
x.VisitTaskNum <= taskInfo.VisitTaskNum &&
|
||||||
x.IsAnalysisCreate == taskInfo.IsAnalysisCreate &&
|
x.IsAnalysisCreate == taskInfo.IsAnalysisCreate &&
|
||||||
x.ReadingCategory == ReadingCategory.Visit) || x.Id == inDto.VisitTaskId);
|
x.ReadingCategory == ReadingCategory.Visit) || x.Id == inDto.VisitTaskId);
|
||||||
|
|
||||||
if (taskInfo.ReadingTaskState == ReadingTaskState.HaveSigned)
|
if (taskInfo.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||||
{
|
{
|
||||||
taskQuery = _visitTaskRepository.Where(x => taskInfo.RelatedVisitTaskIdList.Contains(x.Id)||x.Id== taskInfo.Id);
|
taskQuery = _visitTaskRepository.Where(x => taskInfo.RelatedVisitTaskIdList.Contains(x.Id) || x.Id == taskInfo.Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
var result = await taskQuery
|
var result = await taskQuery
|
||||||
|
@ -489,12 +490,13 @@ namespace IRaCIS.Application.Services
|
||||||
taskQuery = _visitTaskRepository.Where(x => taskInfo.PastResultTaskIdList.Contains(x.Id));
|
taskQuery = _visitTaskRepository.Where(x => taskInfo.PastResultTaskIdList.Contains(x.Id));
|
||||||
}
|
}
|
||||||
|
|
||||||
var readingPastResultList = await taskQuery.Select(x => new GetReadingPastResultListOutDto() {
|
var readingPastResultList = await taskQuery.Select(x => new GetReadingPastResultListOutDto()
|
||||||
|
{
|
||||||
VisitTaskId = x.Id,
|
VisitTaskId = x.Id,
|
||||||
TaskBlindName = x.TaskBlindName,
|
TaskBlindName = x.TaskBlindName,
|
||||||
TaskName = x.TaskName,
|
TaskName = x.TaskName,
|
||||||
VisitTaskNum = x.VisitTaskNum,
|
VisitTaskNum = x.VisitTaskNum,
|
||||||
JudgeResultArm = x.JudgeResultTask == null?null:x.JudgeResultTask.ArmEnum,
|
JudgeResultArm = x.JudgeResultTask == null ? null : x.JudgeResultTask.ArmEnum,
|
||||||
|
|
||||||
}).OrderBy(x => x.VisitTaskNum).ToListAsync();
|
}).OrderBy(x => x.VisitTaskNum).ToListAsync();
|
||||||
return readingPastResultList;
|
return readingPastResultList;
|
||||||
|
@ -623,8 +625,9 @@ namespace IRaCIS.Application.Services
|
||||||
.WhereIf(criterionIdInfo.IseCRFShowInDicomReading, x => x.ReadingQuestionCriterionTrialId == trialReadingCriterionId && x.Type != ReadingQestionType.Table)
|
.WhereIf(criterionIdInfo.IseCRFShowInDicomReading, x => x.ReadingQuestionCriterionTrialId == trialReadingCriterionId && x.Type != ReadingQestionType.Table)
|
||||||
.WhereIf(!criterionIdInfo.IseCRFShowInDicomReading, x => x.IsShowInDicom && x.ReadingQuestionCriterionTrialId == trialReadingCriterionId && x.Type != ReadingQestionType.Table)
|
.WhereIf(!criterionIdInfo.IseCRFShowInDicomReading, x => x.IsShowInDicom && x.ReadingQuestionCriterionTrialId == trialReadingCriterionId && x.Type != ReadingQestionType.Table)
|
||||||
|
|
||||||
.ProjectTo<DicomReadingQuestionAnswer>(_mapper.ConfigurationProvider,new{
|
.ProjectTo<DicomReadingQuestionAnswer>(_mapper.ConfigurationProvider, new
|
||||||
isEn_Us=_userInfo.IsEn_Us
|
{
|
||||||
|
isEn_Us = _userInfo.IsEn_Us
|
||||||
|
|
||||||
}).OrderBy(x => x.ShowOrder).ToListAsync();
|
}).OrderBy(x => x.ShowOrder).ToListAsync();
|
||||||
|
|
||||||
|
@ -643,7 +646,7 @@ namespace IRaCIS.Application.Services
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var crterionDictionaryGroup= new List<CrterionDictionaryGroup>() { CrterionDictionaryGroup.General, CrterionDictionaryGroup.BeforeConvert };
|
var crterionDictionaryGroup = new List<CrterionDictionaryGroup>() { CrterionDictionaryGroup.General, CrterionDictionaryGroup.BeforeConvert };
|
||||||
questions.ForEach(x =>
|
questions.ForEach(x =>
|
||||||
{
|
{
|
||||||
x.CrterionDictionaryGroup = crterionDictionaryGroup;
|
x.CrterionDictionaryGroup = crterionDictionaryGroup;
|
||||||
|
@ -666,11 +669,11 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
private void GetDicomReadingAnswer(DicomReadingQuestionAnswer item, List<DicomReadingQuestionAnswer> questions, List<ReadingTaskQuestionAnswer> answers)
|
private void GetDicomReadingAnswer(DicomReadingQuestionAnswer item, List<DicomReadingQuestionAnswer> questions, List<ReadingTaskQuestionAnswer> answers)
|
||||||
{
|
{
|
||||||
var answer= answers.Where(x => x.ReadingQuestionTrialId == item.Id).Select(x => x.Answer).FirstIsNullReturnEmpty();
|
var answer = answers.Where(x => x.ReadingQuestionTrialId == item.Id).Select(x => x.Answer).FirstIsNullReturnEmpty();
|
||||||
item.Answer = answer.IsNullOrEmpty() ? item.DefaultValue : answer;
|
item.Answer = answer.IsNullOrEmpty() ? item.DefaultValue : answer;
|
||||||
|
|
||||||
|
|
||||||
item.Childrens = questions.Where(x => x.ParentId == item.Id || (x.GroupId==item.Id&&x.ParentId==null)).ToList();
|
item.Childrens = questions.Where(x => x.ParentId == item.Id || (x.GroupId == item.Id && x.ParentId == null)).ToList();
|
||||||
if (item.Childrens != null && item.Childrens.Count > 0)
|
if (item.Childrens != null && item.Childrens.Count > 0)
|
||||||
{
|
{
|
||||||
foreach (var question in item.Childrens)
|
foreach (var question in item.Childrens)
|
||||||
|
@ -733,7 +736,7 @@ namespace IRaCIS.Application.Services
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
result.ForEach(x =>
|
result.ForEach(x =>
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -776,17 +779,18 @@ namespace IRaCIS.Application.Services
|
||||||
var organList = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync();
|
var organList = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync();
|
||||||
var questionPage = await GetReadingTableQuestion(
|
var questionPage = await GetReadingTableQuestion(
|
||||||
|
|
||||||
new GetReadingTableQuestionOrAnswerInDto() {
|
new GetReadingTableQuestionOrAnswerInDto()
|
||||||
|
{
|
||||||
|
|
||||||
TrialReadingCriterionId = taskinfo.TrialReadingCriterionId,
|
TrialReadingCriterionId = taskinfo.TrialReadingCriterionId,
|
||||||
TaskId = inDto.VisitTaskId,
|
TaskId = inDto.VisitTaskId,
|
||||||
TableAnswers = tableAnswers,
|
TableAnswers = tableAnswers,
|
||||||
TableAnsweRowInfos = tableAnsweRowInfos,
|
TableAnsweRowInfos = tableAnsweRowInfos,
|
||||||
OrganInfos= organList,
|
OrganInfos = organList,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
result.SinglePage = questionPage.SinglePage;
|
result.SinglePage = questionPage.SinglePage;
|
||||||
result.MultiPage = questionPage.MultiPage;
|
result.MultiPage = questionPage.MultiPage;
|
||||||
|
@ -815,7 +819,7 @@ namespace IRaCIS.Application.Services
|
||||||
//await _readingCalculateService.AddTaskLesionAnswerFromLastTask(new AddTaskLesionAnswerFromLastTaskInDto() {
|
//await _readingCalculateService.AddTaskLesionAnswerFromLastTask(new AddTaskLesionAnswerFromLastTaskInDto() {
|
||||||
//VisitTaskId=inDto.VisitTaskId
|
//VisitTaskId=inDto.VisitTaskId
|
||||||
//});
|
//});
|
||||||
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x=>x.SourceSubjectVisit).FirstNotNullAsync();
|
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.SourceSubjectVisit).FirstNotNullAsync();
|
||||||
|
|
||||||
var tableAnswers = await _readingTableQuestionAnswerRepository
|
var tableAnswers = await _readingTableQuestionAnswerRepository
|
||||||
.ProjectTo<ReadingTableQuestionAnswerInfo>(_mapper.ConfigurationProvider)
|
.ProjectTo<ReadingTableQuestionAnswerInfo>(_mapper.ConfigurationProvider)
|
||||||
|
@ -834,12 +838,13 @@ namespace IRaCIS.Application.Services
|
||||||
TableAnswers = tableAnswers,
|
TableAnswers = tableAnswers,
|
||||||
TableAnsweRowInfos = tableAnsweRowInfos,
|
TableAnsweRowInfos = tableAnsweRowInfos,
|
||||||
IsGetallQuestion = true,
|
IsGetallQuestion = true,
|
||||||
OrganInfos= organList
|
OrganInfos = organList
|
||||||
|
|
||||||
}
|
}
|
||||||
),new {
|
), new
|
||||||
IsBaseline= taskInfo.SourceSubjectVisit!=null&&taskInfo.SourceSubjectVisit.IsBaseLine,
|
{
|
||||||
ReadingTaskState= taskInfo.ReadingTaskState
|
IsBaseline = taskInfo.SourceSubjectVisit != null && taskInfo.SourceSubjectVisit.IsBaseLine,
|
||||||
|
ReadingTaskState = taskInfo.ReadingTaskState
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -854,15 +859,16 @@ namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).FirstNotNullAsync();
|
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).FirstNotNullAsync();
|
||||||
|
|
||||||
var qusetionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId).ProjectTo<TrialReadQuestionData>(_mapper.ConfigurationProvider,new {
|
var qusetionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId).ProjectTo<TrialReadQuestionData>(_mapper.ConfigurationProvider, new
|
||||||
|
{
|
||||||
|
|
||||||
isEn_Us=_userInfo.IsEn_Us
|
isEn_Us = _userInfo.IsEn_Us
|
||||||
|
|
||||||
}).OrderBy(x => x.ShowOrder).ToListAsync();
|
}).OrderBy(x => x.ShowOrder).ToListAsync();
|
||||||
var taskInfo = new VisitTask();
|
var taskInfo = new VisitTask();
|
||||||
if (inDto.TaskId != null)
|
if (inDto.TaskId != null)
|
||||||
{
|
{
|
||||||
taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.TaskId).FirstNotNullAsync();
|
taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.TaskId).FirstNotNullAsync();
|
||||||
|
|
||||||
qusetionList.ForEach(x =>
|
qusetionList.ForEach(x =>
|
||||||
{
|
{
|
||||||
|
@ -879,7 +885,7 @@ namespace IRaCIS.Application.Services
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//是否是预览
|
//是否是预览
|
||||||
if (inDto.IsGetPreview == false)
|
if (inDto.IsGetPreview == false)
|
||||||
{
|
{
|
||||||
// 是否获取所有问题
|
// 是否获取所有问题
|
||||||
|
@ -898,13 +904,13 @@ namespace IRaCIS.Application.Services
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (inDto.TaskId != null&& !taskInfo.IsConvertedTask)
|
if (inDto.TaskId != null && !taskInfo.IsConvertedTask)
|
||||||
{
|
{
|
||||||
qusetionList= qusetionList.Where(x=>x.QuestionType!=QuestionType.IsConverted).OrderBy(x => x.ShowOrder).ToList();
|
qusetionList = qusetionList.Where(x => x.QuestionType != QuestionType.IsConverted).OrderBy(x => x.ShowOrder).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
var usedGuropIds = qusetionList.Where(x => x.Type == ReadingQestionType.Table).Select(x => x.GroupId).ToList();
|
var usedGuropIds = qusetionList.Where(x => x.Type == ReadingQestionType.Table).Select(x => x.GroupId).ToList();
|
||||||
qusetionList = qusetionList.Where(x => usedGuropIds.Contains(x.Id)|| usedGuropIds.Contains(x.GroupId)).ToList();
|
qusetionList = qusetionList.Where(x => usedGuropIds.Contains(x.Id) || usedGuropIds.Contains(x.GroupId)).ToList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -923,9 +929,10 @@ namespace IRaCIS.Application.Services
|
||||||
var qusetionIds = qusetionList.Select(x => x.Id).ToList();
|
var qusetionIds = qusetionList.Select(x => x.Id).ToList();
|
||||||
|
|
||||||
var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => qusetionIds.Contains(x.ReadingQuestionId))
|
var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => qusetionIds.Contains(x.ReadingQuestionId))
|
||||||
.ProjectTo<TableQuestionTrial>(_mapper.ConfigurationProvider,new {
|
.ProjectTo<TableQuestionTrial>(_mapper.ConfigurationProvider, new
|
||||||
|
{
|
||||||
|
|
||||||
isEn_Us=_userInfo.IsEn_Us
|
isEn_Us = _userInfo.IsEn_Us
|
||||||
})
|
})
|
||||||
.OrderBy(x => x.ShowOrder).ToListAsync();
|
.OrderBy(x => x.ShowOrder).ToListAsync();
|
||||||
|
|
||||||
|
@ -934,7 +941,9 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
List<ReadingTableQuestionAnswer> baseLineTableAnswer = new List<ReadingTableQuestionAnswer>();
|
List<ReadingTableQuestionAnswer> baseLineTableAnswer = new List<ReadingTableQuestionAnswer>();
|
||||||
|
|
||||||
if(inDto.TaskId!=null)
|
bool isFirstChangeTask = false;
|
||||||
|
|
||||||
|
if (inDto.TaskId != null)
|
||||||
{
|
{
|
||||||
taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.TaskId).FirstNotNullAsync();
|
taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.TaskId).FirstNotNullAsync();
|
||||||
// 取基线
|
// 取基线
|
||||||
|
@ -945,11 +954,28 @@ namespace IRaCIS.Application.Services
|
||||||
&& x.DoctorUserId == taskInfo.DoctorUserId
|
&& x.DoctorUserId == taskInfo.DoctorUserId
|
||||||
&& x.IsAnalysisCreate == taskInfo.IsAnalysisCreate
|
&& x.IsAnalysisCreate == taskInfo.IsAnalysisCreate
|
||||||
&& x.TaskState == TaskState.Effect
|
&& x.TaskState == TaskState.Effect
|
||||||
&&x.TrialReadingCriterionId== taskInfo.TrialReadingCriterionId
|
&& x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId
|
||||||
).Select(x => x.Id).FirstNotNullAsync();
|
).Select(x => x.Id).FirstNotNullAsync();
|
||||||
|
|
||||||
baseLineTableAnswer = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == baselineTaskId).Include(x=>x.ReadingTableQuestionTrial).ToListAsync();
|
baseLineTableAnswer = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == baselineTaskId).Include(x => x.ReadingTableQuestionTrial).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
|
if (taskInfo.IsConvertedTask &&
|
||||||
|
!(await _visitTaskRepository.AnyAsync(x => x.IsAnalysisCreate == taskInfo.IsAnalysisCreate
|
||||||
|
&& x.IsSelfAnalysis == taskInfo.IsSelfAnalysis
|
||||||
|
&& x.VisitTaskNum < taskInfo.VisitTaskNum
|
||||||
|
&& x.DoctorUserId == taskInfo.DoctorUserId
|
||||||
|
&& x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId
|
||||||
|
&& !x.IsConvertedTask
|
||||||
|
&& x.SubjectId == taskInfo.SubjectId
|
||||||
|
&& x.ArmEnum == taskInfo.ArmEnum &&
|
||||||
|
x.TaskState == TaskState.Effect))
|
||||||
|
)
|
||||||
|
{
|
||||||
|
isFirstChangeTask = true;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (criterionInfo.FormType == FormType.MultiplePage)
|
if (criterionInfo.FormType == FormType.MultiplePage)
|
||||||
{
|
{
|
||||||
|
@ -969,7 +995,7 @@ namespace IRaCIS.Application.Services
|
||||||
var pageGroupList = newPageQusetionList.Where(x => x.Type == ReadingQestionType.Group).ToList();
|
var pageGroupList = newPageQusetionList.Where(x => x.Type == ReadingQestionType.Group).ToList();
|
||||||
pageGroupList.ForEach(x =>
|
pageGroupList.ForEach(x =>
|
||||||
{
|
{
|
||||||
this.FindChildQuestion(x, newPageQusetionList, tableQuestionList, inDto.TableAnswers, inDto.TableAnsweRowInfos,inDto.OrganInfos, baseLineTableAnswer);
|
this.FindChildQuestion(x, newPageQusetionList, tableQuestionList, inDto.TableAnswers, inDto.TableAnsweRowInfos, inDto.OrganInfos, baseLineTableAnswer, isFirstChangeTask);
|
||||||
});
|
});
|
||||||
|
|
||||||
page.Childrens = pageGroupList.Where(x => !(x.Type == ReadingQestionType.Group && x.Childrens.Count() == 0)).ToList();
|
page.Childrens = pageGroupList.Where(x => !(x.Type == ReadingQestionType.Group && x.Childrens.Count() == 0)).ToList();
|
||||||
|
@ -986,7 +1012,7 @@ namespace IRaCIS.Application.Services
|
||||||
groupList = qusetionList.Where(x => x.Type == ReadingQestionType.Group).ToList();
|
groupList = qusetionList.Where(x => x.Type == ReadingQestionType.Group).ToList();
|
||||||
groupList.ForEach(x =>
|
groupList.ForEach(x =>
|
||||||
{
|
{
|
||||||
this.FindChildQuestion(x, qusetionList, tableQuestionList, inDto.TableAnswers, inDto.TableAnsweRowInfos, inDto.OrganInfos, baseLineTableAnswer);
|
this.FindChildQuestion(x, qusetionList, tableQuestionList, inDto.TableAnswers, inDto.TableAnsweRowInfos, inDto.OrganInfos, baseLineTableAnswer, isFirstChangeTask);
|
||||||
});
|
});
|
||||||
|
|
||||||
groupList = groupList.Where(x => !(x.Type == ReadingQestionType.Group && x.Childrens.Count() == 0)).ToList();
|
groupList = groupList.Where(x => !(x.Type == ReadingQestionType.Group && x.Childrens.Count() == 0)).ToList();
|
||||||
|
@ -1006,9 +1032,9 @@ namespace IRaCIS.Application.Services
|
||||||
/// <param name="item"></param>
|
/// <param name="item"></param>
|
||||||
/// <param name="questionlists"></param>
|
/// <param name="questionlists"></param>
|
||||||
/// <param name="tableQuestionLists"></param>
|
/// <param name="tableQuestionLists"></param>
|
||||||
private async void FindChildQuestion(TrialReadQuestionData item, List<TrialReadQuestionData> questionlists, List<TableQuestionTrial> tableQuestionLists, List<ReadingTableQuestionAnswerInfo> tableAnswers, List<TableAnsweRowInfo> tableAnsweRowInfos,List<OrganInfo> organInfos, List<ReadingTableQuestionAnswer> baseLineTableAnswer)
|
private async void FindChildQuestion(TrialReadQuestionData item, List<TrialReadQuestionData> questionlists, List<TableQuestionTrial> tableQuestionLists, List<ReadingTableQuestionAnswerInfo> tableAnswers, List<TableAnsweRowInfo> tableAnsweRowInfos, List<OrganInfo> organInfos, List<ReadingTableQuestionAnswer> baseLineTableAnswer,bool isFirstChangeTask)
|
||||||
{
|
{
|
||||||
item.Childrens = questionlists.Where(x => x.ParentId == item.Id ||x.GroupId==item.Id).ToList();
|
item.Childrens = questionlists.Where(x => x.ParentId == item.Id || x.GroupId == item.Id).ToList();
|
||||||
item.TableQuestions = new TrialReadTableQuestion();
|
item.TableQuestions = new TrialReadTableQuestion();
|
||||||
|
|
||||||
item.TableQuestions.Questions = tableQuestionLists.Where(x => x.ReadingQuestionId == item.Id).OrderBy(x => x.ShowOrder).ToList();
|
item.TableQuestions.Questions = tableQuestionLists.Where(x => x.ReadingQuestionId == item.Id).OrderBy(x => x.ShowOrder).ToList();
|
||||||
|
@ -1053,14 +1079,14 @@ namespace IRaCIS.Application.Services
|
||||||
QuestionMark.Location,
|
QuestionMark.Location,
|
||||||
QuestionMark.Part,
|
QuestionMark.Part,
|
||||||
};
|
};
|
||||||
|
|
||||||
orders.ForEach(x =>
|
orders.ForEach(x =>
|
||||||
{
|
{
|
||||||
Dictionary<string, string> answers = new Dictionary<string, string>();
|
Dictionary<string, string> answers = new Dictionary<string, string>();
|
||||||
var rowInfo = tableAnsweRowInfos.Where(y => y.RowIndex == x && y.QuestionId == item.Id).FirstOrDefault();
|
var rowInfo = tableAnsweRowInfos.Where(y => y.RowIndex == x && y.QuestionId == item.Id).FirstOrDefault();
|
||||||
var rowAnswer = thisAnswer.Where(y => y.RowId == rowInfo.Id).OrderBy(y => y.ShowOrder).ToList();
|
var rowAnswer = thisAnswer.Where(y => y.RowId == rowInfo.Id).OrderBy(y => y.ShowOrder).ToList();
|
||||||
|
|
||||||
var organInfo = organInfos.Where(x=>x.Id== rowInfo.OrganInfoId).FirstOrDefault();
|
var organInfo = organInfos.Where(x => x.Id == rowInfo.OrganInfoId).FirstOrDefault();
|
||||||
|
|
||||||
rowAnswer.ForEach(z =>
|
rowAnswer.ForEach(z =>
|
||||||
{
|
{
|
||||||
|
@ -1123,12 +1149,13 @@ namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
answers.Add(z.TableQuestionId.ToString(), z.Answer);
|
answers.Add(z.TableQuestionId.ToString(), z.Answer);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
answers.Add("BlindName", rowInfo.BlindName);
|
answers.Add("BlindName", rowInfo.BlindName);
|
||||||
|
answers.Add("IsFirstChangeTask", isFirstChangeTask.ToString());
|
||||||
answers.Add("FromMark", rowInfo.FromMark);
|
answers.Add("FromMark", rowInfo.FromMark);
|
||||||
answers.Add("IsDicomReading", rowInfo.IsDicomReading.ToString());
|
answers.Add("IsDicomReading", rowInfo.IsDicomReading.ToString());
|
||||||
answers.Add("MeasureData", rowInfo == null ? string.Empty : rowInfo.MeasureData);
|
answers.Add("MeasureData", rowInfo == null ? string.Empty : rowInfo.MeasureData);
|
||||||
|
@ -1144,7 +1171,7 @@ namespace IRaCIS.Application.Services
|
||||||
answers.Add("SplitOrMergeType", rowInfo.SplitOrMergeType == null ? string.Empty : ((int)rowInfo.SplitOrMergeType).ToString());
|
answers.Add("SplitOrMergeType", rowInfo.SplitOrMergeType == null ? string.Empty : ((int)rowInfo.SplitOrMergeType).ToString());
|
||||||
if (rowInfo.LesionType == LesionType.BaselineLesions)
|
if (rowInfo.LesionType == LesionType.BaselineLesions)
|
||||||
{
|
{
|
||||||
answers.Add("BaseLineLesionNumber", baseLineTableAnswer.Where(n=>n.ReadingTableQuestionTrial.QuestionMark==QuestionMark.LesionNumber&&n.RowIndex==rowInfo.RowIndex).Select(x=>x.Answer).FirstIsNullReturnEmpty());
|
answers.Add("BaseLineLesionNumber", baseLineTableAnswer.Where(n => n.ReadingTableQuestionTrial.QuestionMark == QuestionMark.LesionNumber && n.RowIndex == rowInfo.RowIndex).Select(x => x.Answer).FirstIsNullReturnEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1155,7 +1182,7 @@ namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
item.Childrens.ForEach(x =>
|
item.Childrens.ForEach(x =>
|
||||||
{
|
{
|
||||||
this.FindChildQuestion(x, questionlists, tableQuestionLists, tableAnswers, tableAnsweRowInfos, organInfos, baseLineTableAnswer);
|
this.FindChildQuestion(x, questionlists, tableQuestionLists, tableAnswers, tableAnsweRowInfos, organInfos, baseLineTableAnswer, isFirstChangeTask);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1368,19 +1395,20 @@ namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
|
|
||||||
IsDeleted = true
|
IsDeleted = true
|
||||||
});
|
});
|
||||||
await _readingTableAnswerRowInfoRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.RowId,x=>new ReadingTableAnswerRowInfo() {
|
await _readingTableAnswerRowInfoRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.RowId, x => new ReadingTableAnswerRowInfo()
|
||||||
|
{
|
||||||
IsDeleted=true
|
|
||||||
|
IsDeleted = true
|
||||||
});
|
});
|
||||||
await _readingTableAnswerRowInfoRepository.SaveChangesAsync();
|
await _readingTableAnswerRowInfoRepository.SaveChangesAsync();
|
||||||
|
|
||||||
|
|
||||||
var rowInfoList = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == inDto.QuestionId,true).Include(x => x.ReadingQuestionTrial).OrderBy(x => x.RowIndex).ToListAsync();
|
var rowInfoList = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == inDto.QuestionId, true).Include(x => x.ReadingQuestionTrial).OrderBy(x => x.RowIndex).ToListAsync();
|
||||||
|
|
||||||
|
var answerlist = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == inDto.QuestionId, true).ToListAsync();
|
||||||
|
|
||||||
var answerlist = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == inDto.QuestionId,true).ToListAsync();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach (var item in rowInfoList.Where(x => x.RowIndex % 1 == 0))
|
foreach (var item in rowInfoList.Where(x => x.RowIndex % 1 == 0))
|
||||||
{
|
{
|
||||||
|
@ -1392,13 +1420,13 @@ namespace IRaCIS.Application.Services
|
||||||
measureDataStr = JsonConvert.SerializeObject(measureData);
|
measureDataStr = JsonConvert.SerializeObject(measureData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach (var answerItem in answerlist.Where(x=>x.RowIndex== item.RowIndex))
|
|
||||||
|
foreach (var answerItem in answerlist.Where(x => x.RowIndex == item.RowIndex))
|
||||||
{
|
{
|
||||||
|
|
||||||
answerItem.RowIndex = index;
|
answerItem.RowIndex = index;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1407,7 +1435,7 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
rowAnswerItem.RowIndex = index;
|
rowAnswerItem.RowIndex = index;
|
||||||
rowAnswerItem.MeasureData = measureDataStr;
|
rowAnswerItem.MeasureData = measureDataStr;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//await _readingTableQuestionAnswerRepository.UpdatePartialFromQueryAsync(x => x.VisitTaskId == inDto.VisitTaskId && x.RowIndex == item.RowIndex && x.QuestionId == inDto.QuestionId, x => new ReadingTableQuestionAnswer()
|
//await _readingTableQuestionAnswerRepository.UpdatePartialFromQueryAsync(x => x.VisitTaskId == inDto.VisitTaskId && x.RowIndex == item.RowIndex && x.QuestionId == inDto.QuestionId, x => new ReadingTableQuestionAnswer()
|
||||||
|
@ -1436,7 +1464,7 @@ namespace IRaCIS.Application.Services
|
||||||
foreach (var answerItem in answerlist.Where(x => x.RowIndex == spiltitem.RowIndex))
|
foreach (var answerItem in answerlist.Where(x => x.RowIndex == spiltitem.RowIndex))
|
||||||
{
|
{
|
||||||
answerItem.RowIndex = index + spiltindex;
|
answerItem.RowIndex = index + spiltindex;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1446,7 +1474,7 @@ namespace IRaCIS.Application.Services
|
||||||
rowAnswerItem.RowIndex = index + spiltindex;
|
rowAnswerItem.RowIndex = index + spiltindex;
|
||||||
rowAnswerItem.MeasureData = spiltmeasureDataStr;
|
rowAnswerItem.MeasureData = spiltmeasureDataStr;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1489,7 +1517,7 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
await VerifyTaskIsSign(inDto.VisitTaskId);
|
await VerifyTaskIsSign(inDto.VisitTaskId);
|
||||||
|
|
||||||
if (inDto.InstanceId != null&&inDto.IsDicomReading)
|
if (inDto.InstanceId != null && inDto.IsDicomReading)
|
||||||
{
|
{
|
||||||
if (!(await _dicomInstanceRepository.AnyAsync(x => x.Id == inDto.InstanceId && x.SeriesId == inDto.SeriesId)))
|
if (!(await _dicomInstanceRepository.AnyAsync(x => x.Id == inDto.InstanceId && x.SeriesId == inDto.SeriesId)))
|
||||||
{
|
{
|
||||||
|
@ -1510,19 +1538,19 @@ namespace IRaCIS.Application.Services
|
||||||
case CriterionType.RECIST1Point1:
|
case CriterionType.RECIST1Point1:
|
||||||
var lastTaskinfo = await _visitTaskRepository
|
var lastTaskinfo = await _visitTaskRepository
|
||||||
.Where(x => x.IsAnalysisCreate == taskinfo.IsAnalysisCreate &&
|
.Where(x => x.IsAnalysisCreate == taskinfo.IsAnalysisCreate &&
|
||||||
x.SubjectId==taskinfo.SubjectId&&
|
x.SubjectId == taskinfo.SubjectId &&
|
||||||
x.ReadingCategory == taskinfo.ReadingCategory &&
|
x.ReadingCategory == taskinfo.ReadingCategory &&
|
||||||
x.DoctorUserId == taskinfo.DoctorUserId &&
|
x.DoctorUserId == taskinfo.DoctorUserId &&
|
||||||
x.ArmEnum == taskinfo.ArmEnum &&
|
x.ArmEnum == taskinfo.ArmEnum &&
|
||||||
x.TrialReadingCriterionId==taskinfo.TrialReadingCriterionId&&
|
x.TrialReadingCriterionId == taskinfo.TrialReadingCriterionId &&
|
||||||
x.ReadingTaskState==ReadingTaskState.HaveSigned&&
|
x.ReadingTaskState == ReadingTaskState.HaveSigned &&
|
||||||
x.TaskState == TaskState.Effect &&
|
x.TaskState == TaskState.Effect &&
|
||||||
x.IsSelfAnalysis == taskinfo.IsSelfAnalysis &&
|
x.IsSelfAnalysis == taskinfo.IsSelfAnalysis &&
|
||||||
x.VisitTaskNum < taskinfo.VisitTaskNum
|
x.VisitTaskNum < taskinfo.VisitTaskNum
|
||||||
).OrderByDescending(x => x.VisitTaskNum).FirstOrDefaultAsync();
|
).OrderByDescending(x => x.VisitTaskNum).FirstOrDefaultAsync();
|
||||||
if (lastTaskinfo != null)
|
if (lastTaskinfo != null)
|
||||||
{
|
{
|
||||||
var tablequestionList = await _readingTableQuestionTrialRepository.Where(x => x.TrialCriterionId == taskinfo.TrialReadingCriterionId&&x.ReadingQuestionTrial.LesionType==LesionType.NonTargetLesions).ToListAsync();
|
var tablequestionList = await _readingTableQuestionTrialRepository.Where(x => x.TrialCriterionId == taskinfo.TrialReadingCriterionId && x.ReadingQuestionTrial.LesionType == LesionType.NonTargetLesions).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1535,7 +1563,7 @@ namespace IRaCIS.Application.Services
|
||||||
if (stateQuestion != null)
|
if (stateQuestion != null)
|
||||||
{
|
{
|
||||||
// 判断是否为非靶病灶
|
// 判断是否为非靶病灶
|
||||||
if (inDto.QuestionId == tablequestionList[0].ReadingQuestionId && inDto.AnswerList.Any(x => x.TableQuestionId== stateQuestion.Id&&x.Answer.EqEnum(NoTargetState.Increase)))
|
if (inDto.QuestionId == tablequestionList[0].ReadingQuestionId && inDto.AnswerList.Any(x => x.TableQuestionId == stateQuestion.Id && x.Answer.EqEnum(NoTargetState.Increase)))
|
||||||
{
|
{
|
||||||
var lymphQuestion = tablequestionList.Where(x => x.QuestionMark == QuestionMark.IsLymph).FirstOrDefault();
|
var lymphQuestion = tablequestionList.Where(x => x.QuestionMark == QuestionMark.IsLymph).FirstOrDefault();
|
||||||
if (lymphQuestion != null)
|
if (lymphQuestion != null)
|
||||||
|
@ -1574,7 +1602,7 @@ namespace IRaCIS.Application.Services
|
||||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_IsLymphNotbigger"]);
|
throw new BusinessValidationFailedException(_localizer["ReadingImage_IsLymphNotbigger"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1595,21 +1623,21 @@ namespace IRaCIS.Application.Services
|
||||||
var thisvalue = 0m;
|
var thisvalue = 0m;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
lastvalue = decimal.Parse(lastAnswer);
|
lastvalue = decimal.Parse(lastAnswer);
|
||||||
thisvalue = decimal.Parse(thisAnswer);
|
thisvalue = decimal.Parse(thisAnswer);
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (lastvalue >= thisvalue)
|
if (lastvalue >= thisvalue)
|
||||||
{
|
{
|
||||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_NotLymphNotbigger"]);
|
throw new BusinessValidationFailedException(_localizer["ReadingImage_NotLymphNotbigger"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1618,7 +1646,7 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1644,8 +1672,8 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
if (inDto.RowIndex % 1 == 0)
|
if (inDto.RowIndex % 1 == 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (questionInfo.MaxQuestionCount != null && questionInfo.MaxQuestionCount != 0&& inDto.RowId==null)
|
if (questionInfo.MaxQuestionCount != null && questionInfo.MaxQuestionCount != 0 && inDto.RowId == null)
|
||||||
{
|
{
|
||||||
if (questionInfo.MaxQuestionCount <
|
if (questionInfo.MaxQuestionCount <
|
||||||
(
|
(
|
||||||
|
@ -1664,14 +1692,14 @@ namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
QuestionMark.Part,
|
QuestionMark.Part,
|
||||||
QuestionMark.Organ,
|
QuestionMark.Organ,
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
string msg = string.Empty;
|
string msg = string.Empty;
|
||||||
foreach (var item in tableQuestions)
|
foreach (var item in tableQuestions)
|
||||||
{
|
{
|
||||||
|
|
||||||
var answer = inDto.AnswerList.Where(x => x.TableQuestionId == item.Id).Select(x => x.Answer).FirstOrDefault();
|
var answer = inDto.AnswerList.Where(x => x.TableQuestionId == item.Id).Select(x => x.Answer).FirstOrDefault();
|
||||||
if (!answer.IsNullOrEmpty())
|
if (!answer.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
|
@ -1682,9 +1710,9 @@ namespace IRaCIS.Application.Services
|
||||||
{CriterionType.PCWG3, _localizer["ReadingImage_PCWGMaximum", item.MaxRowCount.Value]},
|
{CriterionType.PCWG3, _localizer["ReadingImage_PCWGMaximum", item.MaxRowCount.Value]},
|
||||||
};
|
};
|
||||||
var rowCount = 0;
|
var rowCount = 0;
|
||||||
if ((item.QuestionMark == QuestionMark.Part|| item.QuestionMark == QuestionMark.Organ) &&inDto.OrganInfoId!=null)
|
if ((item.QuestionMark == QuestionMark.Part || item.QuestionMark == QuestionMark.Organ) && inDto.OrganInfoId != null)
|
||||||
{
|
{
|
||||||
var organIds= await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == inDto.QuestionId && ((x.RowIndex % 1) == 0) && x.OrganInfoId != null && x.RowIndex != inDto.RowIndex).Select(x=>x.OrganInfoId).ToListAsync();
|
var organIds = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == inDto.QuestionId && ((x.RowIndex % 1) == 0) && x.OrganInfoId != null && x.RowIndex != inDto.RowIndex).Select(x => x.OrganInfoId).ToListAsync();
|
||||||
organIds.Add(inDto.OrganInfoId);
|
organIds.Add(inDto.OrganInfoId);
|
||||||
|
|
||||||
var orginInfos = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync();
|
var orginInfos = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync();
|
||||||
|
@ -1692,14 +1720,14 @@ namespace IRaCIS.Application.Services
|
||||||
List<OrganInfo?> orginInfoList = new List<OrganInfo?>();
|
List<OrganInfo?> orginInfoList = new List<OrganInfo?>();
|
||||||
foreach (var organId in organIds)
|
foreach (var organId in organIds)
|
||||||
{
|
{
|
||||||
orginInfoList.Add(orginInfos.Where(x=>x.Id==organId).FirstOrDefault());
|
orginInfoList.Add(orginInfos.Where(x => x.Id == organId).FirstOrDefault());
|
||||||
}
|
}
|
||||||
|
|
||||||
var currentOrginInfo = orginInfos.Where(x => x.Id == inDto.OrganInfoId).FirstOrDefault()??new OrganInfo ();
|
var currentOrginInfo = orginInfos.Where(x => x.Id == inDto.OrganInfoId).FirstOrDefault() ?? new OrganInfo();
|
||||||
|
|
||||||
if (item.QuestionMark == QuestionMark.Part)
|
if (item.QuestionMark == QuestionMark.Part)
|
||||||
{
|
{
|
||||||
rowCount = orginInfoList.Where(x=>x.Part== currentOrginInfo.Part).Count();
|
rowCount = orginInfoList.Where(x => x.Part == currentOrginInfo.Part).Count();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1708,7 +1736,7 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
if (rowCount > item.MaxRowCount.Value)
|
if (rowCount > item.MaxRowCount.Value)
|
||||||
{
|
{
|
||||||
if (rowCount > item.MaxRowCount.Value )
|
if (rowCount > item.MaxRowCount.Value)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
@ -1727,7 +1755,7 @@ namespace IRaCIS.Application.Services
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rowCount = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.TableQuestionId == item.Id && ((x.RowIndex % 1) == 0) && x.Answer == answer && x.RowIndex != inDto.RowIndex).CountAsync();
|
rowCount = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.TableQuestionId == item.Id && ((x.RowIndex % 1) == 0) && x.Answer == answer && x.RowIndex != inDto.RowIndex).CountAsync();
|
||||||
|
@ -1735,7 +1763,7 @@ namespace IRaCIS.Application.Services
|
||||||
if (rowCount > item.MaxRowCount.Value - 1)
|
if (rowCount > item.MaxRowCount.Value - 1)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
msg = errorMsgDic[criterionInfo.CriterionType];
|
msg = errorMsgDic[criterionInfo.CriterionType];
|
||||||
|
@ -1749,9 +1777,9 @@ namespace IRaCIS.Application.Services
|
||||||
throw new BusinessValidationFailedException(msg);
|
throw new BusinessValidationFailedException(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1792,8 +1820,8 @@ namespace IRaCIS.Application.Services
|
||||||
rowInfo.IsCanEditPosition = inDto.IsCanEditPosition;
|
rowInfo.IsCanEditPosition = inDto.IsCanEditPosition;
|
||||||
rowInfo.WL = inDto.WL;
|
rowInfo.WL = inDto.WL;
|
||||||
rowInfo.WW = inDto.WW;
|
rowInfo.WW = inDto.WW;
|
||||||
result.RowId = rowInfo.Id;
|
result.RowId = rowInfo.Id;
|
||||||
|
|
||||||
if (inDto.RowId == null)
|
if (inDto.RowId == null)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -1814,7 +1842,7 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
await _readingTableAnswerRowInfoRepository.AddAsync(rowInfo);
|
await _readingTableAnswerRowInfoRepository.AddAsync(rowInfo);
|
||||||
await _readingTableQuestionAnswerRepository.AddRangeAsync(answerList);
|
await _readingTableQuestionAnswerRepository.AddRangeAsync(answerList);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
|
@ -1838,7 +1866,7 @@ namespace IRaCIS.Application.Services
|
||||||
VisitTaskId = rowInfo.VisitTaskId,
|
VisitTaskId = rowInfo.VisitTaskId,
|
||||||
StudyId = rowInfo.StudyId,
|
StudyId = rowInfo.StudyId,
|
||||||
IsCanEditPosition = rowInfo.IsCanEditPosition,
|
IsCanEditPosition = rowInfo.IsCanEditPosition,
|
||||||
}) ;
|
});
|
||||||
|
|
||||||
|
|
||||||
foreach (var item in inDto.AnswerList)
|
foreach (var item in inDto.AnswerList)
|
||||||
|
@ -1865,10 +1893,10 @@ namespace IRaCIS.Application.Services
|
||||||
VisitTaskId = inDto.VisitTaskId,
|
VisitTaskId = inDto.VisitTaskId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await _visitTaskRepository.UpdatePartialFromQueryAsync(inDto.VisitTaskId, x => new VisitTask()
|
await _visitTaskRepository.UpdatePartialFromQueryAsync(inDto.VisitTaskId, x => new VisitTask()
|
||||||
|
@ -1976,20 +2004,20 @@ namespace IRaCIS.Application.Services
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IResponseOutput> VerifyDefaultQuestionBeAnswer(VerifyVisitTaskQuestionsInDto inDto)
|
public async Task<IResponseOutput> VerifyDefaultQuestionBeAnswer(VerifyVisitTaskQuestionsInDto inDto)
|
||||||
{
|
{
|
||||||
|
|
||||||
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x=>x.TrialReadingCriterion).Include(x=>x.SourceSubjectVisit).FirstNotNullAsync();
|
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.TrialReadingCriterion).Include(x => x.SourceSubjectVisit).FirstNotNullAsync();
|
||||||
|
|
||||||
var criterion = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == taskInfo.TrialReadingCriterionId).FirstNotNullAsync();
|
var criterion = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == taskInfo.TrialReadingCriterionId).FirstNotNullAsync();
|
||||||
|
|
||||||
var readingQuestionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskInfo.TrialReadingCriterionId)
|
var readingQuestionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskInfo.TrialReadingCriterionId)
|
||||||
.WhereIf(taskInfo.SourceSubjectVisit.IsBaseLine,x=> ((x.IsRequired == IsRequired.Required && x.ShowQuestion == ShowQuestion.Show)&&(x.LimitEdit==LimitEdit.None||x.LimitEdit==LimitEdit.OnlyBaseLine)))
|
.WhereIf(taskInfo.SourceSubjectVisit.IsBaseLine, x => ((x.IsRequired == IsRequired.Required && x.ShowQuestion == ShowQuestion.Show) && (x.LimitEdit == LimitEdit.None || x.LimitEdit == LimitEdit.OnlyBaseLine)))
|
||||||
.WhereIf(!taskInfo.SourceSubjectVisit.IsBaseLine, x => ((x.IsRequired == IsRequired.Required && x.ShowQuestion == ShowQuestion.Show) && (x.LimitEdit == LimitEdit.None || x.LimitEdit == LimitEdit.OnlyVisit)))
|
.WhereIf(!taskInfo.SourceSubjectVisit.IsBaseLine, x => ((x.IsRequired == IsRequired.Required && x.ShowQuestion == ShowQuestion.Show) && (x.LimitEdit == LimitEdit.None || x.LimitEdit == LimitEdit.OnlyVisit)))
|
||||||
.WhereIf(taskInfo.TrialReadingCriterion.CriterionType==CriterionType.PCWG3, x => x.QuestionType != QuestionType.SiteVisitForTumorEvaluation)
|
.WhereIf(taskInfo.TrialReadingCriterion.CriterionType == CriterionType.PCWG3, x => x.QuestionType != QuestionType.SiteVisitForTumorEvaluation)
|
||||||
|
|
||||||
//.WhereIf(!criterion.IseCRFShowInDicomReading,x=>x.IsShowInDicom)
|
//.WhereIf(!criterion.IseCRFShowInDicomReading,x=>x.IsShowInDicom)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
var answerQuestionIds = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId&&x.Answer!=string.Empty).Select(x => x.ReadingQuestionTrialId).ToListAsync();
|
var answerQuestionIds = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.Answer != string.Empty).Select(x => x.ReadingQuestionTrialId).ToListAsync();
|
||||||
|
|
||||||
readingQuestionList = readingQuestionList.Where(x => !answerQuestionIds.Contains(x.Id)).ToList();
|
readingQuestionList = readingQuestionList.Where(x => !answerQuestionIds.Contains(x.Id)).ToList();
|
||||||
|
|
||||||
|
@ -2120,9 +2148,10 @@ namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
TrialId = inDto.TrialId,
|
TrialId = inDto.TrialId,
|
||||||
TrialReadingCriterionId = trialReadingCriterionId.Value,
|
TrialReadingCriterionId = trialReadingCriterionId.Value,
|
||||||
Page=new PageInput() {
|
Page = new PageInput()
|
||||||
PageIndex=1,
|
{
|
||||||
PageSize=99999,
|
PageIndex = 1,
|
||||||
|
PageSize = 99999,
|
||||||
}
|
}
|
||||||
})).Item2;
|
})).Item2;
|
||||||
|
|
||||||
|
@ -2165,7 +2194,7 @@ namespace IRaCIS.Application.Services
|
||||||
&& x.TaskState == TaskState.Effect).Select(x => new GetReadingTaskDto()
|
&& x.TaskState == TaskState.Effect).Select(x => new GetReadingTaskDto()
|
||||||
{
|
{
|
||||||
VisitTaskId = x.Id,
|
VisitTaskId = x.Id,
|
||||||
ArmEnum= x.ArmEnum,
|
ArmEnum = x.ArmEnum,
|
||||||
TaskBlindName = x.TaskBlindName,
|
TaskBlindName = x.TaskBlindName,
|
||||||
ReadingCategory = x.ReadingCategory,
|
ReadingCategory = x.ReadingCategory,
|
||||||
VisistId = x.SourceSubjectVisitId != null ? x.SourceSubjectVisitId.Value : x.ReadModule == null ? default(Guid) : x.ReadModule.SubjectVisitId,
|
VisistId = x.SourceSubjectVisitId != null ? x.SourceSubjectVisitId.Value : x.ReadModule == null ? default(Guid) : x.ReadModule.SubjectVisitId,
|
||||||
|
@ -2174,7 +2203,7 @@ namespace IRaCIS.Application.Services
|
||||||
SubjectCode = x.Subject.Code,
|
SubjectCode = x.Subject.Code,
|
||||||
TrialReadingCriterionId = x.TrialReadingCriterionId,
|
TrialReadingCriterionId = x.TrialReadingCriterionId,
|
||||||
}).FirstOrDefaultAsync();
|
}).FirstOrDefaultAsync();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (task == null)
|
if (task == null)
|
||||||
|
@ -2270,7 +2299,7 @@ namespace IRaCIS.Application.Services
|
||||||
int timespanMin = (DateTime.Now - cacheDate).Minutes;
|
int timespanMin = (DateTime.Now - cacheDate).Minutes;
|
||||||
if (timespanMin > 120 && timespanMin < 140)
|
if (timespanMin > 120 && timespanMin < 140)
|
||||||
{
|
{
|
||||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_NeedRest",2,20]);
|
throw new BusinessValidationFailedException(_localizer["ReadingImage_NeedRest", 2, 20]);
|
||||||
}
|
}
|
||||||
else if (timespanMin > 140)
|
else if (timespanMin > 140)
|
||||||
{
|
{
|
||||||
|
@ -2329,7 +2358,7 @@ namespace IRaCIS.Application.Services
|
||||||
// 完成阅片修改状态
|
// 完成阅片修改状态
|
||||||
//await this.FinishReadUpdateState(visitTaskId);
|
//await this.FinishReadUpdateState(visitTaskId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
await _visitTaskRepository.SaveChangesAsync();
|
await _visitTaskRepository.SaveChangesAsync();
|
||||||
|
|
||||||
|
@ -2406,7 +2435,7 @@ namespace IRaCIS.Application.Services
|
||||||
await _visitTaskRepository.UpdatePartialFromQueryAsync(taskInfo.Id, x => new VisitTask()
|
await _visitTaskRepository.UpdatePartialFromQueryAsync(taskInfo.Id, x => new VisitTask()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PastResultTaskIds = JsonConvert.SerializeObject(pastResultTaskIdList),
|
PastResultTaskIds = JsonConvert.SerializeObject(pastResultTaskIdList),
|
||||||
RelatedVisitTaskIds = JsonConvert.SerializeObject(relatedVisitTaskIdList),
|
RelatedVisitTaskIds = JsonConvert.SerializeObject(relatedVisitTaskIdList),
|
||||||
|
@ -2438,7 +2467,7 @@ namespace IRaCIS.Application.Services
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
||||||
public async Task AddReadingTask(Guid visitTaskId,Guid? trialId=null)
|
public async Task AddReadingTask(Guid visitTaskId, Guid? trialId = null)
|
||||||
{
|
{
|
||||||
// ****** 先生成阅片期 阅片期任务阅片完成之后生成肿瘤学的 如果没有阅片期 直接生成肿瘤学 *********////
|
// ****** 先生成阅片期 阅片期任务阅片完成之后生成肿瘤学的 如果没有阅片期 直接生成肿瘤学 *********////
|
||||||
#region 建立关系
|
#region 建立关系
|
||||||
|
|
Loading…
Reference in New Issue