添加标记
This commit is contained in:
@@ -15,7 +15,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
{
|
||||
public Guid VisitTaskId { get; set; }
|
||||
|
||||
public Guid QuestionId { get; set; }
|
||||
public Guid TableQuestionId { get; set; }
|
||||
|
||||
public decimal RowIndex { get; set; }
|
||||
|
||||
|
||||
@@ -1000,17 +1000,17 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
/// <summary>
|
||||
/// InstanceId
|
||||
/// </summary>
|
||||
public Guid InstanceId { get; set; }
|
||||
public Guid? InstanceId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SeriesId
|
||||
/// </summary>
|
||||
public Guid SeriesId { get; set; }
|
||||
public Guid? SeriesId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// StudyId
|
||||
/// </summary>
|
||||
public Guid StudyId { get; set; }
|
||||
public Guid? StudyId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// MarkTool
|
||||
@@ -1031,6 +1031,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
/// MeasureData
|
||||
/// </summary>
|
||||
public string MeasureData { get; set; } = string.Empty;
|
||||
|
||||
|
||||
public Guid? FirstAddTaskId { get; set; }
|
||||
}
|
||||
public class GetReadingQuestionAndAnswerInDto
|
||||
{
|
||||
|
||||
+32
-2
@@ -829,6 +829,9 @@ namespace IRaCIS.Application.Services
|
||||
.ToListAsync();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).ProjectTo<VisitTaskDto>(_mapper.ConfigurationProvider).FirstNotNullAsync();
|
||||
|
||||
if (taskInfo.IsConvertedTask &&taskInfo.BeforeConvertedTaskId!=null)
|
||||
@@ -845,6 +848,26 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
x.OrderMarkName = x.OrderMark + x.RowIndexNum.GetLesionMark();
|
||||
});
|
||||
|
||||
var questionMark = await _readingTaskQuestionMarkRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).
|
||||
Select(x => new GetTableAnswerRowInfoOutDto()
|
||||
{
|
||||
FristAddTaskId = x.FirstAddTaskId.Value,
|
||||
Id = x.Id,
|
||||
InstanceId = x.InstanceId,
|
||||
MeasureData = x.MeasureData,
|
||||
NumberOfFrames = x.NumberOfFrames,
|
||||
PicturePath = x.PicturePath,
|
||||
VisitTaskId = x.VisitTaskId,
|
||||
StudyId = x.StudyId,
|
||||
SeriesId = x.StudyId,
|
||||
}).ToListAsync();
|
||||
|
||||
questionMark.ForEach(x => {
|
||||
|
||||
x.IsFirstChangeTask = x.VisitTaskId == inDto.VisitTaskId;
|
||||
});
|
||||
result.AddRange(questionMark);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1535,6 +1558,13 @@ namespace IRaCIS.Application.Services
|
||||
}).ToList();
|
||||
await _readingTaskQuestionAnswerRepository.AddRangeAsync(needAddAnswer);
|
||||
|
||||
|
||||
var questionMarkList = await _readingTaskQuestionMarkRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).Select(x => new
|
||||
{
|
||||
x.QuestionId,
|
||||
x.FirstAddTaskId,
|
||||
|
||||
}).ToListAsync();
|
||||
await _readingTaskQuestionMarkRepository.BatchDeleteNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId);
|
||||
|
||||
var datetime = DateTime.Now;
|
||||
@@ -1551,8 +1581,8 @@ namespace IRaCIS.Application.Services
|
||||
QuestionId = x.QuestionId,
|
||||
SeriesId = x.SeriesId,
|
||||
StudyId = x.StudyId,
|
||||
CreateTime = datetime
|
||||
|
||||
CreateTime = datetime,
|
||||
FirstAddTaskId= questionMarkList.Where(y=>y.QuestionId==x.QuestionId).Select(x=>x.FirstAddTaskId).FirstOrDefault() ?? inDto.VisitTaskId,
|
||||
}).ToList();
|
||||
await _readingTaskQuestionMarkRepository.AddRangeAsync(markList);
|
||||
await _readingTaskQuestionAnswerRepository.SaveChangesAsync();
|
||||
|
||||
@@ -23,6 +23,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
private readonly IRepository<VisitTask> _visitTaskRepository;
|
||||
private readonly IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository;
|
||||
private readonly IRepository<ReadingTableQuestionTrial> _readingTableQuestionTrialRepository;
|
||||
private readonly IRepository<ReadingTaskQuestionMark> _readingTaskQuestionMarkRepository;
|
||||
private readonly IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository;
|
||||
private readonly IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository;
|
||||
private readonly IRepository<OrganInfo> _organInfoRepository;
|
||||
@@ -36,6 +37,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
IRepository<VisitTask> visitTaskRepository,
|
||||
IRepository<ReadingQuestionCriterionTrial> readingQuestionCriterionTrialRepository,
|
||||
IRepository<ReadingTableQuestionTrial> readingTableQuestionTrialRepository,
|
||||
IRepository<ReadingTaskQuestionMark> readingTaskQuestionMarkRepository,
|
||||
IRepository<ReadingTableAnswerRowInfo> readingTableAnswerRowInfoRepository,
|
||||
IRepository<ReadingQuestionTrial> readingQuestionTrialRepository,
|
||||
IRepository<OrganInfo> organInfoRepository,
|
||||
@@ -49,6 +51,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
this._visitTaskRepository = visitTaskRepository;
|
||||
this._readingQuestionCriterionTrialRepository = readingQuestionCriterionTrialRepository;
|
||||
this._readingTableQuestionTrialRepository = readingTableQuestionTrialRepository;
|
||||
this._readingTaskQuestionMarkRepository = readingTaskQuestionMarkRepository;
|
||||
this._readingTableAnswerRowInfoRepository = readingTableAnswerRowInfoRepository;
|
||||
this._readingQuestionTrialRepository = readingQuestionTrialRepository;
|
||||
this._organInfoRepository = organInfoRepository;
|
||||
@@ -880,6 +883,47 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
QuestionMark.State,
|
||||
};
|
||||
|
||||
|
||||
|
||||
var rowIndexList = copyTableAnswers.Select(x => x.RowIndex).Distinct().ToList();
|
||||
// 找到靶病灶问题Id
|
||||
var questionId=await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId && x.LesionType == LesionType.TargetLesion).Select(x => x.Id).FirstNotNullAsync();
|
||||
|
||||
foreach (var item in rowIndexList)
|
||||
{
|
||||
var lowPPD =await this.GetLowPPDInfo(new GetPPDInfoInDto() {
|
||||
|
||||
VisitTaskId= visitTaskId,
|
||||
QuestionId= questionId,
|
||||
RowIndex=item
|
||||
});
|
||||
|
||||
copyTableAnswers.Where(x => x.RowIndex == item).ForEach(x =>
|
||||
{
|
||||
|
||||
|
||||
switch (x.QuestionMark)
|
||||
{
|
||||
case QuestionMark.LowPPDLDi:
|
||||
x.Answer = lowPPD.LowPPDLDi.ToString();
|
||||
break;
|
||||
case QuestionMark.LowPPDSDi:
|
||||
x.Answer = lowPPD.LowPPDSDi.ToString();
|
||||
break;
|
||||
case QuestionMark.NadirPPD:
|
||||
x.Answer = lowPPD.NadirPPD.ToString();
|
||||
break;
|
||||
case QuestionMark.LowPPDVisit:
|
||||
x.Answer = lowPPD.LowPPDVisit.ToString();
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
var tableAnswers = copyTableAnswers.Select(x => new ReadingTableQuestionAnswer
|
||||
{
|
||||
Id = NewId.NextGuid(),
|
||||
@@ -893,10 +937,20 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
});
|
||||
|
||||
|
||||
var questionMarkList = await _readingTaskQuestionMarkRepository.Where(x => x.VisitTaskId == LastVisitTaskId).Select(x => new ReadingTaskQuestionMark()
|
||||
{
|
||||
VisitTaskId= visitTaskId,
|
||||
FirstAddTaskId=x.FirstAddTaskId,
|
||||
QuestionId=x.QuestionId,
|
||||
|
||||
|
||||
}).ToListAsync();
|
||||
questionMarkList.ForEach(x => {
|
||||
x.Id = NewId.NextGuid();
|
||||
});
|
||||
var addList = _mapper.Map<List<ReadingTableAnswerRowInfo>>(tableRowAnswers);
|
||||
|
||||
await _readingTaskQuestionMarkRepository.AddRangeAsync(questionMarkList);
|
||||
await _readingTableAnswerRowInfoRepository.AddRangeAsync(addList);
|
||||
await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers);
|
||||
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
||||
|
||||
Reference in New Issue
Block a user