diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index d6bf0f90e..51a75e0b2 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -17269,17 +17269,17 @@ - ���� + 质疑 - һ���Ժ˲� + 一致性核查 - ���� + 复制 @@ -18400,6 +18400,36 @@ ISystemDocumentService + + + 体重 + + + + + 总剂量 + + + + + 半衰期 + + + + + 注射时间 + + + + + 成像 / 采集时间 + + + + + 是否存在空字符串字段(PatientSex、PatientWeight、RadionuclideTotalDose、RadionuclideHalfLife、RadiopharmaceuticalStartTime、AcquisitionTime 任意一个为空/空字符串) + + 性别 @@ -19648,6 +19678,11 @@ 成像 / 采集时间 + + + 是否存在空字符串字段(PatientSex、PatientWeight、RadionuclideTotalDose、RadionuclideHalfLife、RadiopharmaceuticalStartTime、AcquisitionTime 任意一个为空/空字符串) + + SystemBasicDataService diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DicomSeriesModel.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DicomSeriesModel.cs index 6e544f94a..67d8b34cb 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DicomSeriesModel.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DicomSeriesModel.cs @@ -102,6 +102,8 @@ namespace IRaCIS.Core.Application.Contracts.Dicom.DTO public Guid? SeriesId { get; set; } + public bool? IsMasked { get; set; } + [JsonIgnore] public int ShowOrder { get; set; } [JsonIgnore] diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs index e7fbd8947..f86a2b7d0 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs @@ -72,7 +72,8 @@ namespace IRaCIS.Core.Application.Services InstanceNumber = k.InstanceNumber, IsReading = true, IsDeleted = false, - FileSize = k.FileSize + FileSize = k.FileSize, + }).ToList(); @@ -103,7 +104,7 @@ namespace IRaCIS.Core.Application.Services .WhereIf(isReading == true, t => t.IsReading == true) .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, t.NumberOfFrames, t.InstanceNumber, t.HtmlPath, t.IsReading, t.IsDeleted, t.FileSize }).ToListAsync();//.GroupBy(u => u.SeriesId); + .Select(t => new { t.SeriesId, t.Id, t.Path, t.NumberOfFrames, t.InstanceNumber, t.HtmlPath, t.IsReading, t.IsDeleted, t.FileSize ,t.IsMasked}).ToListAsync();//.GroupBy(u => u.SeriesId); foreach (var series in seriesList) @@ -119,7 +120,8 @@ namespace IRaCIS.Core.Application.Services InstanceNumber = k.InstanceNumber, IsReading = k.IsReading, IsDeleted = k.IsDeleted, - FileSize = k.FileSize + FileSize = k.FileSize, + IsMasked = k.IsMasked }).ToList(); diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs index 708e93db1..1169cd9d8 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs @@ -92,7 +92,11 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc idPathList = await _dicomInstanceRepository.Where(t => t.SeriesId == inCommand.SeriesId).Select(t => new InstanceIdPath { Id = t.Id, Path = t.Path }).ToListAsync(); } - var errorPathList = new List(); + var errorList = new List(); + + var okList = new List(); + + var batchId = Guid.NewGuid(); foreach (var item in idPathList) { @@ -106,20 +110,27 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc var prefix = path.Substring(1, path.LastIndexOf('/') - 1); - var maskPath = $"{Path.GetFileName(path)}.MaskImage"; + //每次都用一个新的名字 + var maskFileName = $"{Path.GetFileName(path)}.{batchId}_MaskDicom"; - //清理缓存的里面的遮盖图,多次遮盖同一张图时,清除缓存很重要 - await _oSSService.DeleteFromPrefix(maskPath, true); + if (path.Contains("_MaskDicom")) + { + //清理缓存的里面的遮盖图,多次遮盖同一张图时,清除缓存很重要 + await _oSSService.DeleteFromPrefix(path, true); //清理缓存的里面的遮盖图,多次遮盖同一张图时,清除缓存很重要 + } - await _oSSService.UploadToOSSAsync(outPutStream, prefix, maskPath); + await _oSSService.UploadToOSSAsync(outPutStream, prefix, maskFileName, false); - var newPath = path + ".MaskImage"; + var newPath = $"/{prefix}/{maskFileName}"; - await _dicomInstanceRepository.BatchUpdateNoTrackingAsync(t => t.Id == item.Id, u => new DicomInstance() { Path= newPath, IsMasked = true }); + okList.Add(new InstanceIdPath() { Id = item.Id, Path = newPath }); + + await _dicomInstanceRepository.BatchUpdateNoTrackingAsync(t => t.Id == item.Id, u => new DicomInstance() { Path = newPath, IsMasked = true }); } catch (Exception ex) { - errorPathList.Add(path); + + errorList.Add(new InstanceIdPath() { Id = item.Id, Path = path }); Log.Logger.Error(ex, $"StudyMaskImage Error for InstanceIdList Path:{path} {ex.Message}"); } @@ -128,7 +139,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc await _dicomInstanceRepository.SaveChangesAsync(); - return ResponseOutput.Ok(errorPathList); + return ResponseOutput.Ok(new { OkList = okList, ErrorList = errorList }); } @@ -158,13 +169,18 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc idPathList = await _dicomInstanceRepository.Where(t => t.SeriesId == inCommand.SeriesId).Select(t => new InstanceIdPath { Id = t.Id, Path = t.Path }).ToListAsync(); } + var okList = new List(); + foreach (var item in idPathList) { - if (item.Path.EndsWith(".MaskImage")) + if (item.Path.EndsWith("_MaskDicom")) { - var newPath = item.Path[..^10]; + await _oSSService.DeleteFromPrefix(item.Path, true); - //await _oSSService.DeleteFromPrefix(newPath, true); + var length = Guid.Empty.ToString().Length + "_MaskDicom".Length; + var newPath = item.Path[..^length]; + + okList.Add(new InstanceIdPath() { Id = item.Id, Path = newPath }); await _dicomInstanceRepository.BatchUpdateNoTrackingAsync(t => t.Id == item.Id, u => new DicomInstance() { Path = newPath, IsMasked = false }); } @@ -174,7 +190,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc await _dicomInstanceRepository.SaveChangesAsync(); - return ResponseOutput.Ok(); + return ResponseOutput.Ok(new { OkList = okList }); } @@ -188,7 +204,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc public async Task GetPatientInfo(GetPatientInfoInDto inDto) { var study = await _dicomStudyRepository.Where(s => s.Id == inDto.StudyId).ProjectTo(_mapper.ConfigurationProvider).FirstNotNullAsync(); - + return study; }