下载压缩包 加入标准层级
parent
49554ae764
commit
7d81cb72ee
|
|
@ -1350,12 +1350,18 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
using var zip = new ZipArchive(responseStream, ZipArchiveMode.Create, leaveOpen: true);
|
using var zip = new ZipArchive(responseStream, ZipArchiveMode.Create, leaveOpen: true);
|
||||||
var existingEntryPaths = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
var existingEntryPaths = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||||
|
|
||||||
foreach (var item in data)
|
foreach (var criterion in data)
|
||||||
|
{
|
||||||
|
abortToken.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
|
var criterionFolderName = SanitizePathSegment(criterion.CriterionName, "UnknownCriterion");
|
||||||
|
|
||||||
|
foreach (var item in criterion.ReadingReportAndImageList)
|
||||||
{
|
{
|
||||||
abortToken.ThrowIfCancellationRequested();
|
abortToken.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
var folderName =
|
var folderName =
|
||||||
$"{SanitizePathSegment(item.SubjectCode, "UnknownSubject")}_{SanitizePathSegment(item.VisitName, "UnknownVisit")}";
|
$"{criterionFolderName}/{SanitizePathSegment(item.SubjectCode, "UnknownSubject")}_{SanitizePathSegment(item.VisitName, "UnknownVisit")}";
|
||||||
|
|
||||||
foreach (var reportUrl in item.ReportUrlList.Where(x => !string.IsNullOrWhiteSpace(x)))
|
foreach (var reportUrl in item.ReportUrlList.Where(x => !string.IsNullOrWhiteSpace(x)))
|
||||||
{
|
{
|
||||||
|
|
@ -1398,6 +1404,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
catch (OperationCanceledException)
|
catch (OperationCanceledException)
|
||||||
{
|
{
|
||||||
Log.Logger.Warning("Download reading report and image canceled by client");
|
Log.Logger.Warning("Download reading report and image canceled by client");
|
||||||
|
|
|
||||||
|
|
@ -298,6 +298,12 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
public List<Guid> VisitTaskIdList { get; set; } = new List<Guid>() { };
|
public List<Guid> VisitTaskIdList { get; set; } = new List<Guid>() { };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class ReadingReportAndImageCriterion
|
||||||
|
{
|
||||||
|
public string CriterionName { get; set; }
|
||||||
|
|
||||||
|
public List<ReadingReportAndImage> ReadingReportAndImageList { get; set; } = new List<ReadingReportAndImage>();
|
||||||
|
}
|
||||||
public class ReadingReportAndImage
|
public class ReadingReportAndImage
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
{
|
{
|
||||||
public interface IReadingImageTaskService
|
public interface IReadingImageTaskService
|
||||||
{
|
{
|
||||||
Task<List<ReadingReportAndImage>> GetReadingReportAndImage(GetReadingReportAndImageInDto inDto);
|
Task<List<ReadingReportAndImageCriterion>> GetReadingReportAndImage(GetReadingReportAndImageInDto inDto);
|
||||||
Task<IResponseOutput> SubmitVisitTaskQuestions(SubmitVisitTaskQuestionsInDto inDto);
|
Task<IResponseOutput> SubmitVisitTaskQuestions(SubmitVisitTaskQuestionsInDto inDto);
|
||||||
|
|
||||||
Task<IResponseOutput> SubmitJudgeVisitTaskResult(SaveJudgeVisitTaskResult inDto);
|
Task<IResponseOutput> SubmitJudgeVisitTaskResult(SaveJudgeVisitTaskResult inDto);
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
/// <param name="inDto"></param>
|
/// <param name="inDto"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<List<ReadingReportAndImage>> GetReadingReportAndImage(GetReadingReportAndImageInDto inDto)
|
public async Task<List<ReadingReportAndImageCriterion>> GetReadingReportAndImage(GetReadingReportAndImageInDto inDto)
|
||||||
{
|
{
|
||||||
var taskList=new List<VisitTask> { };
|
var taskList=new List<VisitTask> { };
|
||||||
|
|
||||||
|
|
@ -88,7 +88,12 @@ namespace IRaCIS.Core.Application.Service
|
||||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_ReportDataInvalid"]);
|
throw new BusinessValidationFailedException(_localizer["ReadingImage_ReportDataInvalid"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
taskList=await _visitTaskRepository.Where(x => inDto.VisitTaskIdList.Contains(x.Id)&&x.ReadingCategory==ReadingCategory.Visit).Include(x=>x.LesionList).Include(x=>x.Subject).Include(x=>x.SourceSubjectVisit).ToListAsync();
|
taskList=await _visitTaskRepository.Where(x => inDto.VisitTaskIdList.Contains(x.Id)&&x.ReadingCategory==ReadingCategory.Visit)
|
||||||
|
.Include(x=>x.LesionList)
|
||||||
|
.Include(x=>x.Subject)
|
||||||
|
.Include(x=>x.SourceSubjectVisit)
|
||||||
|
.Include(x => x.TrialReadingCriterion)
|
||||||
|
.ToListAsync();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -96,12 +101,30 @@ namespace IRaCIS.Core.Application.Service
|
||||||
.Include(x => x.LesionList)
|
.Include(x => x.LesionList)
|
||||||
.Include(x => x.Subject)
|
.Include(x => x.Subject)
|
||||||
.Include(x => x.SourceSubjectVisit)
|
.Include(x => x.SourceSubjectVisit)
|
||||||
|
.Include(x=>x.TrialReadingCriterion)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
List< ReadingReportAndImage > result = new List<ReadingReportAndImage>() { };
|
|
||||||
|
|
||||||
foreach (var item in taskList)
|
List<ReadingReportAndImageCriterion> imageCriteriaList = new List<ReadingReportAndImageCriterion>();
|
||||||
|
|
||||||
|
|
||||||
|
var trialReadingCriterionList = taskList.Select(x => x.TrialReadingCriterion).Distinct().ToList();
|
||||||
|
|
||||||
|
foreach (var criterion in trialReadingCriterionList)
|
||||||
|
{
|
||||||
|
ReadingReportAndImageCriterion imageCriterion = new ReadingReportAndImageCriterion()
|
||||||
|
{
|
||||||
|
CriterionName = criterion.CriterionName,
|
||||||
|
ReadingReportAndImageList = new List<ReadingReportAndImage>() { }
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var criterionTaskList = taskList.Where(x => x.TrialReadingCriterionId == criterion.Id).ToList();
|
||||||
|
|
||||||
|
|
||||||
|
foreach (var item in criterionTaskList)
|
||||||
{
|
{
|
||||||
ReadingReportAndImage data = new ReadingReportAndImage()
|
ReadingReportAndImage data = new ReadingReportAndImage()
|
||||||
{
|
{
|
||||||
|
|
@ -155,9 +178,14 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
result.Add(data);
|
imageCriterion.ReadingReportAndImageList.Add(data);
|
||||||
}
|
}
|
||||||
return result;
|
|
||||||
|
imageCriteriaList.Add(imageCriterion);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return imageCriteriaList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue