获取下载地址
parent
56e109ce0a
commit
8801308002
|
|
@ -9,6 +9,7 @@ using FellowOakDicom.Media;
|
|||
using Hangfire.Storage;
|
||||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Application.Interfaces;
|
||||
using IRaCIS.Application.Services;
|
||||
using IRaCIS.Core.API._ServiceExtensions.NewtonsoftJson;
|
||||
using IRaCIS.Core.Application.BusinessFilter;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
|
|
@ -18,6 +19,7 @@ using IRaCIS.Core.Application.Filter;
|
|||
using IRaCIS.Core.Application.Helper;
|
||||
using IRaCIS.Core.Application.MassTransit.Command;
|
||||
using IRaCIS.Core.Application.Service;
|
||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infra.EFCore;
|
||||
|
|
@ -1283,7 +1285,26 @@ namespace IRaCIS.Core.API.Controllers
|
|||
}
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// 下载阅片报告和图片
|
||||
///// </summary>
|
||||
///// <param name="_readingImageTaskService"></param>
|
||||
///// <param name="_oSSService"></param>
|
||||
///// <param name="_downLoadHub"></param>
|
||||
///// <param name="inCommand"></param>
|
||||
///// <returns></returns>
|
||||
//[HttpPost("download/ReadingReportAndImage")]
|
||||
//public async Task<IActionResult> DownloadReadingReportAndImage([FromServices] IReadingImageTaskService _readingImageTaskService, [FromServices] IOSSService _oSSService,
|
||||
// [FromServices] IHubContext<DownloadHub, IDownloadClient> _downLoadHub,
|
||||
// [FromForm] GetReadingReportAndImageInDto inCommand)
|
||||
//{
|
||||
// Response.ContentType = "application/zip";
|
||||
// Response.Headers["Content-Disposition"] = $"attachment; filename=Image_{ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId)}.zip";
|
||||
// Response.Headers["Cache-Control"] = "no-store";
|
||||
|
||||
// var data = await _readingImageTaskService.GetReadingReportAndImage(inCommand);
|
||||
|
||||
//}
|
||||
|
||||
[HttpPost("download/PatientStudyBatchDownloadForm")]
|
||||
public async Task<IActionResult> DownloadPatientStudyBatchForm([FromServices] IPatientService _patientService, [FromServices] IOSSService _oSSService,
|
||||
|
|
|
|||
|
|
@ -291,6 +291,23 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
public List<string> SheetNames { get; set; }
|
||||
}
|
||||
|
||||
public class GetReadingReportAndImageInDto
|
||||
{
|
||||
public Guid TrialCriterionId { get; set; }
|
||||
|
||||
public List<Guid> VisitTaskIdList { get; set; } = new List<Guid>() { };
|
||||
}
|
||||
|
||||
public class ReadingReportAndImage
|
||||
{
|
||||
public string SubjectCode { get; set; }
|
||||
|
||||
public string VisitName { get; set; }
|
||||
|
||||
public List<string> ReportUrlList { get; set; } = new List<string>();
|
||||
|
||||
public List<string> ImageUrlList { get; set; } = new List<string>();
|
||||
}
|
||||
|
||||
|
||||
public class ExportReportQuestion
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
{
|
||||
public interface IReadingImageTaskService
|
||||
{
|
||||
Task<List<ReadingReportAndImage>> GetReadingReportAndImage(GetReadingReportAndImageInDto inDto);
|
||||
Task<IResponseOutput> SubmitVisitTaskQuestions(SubmitVisitTaskQuestionsInDto inDto);
|
||||
|
||||
Task<IResponseOutput> SubmitJudgeVisitTaskResult(SaveJudgeVisitTaskResult inDto);
|
||||
|
|
@ -42,5 +43,6 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
Task<(List<GetRelatedVisitTaskOutDto>, object)> GetRelatedVisitTask(GetRelatedVisitTaskInDto inDto);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -71,6 +71,74 @@ namespace IRaCIS.Core.Application.Service
|
|||
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer, IFusionCache _fusionCache) : BaseService, IReadingImageTaskService
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 获取阅片报告数据和图像
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<List<ReadingReportAndImage>> GetReadingReportAndImage(GetReadingReportAndImageInDto inDto)
|
||||
{
|
||||
var taskList=new List<VisitTask> { };
|
||||
|
||||
if (inDto.VisitTaskIdList.Count != 0)
|
||||
{
|
||||
if (await _visitTaskRepository.AnyAsync(x => inDto.VisitTaskIdList.Contains(x.Id) && (x.TaskState != TaskState.Effect || x.ReadingTaskState != ReadingTaskState.HaveSigned)))
|
||||
{
|
||||
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();
|
||||
}
|
||||
else
|
||||
{
|
||||
taskList = await _visitTaskRepository.Where(x => x.TrialReadingCriterionId==inDto.TrialCriterionId&&x.TaskState== TaskState.Effect && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.ReadingCategory == ReadingCategory.Visit)
|
||||
.Include(x => x.LesionList).Include(x => x.Subject).Include(x => x.SourceSubjectVisit).ToListAsync();
|
||||
}
|
||||
|
||||
List< ReadingReportAndImage > result = new List<ReadingReportAndImage>() { };
|
||||
|
||||
foreach (var item in taskList)
|
||||
{
|
||||
ReadingReportAndImage data = new ReadingReportAndImage()
|
||||
{
|
||||
SubjectCode = item.Subject != null ? item.Subject.Code : string.Empty,
|
||||
VisitName = item.SourceSubjectVisit != null ? item.SourceSubjectVisit.VisitName : string.Empty,
|
||||
ImageUrlList = item.LesionList != null ? item.LesionList.Where(x => x.PicturePath != string.Empty).Select(x => x.PicturePath).ToList() : new List<string>() { },
|
||||
ReportUrlList = new List<string>()
|
||||
{
|
||||
},
|
||||
};
|
||||
|
||||
if (item.ReportExportUrl != string.Empty)
|
||||
{
|
||||
data.ReportUrlList.Add(item.ReportExportUrl);
|
||||
}
|
||||
else
|
||||
{
|
||||
data.ReportUrlList.Add(await _readingCalculateService.GetVisitReadReportUrl(new CaGetVisitReadReportUrl()
|
||||
{
|
||||
VisitTaskId = item.Id,
|
||||
}));
|
||||
}
|
||||
|
||||
if (item.TumorEvaluationUrl != string.Empty)
|
||||
{
|
||||
data.ReportUrlList.Add(item.TumorEvaluationUrl);
|
||||
}
|
||||
else
|
||||
{
|
||||
data.ReportUrlList.Add(await _readingCalculateService.GetTumorEvaluationReportUrl(new CaGetVisitReadReportUrl()
|
||||
{
|
||||
VisitTaskId = item.Id,
|
||||
}));
|
||||
}
|
||||
|
||||
result.Add(data);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取TNMValue
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Reference in New Issue