非dicom 检查列表返回文件信息,同时增加IR 上传文件绑定
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
006a5729d6
commit
735083999e
|
@ -38,6 +38,7 @@ using Newtonsoft.Json;
|
|||
using SharpCompress.Archives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Data;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
|
@ -419,12 +420,20 @@ namespace IRaCIS.Core.API.Controllers
|
|||
|
||||
public class UploadNoneDicomFileCommand
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
[NotDefault]
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
public Guid NoneDicomStudyId { get; set; }
|
||||
|
||||
|
||||
[NotDefault]
|
||||
public Guid StudyMonitorId { get; set; }
|
||||
|
||||
|
||||
public Guid? NoneDicomStudyId { get; set; }
|
||||
|
||||
//IR 上传的时候跟任务绑定
|
||||
public Guid? VisitTaskId { get; set; }
|
||||
|
||||
|
||||
public List<OSSFileDTO> UploadedFileList { get; set; } = new List<OSSFileDTO>();
|
||||
|
||||
|
||||
|
@ -470,7 +479,19 @@ namespace IRaCIS.Core.API.Controllers
|
|||
|
||||
foreach (var item in incommand.UploadedFileList)
|
||||
{
|
||||
await _noneDicomStudyFileRepository.AddAsync(new NoneDicomStudyFile() { FileName = item.FileName, Path = item.FilePath, NoneDicomStudyId = noneDicomStudyId,FileType=item.FileType,FileSize=item.FileFize });
|
||||
//如果是跟任务绑,那么NoneDicomStudyId 设置为空,不影响之前的检查,同时设置 OriginNoneDicomStudyId 保证关系
|
||||
|
||||
if(incommand.VisitTaskId!=null && incommand.VisitTaskId !=Guid.Empty)
|
||||
{
|
||||
await _noneDicomStudyFileRepository.AddAsync(new NoneDicomStudyFile() { FileName = item.FileName, Path = item.FilePath, OriginNoneDicomStudyId=noneDicomStudyId.Value, FileType = item.FileType, FileSize = item.FileFize });
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
await _noneDicomStudyFileRepository.AddAsync(new NoneDicomStudyFile() { FileName = item.FileName, Path = item.FilePath, NoneDicomStudyId = noneDicomStudyId.Value, FileType = item.FileType, FileSize = item.FileFize });
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
var uploadFinishedTime = DateTime.Now;
|
||||
|
@ -483,7 +504,7 @@ namespace IRaCIS.Core.API.Controllers
|
|||
studyMonitor.FileSize = incommand.UploadedFileList.Sum(t => t.FileFize);
|
||||
studyMonitor.IsDicom = false;
|
||||
studyMonitor.IsDicomReUpload = false;
|
||||
studyMonitor.StudyId = noneDicomStudyId;
|
||||
studyMonitor.StudyId = noneDicomStudyId.Value;
|
||||
studyMonitor.StudyCode = noneDicomStudy.StudyCode;
|
||||
studyMonitor.ArchiveFinishedTime = DateTime.Now;
|
||||
studyMonitor.IP = _userInfo.IP;
|
||||
|
|
|
@ -377,7 +377,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
public string SubjectCode { get; set; }
|
||||
}
|
||||
|
||||
public class CRCUploadTaskStudyQuery: SortInput
|
||||
public class CRCUploadTaskStudyQuery : SortInput
|
||||
{
|
||||
|
||||
[NotDefault]
|
||||
|
@ -415,7 +415,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
public int UploadedFileCount { get; set; }
|
||||
}
|
||||
|
||||
public class TaskDicomStudyDTO: DicomStudyBasicInfo
|
||||
public class TaskDicomStudyDTO : DicomStudyBasicInfo
|
||||
{
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
|
@ -438,12 +438,28 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
}
|
||||
|
||||
public class NoneDicomFileInfo
|
||||
{
|
||||
[JsonIgnore]
|
||||
public Guid? OriginNoneDicomStudyId { get; set; }
|
||||
|
||||
public string FileType { get; set; }
|
||||
|
||||
public long? FileSize { get; set; }
|
||||
public string FileName { get; set; }
|
||||
|
||||
public string Path { get; set; }
|
||||
}
|
||||
|
||||
public class TaskNoneDicomStudyDTO : NoneDicomStudyBasicInfo
|
||||
{
|
||||
|
||||
|
||||
public int UploadedFileCount { get; set; }
|
||||
|
||||
public List<NoneDicomFileInfo> UploadedFileList { get; set; }
|
||||
|
||||
public List<NoneDicomFileInfo> FileList { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
|
@ -468,7 +484,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
public List<Guid> NoneDicomStudyIdList { get; set; }
|
||||
}
|
||||
|
||||
public class IRReadingDownloadQuery:SortInput
|
||||
public class IRReadingDownloadQuery : SortInput
|
||||
{
|
||||
[NotDefault]
|
||||
public Guid SubjectId { get; set; }
|
||||
|
|
|
@ -1025,6 +1025,14 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
Modality = ns.Modality,
|
||||
StudyCode = ns.StudyCode,
|
||||
|
||||
FileList = ns.NoneDicomFileList.Select(t => new NoneDicomFileInfo()
|
||||
{
|
||||
FileType=t.FileType,
|
||||
FileName = t.FileName,
|
||||
FileSize = t.FileSize,
|
||||
Path = t.Path
|
||||
}).ToList()
|
||||
|
||||
};
|
||||
|
||||
var list = await query.Where(t => t.SubjectCode == inQuery.SubjectCode).SortToListAsync(inQuery);
|
||||
|
@ -1034,15 +1042,21 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
|
||||
var taskNoneDicomStudyList = _visitTaskRepository.Where(t => noneDicomStudyIdList.Contains(t.Id))
|
||||
.SelectMany(t => t.TaskNoneDicomStudyFileList).Where(t => noneDicomStudyIdList.Contains((Guid)t.VisitTaskId))
|
||||
.Select(u => new
|
||||
.Select(u => new NoneDicomFileInfo
|
||||
{
|
||||
u.OriginNoneDicomStudyId,
|
||||
OriginNoneDicomStudyId = u.OriginNoneDicomStudyId,
|
||||
|
||||
FileType=u.FileType
|
||||
FileName = u.FileName,
|
||||
FileSize = u.FileSize,
|
||||
Path = u.Path
|
||||
})
|
||||
.ToList();
|
||||
|
||||
foreach (var item in list)
|
||||
{
|
||||
item.UploadedFileCount = taskNoneDicomStudyList.Where(t => t.OriginNoneDicomStudyId == item.Id).Count();
|
||||
item.UploadedFileList = taskNoneDicomStudyList.Where(t => t.OriginNoneDicomStudyId == item.Id).ToList();
|
||||
}
|
||||
|
||||
return list;
|
||||
|
|
Loading…
Reference in New Issue