Uat_Study
parent
2302a1d351
commit
78a0f4fbfb
|
@ -64,7 +64,7 @@ namespace IRaCIS.Application.Services
|
||||||
IVisitTaskHelpeService visitTaskHelpeService,
|
IVisitTaskHelpeService visitTaskHelpeService,
|
||||||
IVisitTaskService visitTaskService,
|
IVisitTaskService visitTaskService,
|
||||||
IReadingClinicalDataService readingClinicalDataService,
|
IReadingClinicalDataService readingClinicalDataService,
|
||||||
IReadingCalculateService readingCalculateService,
|
IReadingCalculateService readingCalculateService,
|
||||||
IRepository<SubjectVisit> subjectVisitRepository,
|
IRepository<SubjectVisit> subjectVisitRepository,
|
||||||
IRepository<Subject> subjectRepository,
|
IRepository<Subject> subjectRepository,
|
||||||
IRepository<ReadingGlobalTaskInfo> readingGlobalTaskInfoRepository,
|
IRepository<ReadingGlobalTaskInfo> readingGlobalTaskInfoRepository,
|
||||||
|
@ -118,7 +118,7 @@ namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
await this.VerifyIsBaseLineTask(inDto.VisitTaskId);
|
await this.VerifyIsBaseLineTask(inDto.VisitTaskId);
|
||||||
var rowAnswer = await _readingTableAnswerRowInfoRepository.Where(x =>x.Id==inDto.RowId).FirstNotNullAsync();
|
var rowAnswer = await _readingTableAnswerRowInfoRepository.Where(x =>x.Id==inDto.RowId).FirstNotNullAsync();
|
||||||
var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.RowIndex == rowAnswer.RowIndex && x.QuestionId == inDto.QuestionId).ToListAsync();
|
var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.RowIndex == rowAnswer.RowIndex && x.QuestionId == inDto.QuestionId).Include(x=>x.ReadingTableQuestionTrial).ToListAsync();
|
||||||
var maxRowIndex = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == inDto.QuestionId&&x.RowIndex< Math.Floor(rowAnswer.RowIndex+1)).OrderByDescending(x => x.RowIndex).Select(x => x.RowIndex).FirstOrDefaultAsync();
|
var maxRowIndex = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == inDto.QuestionId&&x.RowIndex< Math.Floor(rowAnswer.RowIndex+1)).OrderByDescending(x => x.RowIndex).Select(x => x.RowIndex).FirstOrDefaultAsync();
|
||||||
var newRowIndex = maxRowIndex + (decimal)0.01;
|
var newRowIndex = maxRowIndex + (decimal)0.01;
|
||||||
|
|
||||||
|
@ -127,10 +127,18 @@ namespace IRaCIS.Application.Services
|
||||||
rowAnswer.SplitOrMergeType = SplitOrMergeType.Split;
|
rowAnswer.SplitOrMergeType = SplitOrMergeType.Split;
|
||||||
rowAnswer.SplitRowId = rowAnswer.Id;
|
rowAnswer.SplitRowId = rowAnswer.Id;
|
||||||
rowAnswer.Id = NewId.NextGuid();
|
rowAnswer.Id = NewId.NextGuid();
|
||||||
|
|
||||||
|
List<QuestionMark?> needRemoveMark = new List<QuestionMark?>()
|
||||||
|
{
|
||||||
|
QuestionMark.MajorAxis,
|
||||||
|
QuestionMark.ShortAxis,
|
||||||
|
};
|
||||||
|
|
||||||
tableAnswers.ForEach(x =>
|
tableAnswers.ForEach(x =>
|
||||||
{
|
{
|
||||||
x.Id = NewId.NextGuid();
|
x.Id = NewId.NextGuid();
|
||||||
x.RowIndex = newRowIndex;
|
x.RowIndex = newRowIndex;
|
||||||
|
x.Answer = needRemoveMark.Contains(x.ReadingTableQuestionTrial.QuestionMark) ? string.Empty : x.Answer;
|
||||||
});
|
});
|
||||||
await _readingTableAnswerRowInfoRepository.AddAsync(rowAnswer);
|
await _readingTableAnswerRowInfoRepository.AddAsync(rowAnswer);
|
||||||
await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers);
|
await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers);
|
||||||
|
@ -158,6 +166,30 @@ namespace IRaCIS.Application.Services
|
||||||
var minaid = rowsInfo.Where(x => x.Id == inDto.MainRowId).Select(x => x.Id).FirstOrDefault();
|
var minaid = rowsInfo.Where(x => x.Id == inDto.MainRowId).Select(x => x.Id).FirstOrDefault();
|
||||||
var mergeid = rowsInfo.Where(x => x.Id == inDto.MergeRowId).Select(x => x.Id).FirstOrDefault();
|
var mergeid = rowsInfo.Where(x => x.Id == inDto.MergeRowId).Select(x => x.Id).FirstOrDefault();
|
||||||
|
|
||||||
|
List<QuestionMark?> needRemoveMark = new List<QuestionMark?>()
|
||||||
|
{
|
||||||
|
QuestionMark.MajorAxis,
|
||||||
|
QuestionMark.ShortAxis,
|
||||||
|
};
|
||||||
|
|
||||||
|
var mainAnswer = await _readingTableQuestionAnswerRepository.Where(x => x.RowId == minaid).Include(x=>x.ReadingTableQuestionTrial).ToListAsync();
|
||||||
|
|
||||||
|
foreach (var item in mainAnswer)
|
||||||
|
{
|
||||||
|
await _readingTableQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x=>x.RowId== mergeid&&x.TableQuestionId==item.TableQuestionId, x => new ReadingTableQuestionAnswer()
|
||||||
|
{
|
||||||
|
Answer= needRemoveMark.Contains(item.ReadingTableQuestionTrial.QuestionMark)?string.Empty:item.Answer,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
await _readingTableAnswerRowInfoRepository.UpdatePartialFromQueryAsync(mergeid, x => new ReadingTableAnswerRowInfo()
|
||||||
|
{
|
||||||
|
MergeRowId = minaid,
|
||||||
|
SplitOrMergeType = SplitOrMergeType.Merge,
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
await _readingTableAnswerRowInfoRepository.UpdatePartialFromQueryAsync(mergeid, x => new ReadingTableAnswerRowInfo()
|
await _readingTableAnswerRowInfoRepository.UpdatePartialFromQueryAsync(mergeid, x => new ReadingTableAnswerRowInfo()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue