修改多帧的逻辑
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-05-30 10:34:59 +08:00
parent 11e5448acf
commit 029a288be2
4 changed files with 46 additions and 69 deletions
@@ -42,22 +42,9 @@ namespace IRaCIS.Core.Application.Contracts.Dicom.DTO
public bool IsExistMutiFrames => InstanceInfoList.Any(t => t.NumberOfFrames > 1);
#region
public List<Guid> InstanceList { get; set; } = new List<Guid>();
public List<string> InstancePathList { get; set; } = new List<string>();
public List<string> InstanceHtmlPathList { get; set; }
//存放在instance 上面
public string WindowCenter { get; set; } = string.Empty;
public string WindowWidth { get; set; } = string.Empty;
#endregion
public string ImageResizePath { get; set; }
}
@@ -157,8 +157,8 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
studyMonitor.UploadFinishedTime = DateTime.Now;
studyMonitor.ArchiveFinishedTime = DateTime.Now;
studyMonitor.FailedFileCount = incommand.FailedFileCount;
studyMonitor.IsSuccess = incommand.FailedFileCount==0;
studyMonitor.RecordPath=incommand.RecordPath;
studyMonitor.IsSuccess = incommand.FailedFileCount == 0;
studyMonitor.RecordPath = incommand.RecordPath;
//上传
if (studyMonitor.IsDicomReUpload == false)
@@ -192,6 +192,16 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
study.SubjectId = incommand.SubjectId;
study.SubjectVisitId = incommand.SubjectVisitId;
//如果因为意外情况,连续点击两次,导致第一次插入了,第二次进来也会插入,在此判断一下
var findStudy = _dicomstudyRepository.FirstOrDefaultAsync(t => t.Id == study.Id);
if (findStudy != null)
{
//直接返回
return ResponseOutput.Ok();
}
//特殊处理逻辑
study.Modalities = string.Join("、", incommand.Study.SeriesList.Select(t => t.Modality).Distinct());
@@ -469,9 +479,9 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
.WhereIf(studyQuery.SubjectId != null, t => t.SubjectId == studyQuery.SubjectId)
.WhereIf(studyQuery.SubjectVisitId != null, t => t.SubjectId == studyQuery.SubjectVisitId)
.WhereIf(studyQuery.SiteId != null, t => t.SiteId == studyQuery.SiteId)
.WhereIf(studyQuery.IsDicom != null, t => t.IsDicom == studyQuery.IsDicom )
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.Uploader), t => t.Uploader.UserName.Contains(studyQuery.Uploader))
.WhereIf(studyQuery.IsSuccess != null, t => t.IsSuccess == studyQuery.IsSuccess)
.WhereIf(studyQuery.IsDicom != null, t => t.IsDicom == studyQuery.IsDicom)
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.Uploader), t => t.Uploader.UserName.Contains(studyQuery.Uploader))
.WhereIf(studyQuery.IsSuccess != null, t => t.IsSuccess == studyQuery.IsSuccess)
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.StudyCode), t => t.StudyCode.Contains(studyQuery.StudyCode))
.Select(t => new UnionStudyMonitorModel()
{
@@ -505,7 +515,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
ArchiveFinishedTime = t.ArchiveFinishedTime,
RecordPath=t.RecordPath,
RecordPath = t.RecordPath,
IsDicomReUpload = t.IsDicomReUpload,
StudyId = t.Id,
@@ -727,15 +737,15 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
StudyInstanceUid = t.StudyInstanceUid
}).ToList(),
UploadStudyList = u.TaskStudyList.Select(t => new
UploadStudyList = u.TaskStudyList.Select(t => new
{
Id = t.Id,
StudyInstanceUid = t.StudyInstanceUid,
SeriesList=t.SeriesList.Select(t => new UploadedSeries()
SeriesList = t.SeriesList.Select(t => new UploadedSeries()
{ SeriesId = t.Id, SeriesInstanceUid = t.SeriesInstanceUid, SOPInstanceUIDList = t.InstanceList.Select(c => c.SopInstanceUid).ToList() }).ToList()
}).ToList()
});
@@ -777,12 +787,12 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
if (findOriginStudy == null)
{
throw new BusinessValidationFailedException("该检查不属于该受试者,请核查") ;
throw new BusinessValidationFailedException("该检查不属于该受试者,请核查");
}
else
{
if(findOriginStudy.UploadStudyList.Any(t=>t.StudyInstanceUid == studyInstanceUid))
if (findOriginStudy.UploadStudyList.Any(t => t.StudyInstanceUid == studyInstanceUid))
{
result.AllowReUpload = true;
result.AllowUpload = false;
@@ -897,7 +907,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
var result = new VerifyStudyUploadResult();
if (_provider.Exists($"StudyUid_{trialId}_{studyInstanceUid}") && _provider.Get<Guid>($"StudyUid_{trialId}_{studyInstanceUid}").Value!=_userInfo.Id)
if (_provider.Exists($"StudyUid_{trialId}_{studyInstanceUid}") && _provider.Get<Guid>($"StudyUid_{trialId}_{studyInstanceUid}").Value != _userInfo.Id)
{
result.AllowUpload = false;