Merge branch 'Test_HIR_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_HIR_Net8
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
17937783e9
|
|
@ -431,6 +431,119 @@ namespace IRaCIS.Core.Application.Services
|
|||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取关键序列
|
||||
/// </summary>
|
||||
/// <param name="indto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<VisitStudyDTO?> GetKeySeries(GetReadingVisitStudyListIndto indto)
|
||||
{
|
||||
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 StudyInstanceInfo()
|
||||
{
|
||||
ShowOrder = x.ReadingQuestionTrial.ShowOrder,
|
||||
RowIndex = x.RowIndex,
|
||||
SeriesId = x.SeriesId,
|
||||
StudyId = x.StudyId,
|
||||
InstanceId = x.InstanceId,
|
||||
NumberOfFrames = x.NumberOfFrames,
|
||||
}).ToListAsync();
|
||||
|
||||
|
||||
|
||||
var customoList = await _readingCustomTagRepository.Where(x => x.VisitTaskId == indto.VisitTaskId && x.StudyId != null).Select(x => new StudyInstanceInfo()
|
||||
{
|
||||
ShowOrder = 0,
|
||||
RowIndex = 0m,
|
||||
SeriesId = x.SeriesId,
|
||||
StudyId = x.StudyId,
|
||||
InstanceId = x.InstanceId,
|
||||
NumberOfFrames = x.NumberOfFrames,
|
||||
}).ToListAsync();
|
||||
|
||||
rowInfoList.AddRange(customoList);
|
||||
|
||||
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 _dicomStudyRepository.Where(t => thisStudyIds.Contains(t.Id)).Select(k => new VisitStudyDTO()
|
||||
{
|
||||
InstanceCount = k.InstanceCount,
|
||||
|
||||
//SeriesCount = k.SeriesCount,
|
||||
|
||||
StudyId = k.Id,
|
||||
IsCriticalSequence = true,
|
||||
|
||||
}).FirstOrDefaultAsync();
|
||||
|
||||
if (thisVisitTaskStudy != null)
|
||||
{
|
||||
thisVisitTaskStudy.StudyId = default(Guid);
|
||||
var item = await _dicomSeriesRepository.Where(s => thisSeriesIdIds.Contains(s.Id)).OrderBy(s => s.SeriesNumber).
|
||||
ThenBy(s => s.SeriesTime)
|
||||
.ProjectTo<DicomSeriesDTO>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
item.SeriesInstanceUid = string.Empty;
|
||||
|
||||
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 _dicomInstanceRepository.Where(t => markInstanceIdList.Contains(t.Id)).Select(k =>
|
||||
new InstanceBasicInfo()
|
||||
{
|
||||
Id = k.Id,
|
||||
NumberOfFrames = k.NumberOfFrames,
|
||||
HtmlPath = k.HtmlPath,
|
||||
Path = k.Path,
|
||||
InstanceNumber = k.InstanceNumber,
|
||||
StudyId = k.StudyId,
|
||||
SeriesId = k.SeriesId,
|
||||
}).ToListAsync();
|
||||
|
||||
item.InstanceInfoList.ForEach(x =>
|
||||
{
|
||||
|
||||
var keyFramesList = rowInfoList.Where(y => y.InstanceId == x.Id && y.NumberOfFrames != 0).Select(y => y.NumberOfFrames).Distinct().ToList();
|
||||
|
||||
if (keyFramesList.Count() > 0)
|
||||
{
|
||||
x.KeyFramesList = keyFramesList;
|
||||
}
|
||||
|
||||
var item = rowInfoList.FirstOrDefault(y => y.InstanceId == x.Id);
|
||||
if (item != null)
|
||||
{
|
||||
x.ShowOrder = item.ShowOrder;
|
||||
x.RowIndex = item.RowIndex;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
item.InstanceInfoList.OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).ToList();
|
||||
|
||||
|
||||
item.InstanceCount = item.InstanceInfoList.Count;
|
||||
|
||||
item.Description = "Key Series";
|
||||
|
||||
var modalityList = await _dicomSeriesRepository.Where(s => thisSeriesIdIds.Contains(s.Id)).OrderBy(s => s.SeriesNumber).ThenBy(s => s.SeriesTime).Select(x => x.Modality).Distinct().ToListAsync(); ;
|
||||
item.Modality = string.Join(",", modalityList);
|
||||
thisVisitTaskStudy.SeriesList.Add(item);
|
||||
//thisVisitTaskStudy.SeriesCount = thisVisitTaskStudy.SeriesList.Count;
|
||||
}
|
||||
|
||||
|
||||
return thisVisitTaskStudy;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取访视下的Dicom 检查信息 分所有的, 阅片的 不阅片 isReading : 0 查询所有 1 查询仅仅阅片的
|
||||
|
|
@ -546,101 +659,16 @@ namespace IRaCIS.Core.Application.Services
|
|||
}).ToListAsync();
|
||||
|
||||
|
||||
|
||||
var customoList = await _readingCustomTagRepository.Where(x => x.VisitTaskId == indto.VisitTaskId && x.StudyId != null).Select(x => new StudyInstanceInfo()
|
||||
var keySeries = await this.GetKeySeries(indto);
|
||||
if (keySeries != null)
|
||||
{
|
||||
ShowOrder = 0,
|
||||
RowIndex = 0m,
|
||||
SeriesId = x.SeriesId,
|
||||
StudyId = x.StudyId,
|
||||
InstanceId = x.InstanceId,
|
||||
NumberOfFrames = x.NumberOfFrames,
|
||||
}).ToListAsync();
|
||||
|
||||
rowInfoList.AddRange(customoList);
|
||||
|
||||
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 _dicomStudyRepository.Where(t => thisStudyIds.Contains(t.Id)).Select(k => new VisitStudyDTO()
|
||||
{
|
||||
InstanceCount = k.InstanceCount,
|
||||
|
||||
//SeriesCount = k.SeriesCount,
|
||||
|
||||
StudyId = k.Id,
|
||||
IsCriticalSequence = true,
|
||||
|
||||
}).FirstOrDefaultAsync();
|
||||
|
||||
if (thisVisitTaskStudy != null)
|
||||
{
|
||||
thisVisitTaskStudy.StudyId = default(Guid);
|
||||
var item = await _dicomSeriesRepository.Where(s => thisSeriesIdIds.Contains(s.Id)).OrderBy(s => s.SeriesNumber).
|
||||
ThenBy(s => s.SeriesTime)
|
||||
.ProjectTo<DicomSeriesDTO>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
item.SeriesInstanceUid = string.Empty;
|
||||
|
||||
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 _dicomInstanceRepository.Where(t => markInstanceIdList.Contains(t.Id)).Select(k =>
|
||||
new InstanceBasicInfo()
|
||||
{
|
||||
Id = k.Id,
|
||||
NumberOfFrames = k.NumberOfFrames,
|
||||
HtmlPath = k.HtmlPath,
|
||||
Path = k.Path,
|
||||
InstanceNumber = k.InstanceNumber,
|
||||
StudyId = k.StudyId,
|
||||
SeriesId = k.SeriesId,
|
||||
}).ToListAsync();
|
||||
|
||||
item.InstanceInfoList.ForEach(x =>
|
||||
{
|
||||
|
||||
var keyFramesList = rowInfoList.Where(y => y.InstanceId == x.Id && y.NumberOfFrames != 0).Select(y => y.NumberOfFrames).Distinct().ToList();
|
||||
|
||||
if (keyFramesList.Count() > 0)
|
||||
{
|
||||
x.KeyFramesList = keyFramesList;
|
||||
}
|
||||
|
||||
var item = rowInfoList.FirstOrDefault(y => y.InstanceId == x.Id);
|
||||
if (item != null)
|
||||
{
|
||||
x.ShowOrder = item.ShowOrder;
|
||||
x.RowIndex = item.RowIndex;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
item.InstanceInfoList.OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).ToList();
|
||||
|
||||
|
||||
item.InstanceCount = item.InstanceInfoList.Count;
|
||||
|
||||
item.Description = "Key Series";
|
||||
|
||||
var modalityList = await _dicomSeriesRepository.Where(s => thisSeriesIdIds.Contains(s.Id)).OrderBy(s => s.SeriesNumber).ThenBy(s => s.SeriesTime).Select(x => x.Modality).Distinct().ToListAsync(); ;
|
||||
item.Modality = string.Join(",", modalityList);
|
||||
thisVisitTaskStudy.SeriesList.Add(item);
|
||||
//thisVisitTaskStudy.SeriesCount = thisVisitTaskStudy.SeriesList.Count;
|
||||
}
|
||||
|
||||
|
||||
|
||||
studyList.Insert(0, thisVisitTaskStudy);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
studyList.Insert(0, keySeries);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
studyList.ForEach(x =>
|
||||
{
|
||||
x.SeriesList.ForEach(y =>
|
||||
|
|
|
|||
Loading…
Reference in New Issue