修改稽查
This commit is contained in:
@@ -7,6 +7,8 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
public Guid Id { get; set;}
|
||||
public Guid StudyId { get; set; }
|
||||
public Guid SeriesId { get; set; }
|
||||
|
||||
public int NumberOfFrames { get; set; }
|
||||
public string StudyInstanceUid { get; set; } = string.Empty;
|
||||
public string SeriesInstanceUid { get; set; } = string.Empty;
|
||||
public string SopInstanceUid { get; set; } = string.Empty;
|
||||
|
||||
@@ -40,13 +40,33 @@ namespace IRaCIS.Core.Application.Services
|
||||
|
||||
var idList = await _instanceRepository.Where(s => s.StudyId == studyId).OrderBy(t => t.SeriesId).ThenBy(t => t.InstanceNumber)
|
||||
.ThenBy(s => s.InstanceTime).ThenBy(s => s.CreateTime)
|
||||
.Select(t => new { t.SeriesId, t.Id, t.Path }).ToListAsync();//.GroupBy(u => u.SeriesId);
|
||||
.Select(t => new { t.SeriesId, t.Id, t.Path, t.NumberOfFrames }).ToListAsync();//.GroupBy(u => u.SeriesId);
|
||||
|
||||
foreach (var item in seriesList)
|
||||
{
|
||||
item.InstanceList = idList.Where(s => s.SeriesId == item.Id).Select(u => u.Id).ToList();
|
||||
|
||||
item.InstancePathList = idList.Where(s => s.SeriesId == item.Id).Select(u => u.Path).ToList();
|
||||
//处理多帧
|
||||
item.InstancePathList = idList.Where(s => s.SeriesId == item.Id)
|
||||
.SelectMany(u =>
|
||||
{
|
||||
|
||||
if (u.NumberOfFrames == 1)
|
||||
{
|
||||
return new List<string>{u.Path};
|
||||
}
|
||||
else
|
||||
{
|
||||
var pathList = new List<string>();
|
||||
|
||||
for (int i = 1; i <= u.NumberOfFrames; i++)
|
||||
{
|
||||
pathList.Add(u.Path+ "?NumberOfFrames="+i);
|
||||
}
|
||||
return pathList;
|
||||
}
|
||||
})
|
||||
.ToList();
|
||||
}
|
||||
|
||||
#region 暂时废弃
|
||||
|
||||
@@ -786,7 +786,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
var jsonObject = JObject.Parse(arraysItem.ToString());
|
||||
try
|
||||
{
|
||||
if (jsonObject["DictionaryCode"]?.ToString() != string.Empty)
|
||||
if (jsonObject["DictionaryCode"]!=null && jsonObject["DictionaryCode"].ToString() != string.Empty)
|
||||
{
|
||||
|
||||
jsonObject[item.Code]= await _dictionaryRepository.Where(x => x.Code == jsonObject["DictionaryCode"].ToString()).Join(_dictionaryRepository.Where(x => x.Code == jsonObject[item.Code].ToString()), a => a.Id, b => b.ParentId, (a, b) => new
|
||||
|
||||
@@ -216,7 +216,7 @@ namespace IRaCIS.Core.Application.Services
|
||||
var studyIds = studyList.Select(t => t.StudyId).ToList();
|
||||
|
||||
var instanceList = await _repository.Where<DicomInstance>(t => studyIds.Contains(t.StudyId))
|
||||
.Select(t => new { t.SeriesId, t.Id, t.InstanceNumber,t.Path }).ToListAsync();
|
||||
.Select(t => new { t.SeriesId, t.Id, t.InstanceNumber,t.Path,t.NumberOfFrames }).ToListAsync();
|
||||
|
||||
foreach (var t in studyList)
|
||||
{
|
||||
@@ -230,7 +230,29 @@ namespace IRaCIS.Core.Application.Services
|
||||
{
|
||||
series.InstanceList = instanceList.Where(t => t.SeriesId == series.Id).OrderBy(t => t.InstanceNumber).Select(k => k.Id).ToList();
|
||||
|
||||
series.InstancePathList = instanceList.Where(t => t.SeriesId == series.Id).OrderBy(t => t.InstanceNumber).Select(k => k.Path).ToList();
|
||||
//series.InstancePathList = instanceList.Where(t => t.SeriesId == series.Id).OrderBy(t => t.InstanceNumber).Select(k => k.Path).ToList();
|
||||
|
||||
//处理多帧
|
||||
series.InstancePathList = instanceList.Where(s => s.SeriesId == series.Id)
|
||||
.SelectMany(u =>
|
||||
{
|
||||
|
||||
if (u.NumberOfFrames == 1)
|
||||
{
|
||||
return new List<string> { u.Path };
|
||||
}
|
||||
else
|
||||
{
|
||||
var pathList = new List<string>();
|
||||
|
||||
for (int i = 1; i <= u.NumberOfFrames; i++)
|
||||
{
|
||||
pathList.Add(u.Path + "?NumberOfFrames=" + i);
|
||||
}
|
||||
return pathList;
|
||||
}
|
||||
})
|
||||
.ToList();
|
||||
|
||||
}
|
||||
|
||||
@@ -325,7 +347,7 @@ namespace IRaCIS.Core.Application.Services
|
||||
var studyIds = studyList.Select(t => t.StudyId).ToList();
|
||||
|
||||
var instanceList = await _repository.Where<DicomInstance>(t => studyIds.Contains(t.StudyId))
|
||||
.Select(t => new { t.SeriesId, t.Id, t.InstanceNumber,t.Path }).ToListAsync();
|
||||
.Select(t => new { t.SeriesId, t.Id, t.InstanceNumber,t.Path,t.NumberOfFrames }).ToListAsync();
|
||||
|
||||
|
||||
|
||||
@@ -339,7 +361,31 @@ namespace IRaCIS.Core.Application.Services
|
||||
|
||||
t.SeriesList.ForEach(series => {
|
||||
series.InstanceList = instanceList.Where(t => t.SeriesId == series.Id).OrderBy(t => t.InstanceNumber).Select(k => k.Id).ToList();
|
||||
series.InstancePathList = instanceList.Where(t => t.SeriesId == series.Id).OrderBy(t => t.InstanceNumber).Select(k => k.Path).ToList();
|
||||
|
||||
|
||||
//series.InstancePathList = instanceList.Where(t => t.SeriesId == series.Id).OrderBy(t => t.InstanceNumber).Select(k => k.Path).ToList();
|
||||
|
||||
//处理多帧
|
||||
series.InstancePathList = instanceList.Where(s => s.SeriesId == series.Id).OrderBy(t => t.InstanceNumber)
|
||||
.SelectMany(u =>
|
||||
{
|
||||
|
||||
if (u.NumberOfFrames == 1)
|
||||
{
|
||||
return new List<string> { u.Path };
|
||||
}
|
||||
else
|
||||
{
|
||||
var pathList = new List<string>();
|
||||
|
||||
for (int i = 1; i <= u.NumberOfFrames; i++)
|
||||
{
|
||||
pathList.Add(u.Path + "?NumberOfFrames=" + i);
|
||||
}
|
||||
return pathList;
|
||||
}
|
||||
})
|
||||
.ToList();
|
||||
});
|
||||
|
||||
//设置为阅片与否 不更改数据库检查 的instance数量 和 SeriesCount 所以这里要实时统计
|
||||
|
||||
Reference in New Issue
Block a user