|
|
|
@@ -482,7 +482,7 @@ namespace IRaCIS.Core.Application.Services
|
|
|
|
|
{
|
|
|
|
|
var result = new List<VisitStudyDTO>();
|
|
|
|
|
|
|
|
|
|
var thisRowinfo = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == indto.VisitTaskId && x.StudyId != null).OrderBy(x => x.ReadingQuestionTrial.ShowOrder).ThenBy(x => x.RowIndex).Select(x => new
|
|
|
|
|
var rowInfoList = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == indto.VisitTaskId && x.StudyId != null).OrderBy(x => x.ReadingQuestionTrial.ShowOrder).ThenBy(x => x.RowIndex).Select(x => new
|
|
|
|
|
{
|
|
|
|
|
x.ReadingQuestionTrial.ShowOrder,
|
|
|
|
|
x.RowIndex,
|
|
|
|
@@ -497,9 +497,9 @@ namespace IRaCIS.Core.Application.Services
|
|
|
|
|
if (taskInfo.ReadingTaskState == ReadingTaskState.HaveSigned)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var thisStudyIds = thisRowinfo.OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).Select(x => x.StudyId).Distinct().ToList();
|
|
|
|
|
var thisSeriesIdIds = thisRowinfo.Where(x => x.SeriesId != null).OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).Select(x => x.SeriesId).Distinct().ToList();
|
|
|
|
|
if (thisRowinfo.Count > 0)
|
|
|
|
|
var thisStudyIds = rowInfoList.OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).Select(x => x.StudyId).Distinct().ToList();
|
|
|
|
|
var thisSeriesIdIds = rowInfoList.Where(x => x.SeriesId != null).OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).Select(x => x.SeriesId).Distinct().ToList();
|
|
|
|
|
if (rowInfoList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
var thisVisitTaskStudy = await _repository.Where<DicomStudy>(t => thisStudyIds.Contains(t.Id)).Select(k => new VisitStudyDTO()
|
|
|
|
|
{
|
|
|
|
@@ -523,7 +523,7 @@ namespace IRaCIS.Core.Application.Services
|
|
|
|
|
{
|
|
|
|
|
item.SeriesInstanceUid = string.Empty;
|
|
|
|
|
|
|
|
|
|
var markInstanceIdList = thisRowinfo.Where(y => y.InstanceId != null).OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).Select(y => y.InstanceId!.Value).Distinct().ToList();
|
|
|
|
|
var markInstanceIdList = rowInfoList.Where(y => y.InstanceId != null).OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).Select(y => y.InstanceId!.Value).Distinct().ToList();
|
|
|
|
|
|
|
|
|
|
item.InstanceInfoList = await _repository.Where<DicomInstance>(t => markInstanceIdList.Contains(t.Id)).OrderBy(t => t.InstanceNumber).Select(k =>
|
|
|
|
|
new InstanceBasicInfo()
|
|
|
|
@@ -539,7 +539,7 @@ namespace IRaCIS.Core.Application.Services
|
|
|
|
|
item.InstanceInfoList.ForEach(x =>
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var item = thisRowinfo.FirstOrDefault(y => y.InstanceId == x.Id);
|
|
|
|
|
var item = rowInfoList.FirstOrDefault(y => y.InstanceId == x.Id);
|
|
|
|
|
if (item != null)
|
|
|
|
|
{
|
|
|
|
|
x.ShowOrder = item.ShowOrder;
|
|
|
|
@@ -600,9 +600,8 @@ namespace IRaCIS.Core.Application.Services
|
|
|
|
|
List<DicomSeriesDTO> seriesLists = await _repository.Where<DicomSeries>(s => studyIds.Contains(s.StudyId) /*&& s.IsReading*/)
|
|
|
|
|
.WhereIf(isManualGenerate == false, t => t.IsReading)
|
|
|
|
|
.WhereIf(isManualGenerate, t => t.SubjectCriteriaEvaluationVisitStudyFilterList.Any(t => t.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId && t.IsConfirmed && t.IsReading))
|
|
|
|
|
.OrderBy(s => s.SeriesNumber).
|
|
|
|
|
ThenBy(s => s.SeriesTime)
|
|
|
|
|
.ProjectTo<DicomSeriesDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
|
|
|
|
.OrderBy(s => s.SeriesNumber). ThenBy(s => s.SeriesTime).ProjectTo<DicomSeriesDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
|
|
|
|
|
|
|
|
|
foreach (var t in studyList)
|
|
|
|
|
{
|
|
|
|
|
t.SeriesList = seriesLists.Where(s => s.StudyId == t.StudyId).OrderBy(s => s.SeriesNumber).
|
|
|
|
@@ -692,7 +691,7 @@ namespace IRaCIS.Core.Application.Services
|
|
|
|
|
{
|
|
|
|
|
x.SeriesList.ForEach(y =>
|
|
|
|
|
{
|
|
|
|
|
y.IsBeMark = thisRowinfo.Any(z => z.SeriesId == y.Id);
|
|
|
|
|
y.IsBeMark = rowInfoList.Any(z => z.SeriesId == y.Id);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|