Compare commits
2 Commits
dc16cc2018
...
e0b80b3316
| Author | SHA1 | Date |
|---|---|---|
|
|
e0b80b3316 | |
|
|
d4bbe47b81 |
|
|
@ -250,6 +250,37 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
public string TaskBlindName { get; set; }
|
||||
|
||||
public string SubjectID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 靶段
|
||||
/// </summary>
|
||||
public string TargetSegment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 靶段备注
|
||||
/// </summary>
|
||||
public string TargetSegmentRemarks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ROI段落总长度
|
||||
/// </summary>
|
||||
public string ROIAllLength { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 回撤中的图像帧数
|
||||
/// </summary>
|
||||
public string PullbackFrameCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 斑块类型
|
||||
/// </summary>
|
||||
public string PlaqueType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 访视点备注(如有)
|
||||
/// </summary>
|
||||
public string AdjustReason { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class OCTFCTUploadData
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||
using DocumentFormat.OpenXml.Spreadsheet;
|
||||
using IRaCIS.Core.Application.Interfaces;
|
||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using IRaCIS.Core.Infra.EFCore.Common;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
|
|
@ -6,6 +8,7 @@ using MassTransit;
|
|||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
{
|
||||
|
|
@ -18,6 +21,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository,
|
||||
IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository,
|
||||
IRepository<OrganInfo> _organInfoRepository,
|
||||
ISubjectVisitService iSubjectVisitService,
|
||||
IRepository<Dictionary> _dictionaryRepository,
|
||||
IRepository<ReadingGlobalTaskInfo> _readingGlobalTaskInfoRepository,
|
||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||
IRepository<TumorAssessment_IRECIST1Point1> _tumorAssessmentRepository,
|
||||
|
|
@ -414,10 +419,64 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
|
||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x=>x.Subject).FirstNotNullAsync();
|
||||
|
||||
//靶段
|
||||
var targetSegmentdic = await _dictionaryRepository.Where(x => x.Parent.Code == "TargetSegment").ToListAsync();
|
||||
|
||||
//斑块类型
|
||||
var plaqueTypedic = await _dictionaryRepository.Where(x => x.Parent.Code == "PlaqueType").ToListAsync();
|
||||
|
||||
|
||||
|
||||
|
||||
var awswerList=await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).Include(x=>x.ReadingQuestionTrial).ToListAsync();
|
||||
|
||||
|
||||
|
||||
var targetSegmentAnswer = awswerList.Where(x => x.ReadingQuestionTrial.QuestionType == QuestionType.TargetSegment).Select(x => x.Answer).FirstOrDefault() ?? string.Empty;
|
||||
if (targetSegmentAnswer.IsNotNullOrEmpty())
|
||||
{
|
||||
var data= JsonConvert.DeserializeObject<List<string>>(targetSegmentAnswer);
|
||||
targetSegmentAnswer = string.Join(",", targetSegmentdic
|
||||
.Where(x => data.Contains(x.Code))
|
||||
.Select(x => x.Value));
|
||||
}
|
||||
else
|
||||
{
|
||||
var targetSegmentData = await iSubjectVisitService.GetReadingVisitStudyList(new Contracts.GetReadingVisitStudyListIndto()
|
||||
{
|
||||
SujectVisitId = taskinfo.SourceSubjectVisitId ?? default(Guid),
|
||||
TrialId = taskinfo.TrialId,
|
||||
VisitTaskId = inDto.VisitTaskId
|
||||
});
|
||||
targetSegmentAnswer = string.Join(",", targetSegmentData
|
||||
.Where(x =>x.BodyPartForEdit.IsNotNullOrEmpty())
|
||||
.Select(x => x.BodyPartForEdit));
|
||||
}
|
||||
|
||||
|
||||
var plaqueTypeAnswer = awswerList.Where(x => x.ReadingQuestionTrial.QuestionType == QuestionType.PlaqueType).Select(x => x.Answer).FirstOrDefault() ?? string.Empty;
|
||||
if (plaqueTypeAnswer.IsNotNullOrEmpty())
|
||||
{
|
||||
var data = JsonConvert.DeserializeObject<List<string>>(plaqueTypeAnswer);
|
||||
plaqueTypeAnswer = string.Join(",", plaqueTypedic
|
||||
.Where(x => data.Contains(x.Code))
|
||||
.Select(x => x.Value));
|
||||
}
|
||||
|
||||
|
||||
var values = new TemplateData()
|
||||
{
|
||||
SubjectID = (taskinfo.BlindSubjectCode.IsNullOrEmpty() ? taskinfo.Subject.Code : taskinfo.BlindSubjectCode),
|
||||
TaskBlindName = taskinfo.TaskBlindName,
|
||||
TargetSegment= targetSegmentAnswer,
|
||||
TargetSegmentRemarks = awswerList.Where(x=>x.ReadingQuestionTrial.QuestionType == QuestionType.TargetSegmentRemarks).Select(x=>x.Answer).FirstOrDefault()??string.Empty,
|
||||
ROIAllLength = awswerList.Where(x => x.ReadingQuestionTrial.QuestionType == QuestionType.ROIAllLength).Select(x => x.Answer).FirstOrDefault() ?? string.Empty,
|
||||
PullbackFrameCount = awswerList.Where(x => x.ReadingQuestionTrial.QuestionType == QuestionType.PullbackFrameCount).Select(x => x.Answer).FirstOrDefault() ?? string.Empty,
|
||||
AdjustReason = awswerList.Where(x => x.ReadingQuestionTrial.QuestionType == QuestionType.AdjustReason).Select(x => x.Answer).FirstOrDefault() ?? string.Empty,
|
||||
PlaqueType = plaqueTypeAnswer,
|
||||
|
||||
|
||||
|
||||
};
|
||||
return await _visitTaskHelpeService.ExportTemplateAsync(new IRaCIS.Application.Contracts.ExportTemplateAsyncDto()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
using DocumentFormat.OpenXml.Drawing.Spreadsheet;
|
||||
using DocumentFormat.OpenXml.Office.SpreadSheetML.Y2023.MsForms;
|
||||
using DocumentFormat.OpenXml.Office2010.Excel;
|
||||
using IRaCIS.Core.Application.Interfaces;
|
||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
|
|
@ -12,6 +13,7 @@ using MassTransit;
|
|||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
{
|
||||
|
|
@ -24,6 +26,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository,
|
||||
IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository,
|
||||
IRepository<OrganInfo> _organInfoRepository,
|
||||
ISubjectVisitService iSubjectVisitService,
|
||||
IRepository<Dictionary> _dictionaryRepository,
|
||||
IHttpContextAccessor httpContext,
|
||||
IRepository<ReadingGlobalTaskInfo> _readingGlobalTaskInfoRepository,
|
||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||
|
|
@ -271,10 +275,65 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
public async Task<FileResult> GetOCTFCTTemplate(GetExportTemplateInDto inDto)
|
||||
{
|
||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.Subject).FirstNotNullAsync();
|
||||
|
||||
//靶段
|
||||
var targetSegmentdic = await _dictionaryRepository.Where(x => x.Parent.Code == "TargetSegment").ToListAsync();
|
||||
|
||||
//斑块类型
|
||||
var plaqueTypedic = await _dictionaryRepository.Where(x => x.Parent.Code == "PlaqueType").ToListAsync();
|
||||
|
||||
|
||||
|
||||
|
||||
var awswerList = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).Include(x => x.ReadingQuestionTrial).ToListAsync();
|
||||
|
||||
|
||||
|
||||
var targetSegmentAnswer = awswerList.Where(x => x.ReadingQuestionTrial.QuestionType == QuestionType.TargetSegment).Select(x => x.Answer).FirstOrDefault() ?? string.Empty;
|
||||
if (targetSegmentAnswer.IsNotNullOrEmpty())
|
||||
{
|
||||
var data = JsonConvert.DeserializeObject<List<string>>(targetSegmentAnswer);
|
||||
targetSegmentAnswer = string.Join(",", targetSegmentdic
|
||||
.Where(x => data.Contains(x.Code))
|
||||
.Select(x => x.Value));
|
||||
}
|
||||
else
|
||||
{
|
||||
var targetSegmentData = await iSubjectVisitService.GetReadingVisitStudyList(new Contracts.GetReadingVisitStudyListIndto()
|
||||
{
|
||||
SujectVisitId = taskinfo.SourceSubjectVisitId ?? default(Guid),
|
||||
TrialId = taskinfo.TrialId,
|
||||
VisitTaskId = inDto.VisitTaskId
|
||||
});
|
||||
targetSegmentAnswer = string.Join(",", targetSegmentData
|
||||
.Where(x => x.BodyPartForEdit.IsNotNullOrEmpty())
|
||||
.Select(x => x.BodyPartForEdit));
|
||||
}
|
||||
|
||||
|
||||
var plaqueTypeAnswer = awswerList.Where(x => x.ReadingQuestionTrial.QuestionType == QuestionType.PlaqueType).Select(x => x.Answer).FirstOrDefault() ?? string.Empty;
|
||||
if (plaqueTypeAnswer.IsNotNullOrEmpty())
|
||||
{
|
||||
var data = JsonConvert.DeserializeObject<List<string>>(plaqueTypeAnswer);
|
||||
plaqueTypeAnswer = string.Join(",", plaqueTypedic
|
||||
.Where(x => data.Contains(x.Code))
|
||||
.Select(x => x.Value));
|
||||
}
|
||||
|
||||
|
||||
var values = new TemplateData()
|
||||
{
|
||||
SubjectID = (taskinfo.BlindSubjectCode.IsNullOrEmpty() ? taskinfo.Subject.Code : taskinfo.BlindSubjectCode),
|
||||
TaskBlindName = taskinfo.TaskBlindName,
|
||||
TargetSegment = targetSegmentAnswer,
|
||||
TargetSegmentRemarks = awswerList.Where(x => x.ReadingQuestionTrial.QuestionType == QuestionType.TargetSegmentRemarks).Select(x => x.Answer).FirstOrDefault() ?? string.Empty,
|
||||
ROIAllLength = awswerList.Where(x => x.ReadingQuestionTrial.QuestionType == QuestionType.ROIAllLength).Select(x => x.Answer).FirstOrDefault() ?? string.Empty,
|
||||
//PullbackFrameCount = awswerList.Where(x => x.ReadingQuestionTrial.QuestionType == QuestionType.PullbackFrameCount).Select(x => x.Answer).FirstOrDefault() ?? string.Empty,
|
||||
AdjustReason = awswerList.Where(x => x.ReadingQuestionTrial.QuestionType == QuestionType.AdjustReason).Select(x => x.Answer).FirstOrDefault() ?? string.Empty,
|
||||
PlaqueType = plaqueTypeAnswer,
|
||||
|
||||
|
||||
|
||||
};
|
||||
return await _visitTaskHelpeService.ExportTemplateAsync(new IRaCIS.Application.Contracts.ExportTemplateAsyncDto()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3060,6 +3060,11 @@ namespace IRaCIS.Core.Domain.Share
|
|||
/// </summary>
|
||||
ROIAllLength = 1015,
|
||||
|
||||
/// <summary>
|
||||
/// 斑块类型
|
||||
/// </summary>
|
||||
PlaqueType=1018,
|
||||
|
||||
/// <summary>
|
||||
/// PAV(冠状动脉粥样硬化体积百分比)
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Reference in New Issue