添加标记
parent
3c23dfd792
commit
4a482adefe
|
@ -15,7 +15,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
{
|
{
|
||||||
public Guid VisitTaskId { get; set; }
|
public Guid VisitTaskId { get; set; }
|
||||||
|
|
||||||
public Guid QuestionId { get; set; }
|
public Guid TableQuestionId { get; set; }
|
||||||
|
|
||||||
public decimal RowIndex { get; set; }
|
public decimal RowIndex { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -1000,17 +1000,17 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// InstanceId
|
/// InstanceId
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid InstanceId { get; set; }
|
public Guid? InstanceId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// SeriesId
|
/// SeriesId
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid SeriesId { get; set; }
|
public Guid? SeriesId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// StudyId
|
/// StudyId
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid StudyId { get; set; }
|
public Guid? StudyId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// MarkTool
|
/// MarkTool
|
||||||
|
@ -1031,6 +1031,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
/// MeasureData
|
/// MeasureData
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string MeasureData { get; set; } = string.Empty;
|
public string MeasureData { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
|
||||||
|
public Guid? FirstAddTaskId { get; set; }
|
||||||
}
|
}
|
||||||
public class GetReadingQuestionAndAnswerInDto
|
public class GetReadingQuestionAndAnswerInDto
|
||||||
{
|
{
|
||||||
|
|
|
@ -829,6 +829,9 @@ namespace IRaCIS.Application.Services
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).ProjectTo<VisitTaskDto>(_mapper.ConfigurationProvider).FirstNotNullAsync();
|
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).ProjectTo<VisitTaskDto>(_mapper.ConfigurationProvider).FirstNotNullAsync();
|
||||||
|
|
||||||
if (taskInfo.IsConvertedTask &&taskInfo.BeforeConvertedTaskId!=null)
|
if (taskInfo.IsConvertedTask &&taskInfo.BeforeConvertedTaskId!=null)
|
||||||
|
@ -845,6 +848,26 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
x.OrderMarkName = x.OrderMark + x.RowIndexNum.GetLesionMark();
|
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;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1535,6 +1558,13 @@ namespace IRaCIS.Application.Services
|
||||||
}).ToList();
|
}).ToList();
|
||||||
await _readingTaskQuestionAnswerRepository.AddRangeAsync(needAddAnswer);
|
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);
|
await _readingTaskQuestionMarkRepository.BatchDeleteNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId);
|
||||||
|
|
||||||
var datetime = DateTime.Now;
|
var datetime = DateTime.Now;
|
||||||
|
@ -1551,8 +1581,8 @@ namespace IRaCIS.Application.Services
|
||||||
QuestionId = x.QuestionId,
|
QuestionId = x.QuestionId,
|
||||||
SeriesId = x.SeriesId,
|
SeriesId = x.SeriesId,
|
||||||
StudyId = x.StudyId,
|
StudyId = x.StudyId,
|
||||||
CreateTime = datetime
|
CreateTime = datetime,
|
||||||
|
FirstAddTaskId= questionMarkList.Where(y=>y.QuestionId==x.QuestionId).Select(x=>x.FirstAddTaskId).FirstOrDefault() ?? inDto.VisitTaskId,
|
||||||
}).ToList();
|
}).ToList();
|
||||||
await _readingTaskQuestionMarkRepository.AddRangeAsync(markList);
|
await _readingTaskQuestionMarkRepository.AddRangeAsync(markList);
|
||||||
await _readingTaskQuestionAnswerRepository.SaveChangesAsync();
|
await _readingTaskQuestionAnswerRepository.SaveChangesAsync();
|
||||||
|
|
|
@ -23,6 +23,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
private readonly IRepository<VisitTask> _visitTaskRepository;
|
private readonly IRepository<VisitTask> _visitTaskRepository;
|
||||||
private readonly IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository;
|
private readonly IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository;
|
||||||
private readonly IRepository<ReadingTableQuestionTrial> _readingTableQuestionTrialRepository;
|
private readonly IRepository<ReadingTableQuestionTrial> _readingTableQuestionTrialRepository;
|
||||||
|
private readonly IRepository<ReadingTaskQuestionMark> _readingTaskQuestionMarkRepository;
|
||||||
private readonly IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository;
|
private readonly IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository;
|
||||||
private readonly IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository;
|
private readonly IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository;
|
||||||
private readonly IRepository<OrganInfo> _organInfoRepository;
|
private readonly IRepository<OrganInfo> _organInfoRepository;
|
||||||
|
@ -36,6 +37,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
IRepository<VisitTask> visitTaskRepository,
|
IRepository<VisitTask> visitTaskRepository,
|
||||||
IRepository<ReadingQuestionCriterionTrial> readingQuestionCriterionTrialRepository,
|
IRepository<ReadingQuestionCriterionTrial> readingQuestionCriterionTrialRepository,
|
||||||
IRepository<ReadingTableQuestionTrial> readingTableQuestionTrialRepository,
|
IRepository<ReadingTableQuestionTrial> readingTableQuestionTrialRepository,
|
||||||
|
IRepository<ReadingTaskQuestionMark> readingTaskQuestionMarkRepository,
|
||||||
IRepository<ReadingTableAnswerRowInfo> readingTableAnswerRowInfoRepository,
|
IRepository<ReadingTableAnswerRowInfo> readingTableAnswerRowInfoRepository,
|
||||||
IRepository<ReadingQuestionTrial> readingQuestionTrialRepository,
|
IRepository<ReadingQuestionTrial> readingQuestionTrialRepository,
|
||||||
IRepository<OrganInfo> organInfoRepository,
|
IRepository<OrganInfo> organInfoRepository,
|
||||||
|
@ -49,6 +51,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
this._visitTaskRepository = visitTaskRepository;
|
this._visitTaskRepository = visitTaskRepository;
|
||||||
this._readingQuestionCriterionTrialRepository = readingQuestionCriterionTrialRepository;
|
this._readingQuestionCriterionTrialRepository = readingQuestionCriterionTrialRepository;
|
||||||
this._readingTableQuestionTrialRepository = readingTableQuestionTrialRepository;
|
this._readingTableQuestionTrialRepository = readingTableQuestionTrialRepository;
|
||||||
|
this._readingTaskQuestionMarkRepository = readingTaskQuestionMarkRepository;
|
||||||
this._readingTableAnswerRowInfoRepository = readingTableAnswerRowInfoRepository;
|
this._readingTableAnswerRowInfoRepository = readingTableAnswerRowInfoRepository;
|
||||||
this._readingQuestionTrialRepository = readingQuestionTrialRepository;
|
this._readingQuestionTrialRepository = readingQuestionTrialRepository;
|
||||||
this._organInfoRepository = organInfoRepository;
|
this._organInfoRepository = organInfoRepository;
|
||||||
|
@ -880,6 +883,47 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
QuestionMark.State,
|
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
|
var tableAnswers = copyTableAnswers.Select(x => new ReadingTableQuestionAnswer
|
||||||
{
|
{
|
||||||
Id = NewId.NextGuid(),
|
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);
|
var addList = _mapper.Map<List<ReadingTableAnswerRowInfo>>(tableRowAnswers);
|
||||||
|
|
||||||
|
await _readingTaskQuestionMarkRepository.AddRangeAsync(questionMarkList);
|
||||||
await _readingTableAnswerRowInfoRepository.AddRangeAsync(addList);
|
await _readingTableAnswerRowInfoRepository.AddRangeAsync(addList);
|
||||||
await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers);
|
await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers);
|
||||||
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
||||||
|
|
|
@ -33,40 +33,38 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// InstanceId
|
/// InstanceId
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Required]
|
public Guid? InstanceId { get; set; }
|
||||||
public Guid InstanceId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// SeriesId
|
/// SeriesId
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Required]
|
public Guid? SeriesId { get; set; }
|
||||||
public Guid SeriesId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// StudyId
|
/// StudyId
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Required]
|
|
||||||
public Guid StudyId { get; set; }
|
public Guid? StudyId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// MarkTool
|
/// MarkTool
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string MarkTool { get; set; }
|
public string MarkTool { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// PicturePath
|
/// PicturePath
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string PicturePath { get; set; }
|
public string PicturePath { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// NumberOfFrames
|
/// NumberOfFrames
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? NumberOfFrames { get; set; }
|
public int? NumberOfFrames { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// MeasureData
|
/// MeasureData
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Required]
|
[Required]
|
||||||
public string MeasureData { get; set; } = string.Empty;
|
public string MeasureData { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -79,6 +77,8 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid CreateUserId { get; set; }
|
public Guid CreateUserId { get; set; }
|
||||||
|
|
||||||
|
public Guid? FirstAddTaskId { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue