拷贝问题修改
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
1a2c51da12
commit
15108156c2
|
@ -877,6 +877,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
public class CopyTableAnswerRowInfo : ReadingTableAnswerRowInfoBase
|
||||
{
|
||||
public Guid OriginalId { get; set; }
|
||||
|
||||
public LesionType? LesionType { get; set; }
|
||||
}
|
||||
public class CopyTableAnswerDto
|
||||
{
|
||||
|
|
|
@ -166,7 +166,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
CreateMap<CopyTableAnswerRowInfo, ReadingTableAnswerRowInfo>().ForMember(dest => dest.CreateUserRole, opt => opt.Ignore());
|
||||
|
||||
CreateMap<ReadingTableAnswerRowInfo, CopyTableAnswerRowInfo>()
|
||||
.ForMember(d => d.OriginalId, u => u.MapFrom(s => s.Id));
|
||||
.ForMember(d => d.OriginalId, u => u.MapFrom(s => s.Id))
|
||||
.ForMember(d => d.LesionType, u => u.MapFrom(s => s.ReadingQuestionTrial.LesionType));
|
||||
|
||||
//.ForMember(dest => dest.Instance, opt => opt.Ignore())
|
||||
//.ForMember(dest => dest.ReadingQuestionTrial, opt => opt.Ignore());
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||
using DocumentFormat.OpenXml.Office.SpreadSheetML.Y2023.MsForms;
|
||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infra.EFCore.Common;
|
||||
|
@ -757,7 +758,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
QuestionMark.MajorAxis,
|
||||
QuestionMark.ShortAxis,
|
||||
QuestionMark.State,
|
||||
|
||||
|
||||
};
|
||||
|
||||
var tableAnswers = copyTableAnswers.Select(x => new ReadingTableQuestionAnswer
|
||||
|
@ -789,6 +790,111 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 如果是基线 要把res1.1的病灶复制过来
|
||||
var recistTask = await _visitTaskRepository.Where(x =>
|
||||
x.TrialId == taskinfo.TrialId &&
|
||||
x.TaskState == TaskState.Effect &&
|
||||
x.ReadingTaskState == ReadingTaskState.HaveSigned &&
|
||||
x.TrialReadingCriterion.CriterionType == CriterionType.RECIST1Point1 &&
|
||||
x.SubjectId == taskinfo.SubjectId &&
|
||||
x.SourceSubjectVisitId == taskinfo.SourceSubjectVisitId &&
|
||||
x.DoctorUserId==taskinfo.DoctorUserId).FirstOrDefaultAsync();
|
||||
if (recistTask != null)
|
||||
{
|
||||
|
||||
|
||||
var trialReadingCriterion=await _readingQuestionCriterionTrialRepository.Where(x => x.Id == recistTask.TrialReadingCriterionId).FirstOrDefaultAsync();
|
||||
|
||||
var tableRowAnswers = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == recistTask.Id).ProjectTo<CopyTableAnswerRowInfo>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.TrialCriterionId == taskinfo.TrialReadingCriterionId).ToListAsync();
|
||||
foreach (var rowInfo in tableRowAnswers)
|
||||
{
|
||||
var question= await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId && x.LesionType == x.LesionType).FirstOrDefaultAsync();
|
||||
var organ = await _organInfoRepository.Where(x => x.Id == rowInfo.OrganInfoId).FirstOrDefaultAsync();
|
||||
|
||||
var newOrgan = await _organInfoRepository.Where(x => x.SystemCriterionId == trialReadingCriterion.ReadingQuestionCriterionSystemId &&
|
||||
x.Classification == organ.TULOC &&
|
||||
x.Part == organ.Part &&
|
||||
x.TULOC == organ.TULOC &&
|
||||
x.TULAT == organ.TULAT &&
|
||||
x.IsLymphNodes == organ.IsLymphNodes
|
||||
).FirstOrDefaultAsync();
|
||||
|
||||
if (newOrgan != null)
|
||||
{
|
||||
rowInfo.OrganInfoId = newOrgan.Id;
|
||||
}
|
||||
rowInfo.VisitTaskId = visitTaskId;
|
||||
rowInfo.IsCurrentTaskAdd = true;
|
||||
rowInfo.Id = NewId.NextGuid();
|
||||
rowInfo.SeriesId = null;
|
||||
rowInfo.InstanceId = null;
|
||||
rowInfo.MeasureData = string.Empty;
|
||||
rowInfo.PicturePath = string.Empty;
|
||||
rowInfo.QuestionId = question == null ? default(Guid) : question.Id;
|
||||
rowInfo.RowMark = question?.OrderMark + rowInfo.RowIndex.GetLesionMark();
|
||||
}
|
||||
|
||||
|
||||
|
||||
var recistTableAnswers = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == recistTask.Id).Select(x => new CopyTableAnswerDto()
|
||||
{
|
||||
Answer = x.Answer,
|
||||
QuestionId = x.QuestionId,
|
||||
RowId = x.RowId,
|
||||
QuestionMark = x.ReadingTableQuestionTrial.QuestionMark,
|
||||
TableQuestionId = x.TableQuestionId,
|
||||
RowIndex = x.RowIndex,
|
||||
TrialId = x.TrialId,
|
||||
}).ToListAsync();
|
||||
|
||||
foreach (var item in recistTableAnswers)
|
||||
{
|
||||
item.QuestionId = tableRowAnswers.Where(y => y.OriginalId == item.RowId).Select(x => x.QuestionId).FirstOrDefault();
|
||||
item.TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == item.QuestionId && x.QuestionMark == item.QuestionMark).Select(x => x.Id).FirstOrDefault();
|
||||
}
|
||||
|
||||
|
||||
|
||||
List<QuestionMark?> notNeedCopyMarks = new List<QuestionMark?>()
|
||||
{
|
||||
QuestionMark.MajorAxis,
|
||||
QuestionMark.ShortAxis,
|
||||
QuestionMark.State,
|
||||
};
|
||||
var tableAnswers = recistTableAnswers.Select(x => new ReadingTableQuestionAnswer
|
||||
{
|
||||
Id = NewId.NextGuid(),
|
||||
Answer = notNeedCopyMarks.Contains(x.QuestionMark) ? string.Empty : x.Answer,
|
||||
QuestionId = x.QuestionId,
|
||||
RowIndex = x.RowIndex,
|
||||
RowId = tableRowAnswers.Where(y => y.OriginalId == x.RowId).Select(x => x.Id).FirstOrDefault(),
|
||||
TableQuestionId = x.TableQuestionId,
|
||||
TrialId = x.TrialId,
|
||||
VisitTaskId = visitTaskId,
|
||||
});
|
||||
|
||||
|
||||
var addList = _mapper.Map<List<ReadingTableAnswerRowInfo>>(tableRowAnswers);
|
||||
|
||||
await _readingTableAnswerRowInfoRepository.AddRangeAsync(addList);
|
||||
await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers);
|
||||
|
||||
addList.ForEach(x =>
|
||||
{
|
||||
x.MergeRow = null;
|
||||
x.SplitRow = null;
|
||||
|
||||
});
|
||||
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
return new AddTaskLesionAnswerFromLastTaskOutDto()
|
||||
|
|
Loading…
Reference in New Issue