diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DicomInstanceModel.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DicomInstanceModel.cs index cbede37f9..ba6b48896 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DicomInstanceModel.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DicomInstanceModel.cs @@ -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; diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs index 215fefc09..ee876b410 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs @@ -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{u.Path}; + } + else + { + var pathList = new List(); + + for (int i = 1; i <= u.NumberOfFrames; i++) + { + pathList.Add(u.Path+ "?NumberOfFrames="+i); + } + return pathList; + } + }) + .ToList(); } #region 暂时废弃 diff --git a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs index 09ea1fded..5cf3c16ef 100644 --- a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs @@ -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 diff --git a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs index 8c2ae3fc2..f55369a14 100644 --- a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs +++ b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs @@ -216,7 +216,7 @@ namespace IRaCIS.Core.Application.Services var studyIds = studyList.Select(t => t.StudyId).ToList(); var instanceList = await _repository.Where(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 { u.Path }; + } + else + { + var pathList = new List(); + + 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(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 { u.Path }; + } + else + { + var pathList = new List(); + + for (int i = 1; i <= u.NumberOfFrames; i++) + { + pathList.Add(u.Path + "?NumberOfFrames=" + i); + } + return pathList; + } + }) + .ToList(); }); //设置为阅片与否 不更改数据库检查 的instance数量 和 SeriesCount 所以这里要实时统计 diff --git a/IRaCIS.Core.Domain/Common/FrontAuditConfig.cs b/IRaCIS.Core.Domain/Common/FrontAuditConfig.cs index 4010c59fe..50313ef3e 100644 --- a/IRaCIS.Core.Domain/Common/FrontAuditConfig.cs +++ b/IRaCIS.Core.Domain/Common/FrontAuditConfig.cs @@ -17,115 +17,20 @@ namespace IRaCIS.Core.Domain.Models [Table("FrontAuditConfig")] public class FrontAuditConfig : Entity, IAuditUpdate, IAuditAdd { - /// - /// Value - /// public string Value { get; set; } = String.Empty; - /// - /// ValueCN - /// - public string ValueCN { get; set; } = String.Empty; - /// - /// Description - /// - public string Description { get; set; } = String.Empty; - /// - /// CreateTime - /// - public DateTime CreateTime { get; set; } - /// - /// CreateUserId - /// - public Guid CreateUserId { get; set; } - - /// - /// UpdateTime - /// - public DateTime UpdateTime { get; set; } - /// - /// UpdateUserId - /// - public Guid UpdateUserId { get; set; } - /// - /// Code - /// - - public string Code { get; set; } = String.Empty; - - /// - /// ParentId - /// - public Guid? ParentId { get; set; } - - /// - /// IsEnable - /// - - public bool IsEnable { get; set; } - - /// - /// IsConfig - /// - - public bool IsConfig { get; set; } - - /// - /// ModuleTypeId - /// - public Guid? ModuleTypeId { get; set; } - - /// - /// OptTypeId - /// - public Guid? OptTypeId { get; set; } - - /// - /// ChildrenTypeId - /// - public Guid? ChildrenTypeId { get; set; } - - public int IsShowParent { get; set; } - - public string ConfigType { get; set; } = String.Empty; - - public int Sort { get; set; } - - - - - public string DictionaryKey { get; set; } - - public string EnumType { get; set; } - - - public Guid? ObjectTypeId { get; set; } - - - public bool IsShowByTrialConfig { get; set; } - - public string TrialConfigRelyFieldName { get; set; } - - - - /// - /// 标识 - /// - public string Identification { get; set; } - - /// /// 是否有签名 /// @@ -147,27 +52,69 @@ namespace IRaCIS.Core.Domain.Models public bool IsJoinPlan { get; set; } /// - /// 数据类型 + /// 标识 + /// + public string Identification { get; set; } + + public Guid? ParentId { get; set; } + + + public bool IsEnable { get; set; } + + public int Sort { get; set; } + + + public Guid? ModuleTypeId { get; set; } + + public Guid? ObjectTypeId { get; set; } + public Guid? OptTypeId { get; set; } + + public Guid? ChildrenTypeId { get; set; } + + public int IsShowParent { get; set; } + + public string InterfaceName { get; set; } = String.Empty; + + //前端使用 C M + public string ConfigType { get; set; } = String.Empty; + + + //翻译的字段名 这里有可能是一个数组名 那么具体的翻译字段名就不是这个了 + public string Code { get; set; } = String.Empty; + + + //前端渲染数组 数组名 和数组值 + public string ChildDataLabel { get; set; } + public string ChildDataValue { get; set; } + + + + /// + /// 翻译的字典名(单个字段翻译的时候) + /// + + public string DictionaryCode { get; set; } = String.Empty; + + + + + + + /// + /// 前端展示类型 Router, Array,Table /// public string DataType { get; set; } - /// - /// 子数据Lable - /// + // 后端翻译的类型 对应前端界面 "",Dictionary,Date + public string EnumType { get; set; } + - public string ChildDataLabel { get; set; } /// - /// 子数据Value + /// 翻译的类型 FrontAudit 的描述 可能是Id Code /// - - public string ChildDataValue { get; set; } - - /// - /// 是否为特殊类型 - /// - public bool IsSpecialType { get; set; } + public string DictionaryType { get; set; } = String.Empty; /// @@ -176,49 +123,49 @@ namespace IRaCIS.Core.Domain.Models public string DateType { get; set; } = String.Empty; - /// - /// 字典Code - /// - public string DictionaryCode { get; set; } = String.Empty; - /// - /// 字典Type - /// - public string DictionaryType { get; set; } = String.Empty; - /// - /// 字典表 - /// + + + + + + + + /// 字典表 public string ForeignKeyTableName { get; set; } = String.Empty; - /// - /// 字典Value - /// - + /// 字典Value public string ForeignKeyValue { get; set; } = String.Empty; - /// - /// 字典 - /// - + /// 字典 public string ForeignKeyText { get; set; } = String.Empty; - /// - /// 接口名 - /// - - public string InterfaceName { get; set; } = String.Empty; - public string TableConfigJsonStr { get; set; } = String.Empty; public string UrlConfigJsonStr { get; set; } = String.Empty; + + + #region 废弃 + //未知是否有用 + public bool IsConfig { get; set; } + public string DictionaryKey { get; set; } + public bool IsShowByTrialConfig { get; set; } + public string TrialConfigRelyFieldName { get; set; } + + /// + /// 是否为特殊类型 + /// + public bool IsSpecialType { get; set; } + #endregion + } @@ -257,7 +204,6 @@ namespace IRaCIS.Core.Domain.Models public string MergeColumnName { get; set; } = String.Empty; - } }