添加获取Series信息

IRC_NewDev
he 2024-03-19 16:43:02 +08:00
parent 381e7b5046
commit b776103328
2 changed files with 55 additions and 2 deletions

View File

@ -242,7 +242,13 @@ namespace IRaCIS.Core.Application.Contracts
public List<DicomSeriesDTO> PTSeriesList { get; set; }
}
public class GetPTAndCtSeriesInDto
public class GetDicomSeriesInfoInDto
{
public Guid SeriesId { get; set; }
}
public class GetPTAndCtSeriesInDto
{
public Guid VisitTaskId { get; set; }
}

View File

@ -328,11 +328,58 @@ namespace IRaCIS.Core.Application.Services
}
/// <summary>
/// 获取PTAndCtSeries
/// 获取Series信息
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<DicomSeriesDTO> GetDicomSeriesInfo(GetDicomSeriesInfoInDto inDto)
{
DicomSeriesDTO series = await _repository.Where<DicomSeries>(s =>s.Id==inDto.SeriesId).ProjectTo<DicomSeriesDTO>(_mapper.ConfigurationProvider).FirstNotNullAsync();
var instanceList = await _repository.Where<DicomInstance>(t => t.SeriesId==inDto.SeriesId)
.Select(t => new { t.SeriesId, t.StudyId, t.Id, t.InstanceNumber, t.Path, t.NumberOfFrames, t.WindowCenter, t.WindowWidth, t.HtmlPath }).ToListAsync();
series.InstanceList = instanceList.Where(t => t.SeriesId == series.Id).OrderBy(t => t.InstanceNumber).Select(k => k.Id).ToList();
series.InstanceHtmlPathList = instanceList.Where(t => t.SeriesId == series.Id && t.HtmlPath != string.Empty).OrderBy(t => t.InstanceNumber).Select(k => k.HtmlPath).ToList();
//处理多帧
series.InstancePathList = instanceList.Where(s => s.SeriesId == series.Id).OrderBy(t => t.InstanceNumber)
.SelectMany(u =>
{
if (u.NumberOfFrames > 1)
{
var pathList = new List<string>();
for (int i = 1; i <= u.NumberOfFrames; i++)
{
pathList.Add(u.Path + "?frame=" + (i - 1));
}
return pathList;
}
else
{
return new List<string> { u.Path };
}
})
.ToList();
series.WindowWidth = instanceList.FirstOrDefault()!.WindowWidth;
series.WindowCenter = instanceList.FirstOrDefault()!.WindowCenter;
return series;
}
/// <summary>
/// 获取PTAndCtSeries
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<List<GetPTAndCtSeriesOutDto>> GetPTAndCtSeries(GetPTAndCtSeriesInDto inDto)
{