Uat_Study
hang 2023-03-23 09:10:36 +08:00
commit bd028771b6
4 changed files with 209 additions and 130 deletions

View File

@ -735,6 +735,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public string OrderMarkName { get; set; } = string.Empty; public string OrderMarkName { get; set; } = string.Empty;
public string FromMark { get; set; } = string.Empty;
/// <summary> /// <summary>
/// 截图地址 /// 截图地址
/// </summary> /// </summary>
@ -818,6 +821,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public int ShowOrder { get; set; } public int ShowOrder { get; set; }
public bool IsFirstChangeTask { get; set; } = false;
} }
public class GetTableAnswerRowInfoInDto public class GetTableAnswerRowInfoInDto
@ -1623,6 +1629,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public int? NumberOfFrames { get; set; } public int? NumberOfFrames { get; set; }
public string FromMark { get; set; } = string.Empty;
public decimal RowIndex { get; set; } public decimal RowIndex { get; set; }
/// <summary> /// <summary>

View File

@ -286,7 +286,8 @@ namespace IRaCIS.Application.Services
} }
else else
{ {
await _readingTaskQuestionAnswerRepository.AddAsync(new ReadingTaskQuestionAnswer() { await _readingTaskQuestionAnswerRepository.AddAsync(new ReadingTaskQuestionAnswer()
{
Answer = item.Answer, Answer = item.Answer,
ReadingQuestionCriterionTrialId = visitTask.TrialReadingCriterionId, ReadingQuestionCriterionTrialId = visitTask.TrialReadingCriterionId,
ReadingQuestionTrialId = item.QuestionId, ReadingQuestionTrialId = item.QuestionId,
@ -489,7 +490,8 @@ 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,
@ -623,7 +625,8 @@ 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();
@ -711,6 +714,29 @@ namespace IRaCIS.Application.Services
.WhereIf(inDto.QuestionId != null, x => x.QuestionId == inDto.QuestionId) .WhereIf(inDto.QuestionId != null, x => x.QuestionId == inDto.QuestionId)
.ProjectTo<GetTableAnswerRowInfoOutDto>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex) .ProjectTo<GetTableAnswerRowInfoOutDto>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex)
.ToListAsync(); .ToListAsync();
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
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))
)
{
result.ForEach(x =>
{
x.IsFirstChangeTask = true;
});
}
result.ForEach(x => result.ForEach(x =>
{ {
@ -753,7 +779,8 @@ 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,
@ -814,7 +841,8 @@ namespace IRaCIS.Application.Services
OrganInfos = organList OrganInfos = organList
} }
),new { ), new
{
IsBaseline = taskInfo.SourceSubjectVisit != null && taskInfo.SourceSubjectVisit.IsBaseLine, IsBaseline = taskInfo.SourceSubjectVisit != null && taskInfo.SourceSubjectVisit.IsBaseLine,
ReadingTaskState = taskInfo.ReadingTaskState ReadingTaskState = taskInfo.ReadingTaskState
}); });
@ -831,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();
if (inDto.TaskId != null) if (inDto.TaskId != null)
{ {
var 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 =>
{ {
@ -873,6 +902,13 @@ namespace IRaCIS.Application.Services
{ {
qusetionList = qusetionList.Where(x => x.IsShowInDicom && (x.Type == ReadingQestionType.Table || x.Type == ReadingQestionType.Group)).OrderBy(x => x.ShowOrder).ToList(); qusetionList = qusetionList.Where(x => x.IsShowInDicom && (x.Type == ReadingQestionType.Table || x.Type == ReadingQestionType.Group)).OrderBy(x => x.ShowOrder).ToList();
} }
if (inDto.TaskId != null && !taskInfo.IsConvertedTask)
{
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();
} }
@ -893,7 +929,8 @@ 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
}) })
@ -904,9 +941,11 @@ namespace IRaCIS.Application.Services
List<ReadingTableQuestionAnswer> baseLineTableAnswer = new List<ReadingTableQuestionAnswer>(); List<ReadingTableQuestionAnswer> baseLineTableAnswer = new List<ReadingTableQuestionAnswer>();
bool isFirstChangeTask = false;
if (inDto.TaskId != null) if (inDto.TaskId != null)
{ {
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.TaskId).FirstNotNullAsync(); taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.TaskId).FirstNotNullAsync();
// 取基线 // 取基线
var baseLineVisitId = await _subjectVisitRepository.Where(x => x.SubjectId == taskInfo.SubjectId && x.IsBaseLine).Select(x => x.Id).FirstNotNullAsync(); var baseLineVisitId = await _subjectVisitRepository.Where(x => x.SubjectId == taskInfo.SubjectId && x.IsBaseLine).Select(x => x.Id).FirstNotNullAsync();
@ -920,6 +959,23 @@ namespace IRaCIS.Application.Services
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)
{ {
@ -939,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();
@ -956,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();
@ -976,7 +1032,7 @@ 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();
@ -1099,6 +1155,8 @@ namespace IRaCIS.Application.Services
answers.Add("BlindName", rowInfo.BlindName); answers.Add("BlindName", rowInfo.BlindName);
answers.Add("IsFirstChangeTask", isFirstChangeTask.ToString());
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);
answers.Add("RowIndex", x.ToString()); answers.Add("RowIndex", x.ToString());
@ -1124,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);
}); });
} }
} }
@ -1338,7 +1396,8 @@ 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
}); });
@ -1751,6 +1810,7 @@ namespace IRaCIS.Application.Services
rowInfo.FristAddTaskId = inDto.VisitTaskId; rowInfo.FristAddTaskId = inDto.VisitTaskId;
rowInfo.PicturePath = inDto.PicturePath; rowInfo.PicturePath = inDto.PicturePath;
rowInfo.RowIndex = inDto.RowIndex; rowInfo.RowIndex = inDto.RowIndex;
rowInfo.FromMark = inDto.FromMark;
rowInfo.OrganInfoId = inDto.OrganInfoId; rowInfo.OrganInfoId = inDto.OrganInfoId;
rowInfo.InstanceId = inDto.InstanceId; rowInfo.InstanceId = inDto.InstanceId;
rowInfo.SeriesId = inDto.SeriesId; rowInfo.SeriesId = inDto.SeriesId;
@ -2088,7 +2148,8 @@ namespace IRaCIS.Application.Services
{ {
TrialId = inDto.TrialId, TrialId = inDto.TrialId,
TrialReadingCriterionId = trialReadingCriterionId.Value, TrialReadingCriterionId = trialReadingCriterionId.Value,
Page=new PageInput() { Page = new PageInput()
{
PageIndex = 1, PageIndex = 1,
PageSize = 99999, PageSize = 99999,
} }

View File

@ -1168,6 +1168,11 @@ namespace IRaCIS.Core.Domain.Share
/// 是否脑转移 /// 是否脑转移
/// </summary> /// </summary>
IsBrainMetastasis=43, IsBrainMetastasis=43,
/// <summary>
/// 是否转变之后表格问题
/// </summary>
IsConverted = 44,
} }
/// <summary> /// <summary>

View File

@ -148,6 +148,11 @@ namespace IRaCIS.Core.Domain.Models
/// </summary> /// </summary>
public decimal? WL { get; set; } public decimal? WL { get; set; }
/// <summary>
/// 来自于哪个标记
/// </summary>
public string FromMark { get; set; } = string.Empty;
public bool IsDeleted { get; set; } public bool IsDeleted { get; set; }
public DateTime? DeletedTime { get; set; } public DateTime? DeletedTime { get; set; }