Merge branch 'Test_IRC_Net8' of http://192.168.3.68:2000/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
1fcb871de2
|
@ -5,8 +5,10 @@ using IRaCIS.Core.Application.Helper;
|
|||
using IRaCIS.Core.Domain.Share;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using MiniExcelLibs;
|
||||
using MiniExcelLibs.OpenXml;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using NPOI.XSSF.UserModel;
|
||||
using System.Collections;
|
||||
using System.Globalization;
|
||||
|
@ -16,6 +18,18 @@ namespace IRaCIS.Core.Application.Service;
|
|||
public static class ExcelExportHelper
|
||||
{
|
||||
//MiniExcel_Export
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="code"></param>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="exportFileNamePrefix">文件名前缀</param>
|
||||
/// <param name="_commonDocumentRepository"></param>
|
||||
/// <param name="_hostEnvironment"></param>
|
||||
/// <param name="_dictionaryService"></param>
|
||||
/// <param name="translateType"></param>
|
||||
/// <param name="criterionType"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<IActionResult> DataExportAsync(string code, ExcelExportInfo data, string exportFileNamePrefix, IRepository<CommonDocument> _commonDocumentRepository, IWebHostEnvironment _hostEnvironment, IDictionaryService? _dictionaryService = null, Type? translateType = null, CriterionType? criterionType = null)
|
||||
{
|
||||
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
|
||||
|
@ -340,6 +354,74 @@ public static class ExcelExportHelper
|
|||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 导出文件模板
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<FileResult> ExportTemplateAsync(ExportTemplateServiceDto inDto)
|
||||
{
|
||||
var (physicalPath, fileName) = await FileStoreHelper.GetCommonDocPhysicalFilePathAsync(inDto.hostEnvironment, inDto.commonDocumentRepository, inDto.TemplateCode);
|
||||
|
||||
|
||||
//模板路径
|
||||
var tplPath = physicalPath;
|
||||
|
||||
#region 根据中英文 删除模板sheet
|
||||
|
||||
// 打开模板文件
|
||||
var templateFile = new FileStream(tplPath, FileMode.Open, FileAccess.Read);
|
||||
|
||||
// 获取文件流
|
||||
var templateStream = new MemoryStream();
|
||||
templateFile.CopyTo(templateStream);
|
||||
templateStream.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
var workbook = new XSSFWorkbook(templateStream);
|
||||
|
||||
int sheetCount = workbook.NumberOfSheets;
|
||||
|
||||
if (sheetCount == 2)
|
||||
{
|
||||
if (inDto.IsEnglish)
|
||||
{
|
||||
workbook.RemoveSheetAt(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
workbook.RemoveSheetAt(1);
|
||||
}
|
||||
|
||||
var memoryStream2 = new MemoryStream();
|
||||
workbook.Write(memoryStream2, true);
|
||||
|
||||
memoryStream2.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
templateStream = memoryStream2;
|
||||
}
|
||||
|
||||
// 文件名称 从sheet里面取
|
||||
//fileNmae = workbook.GetSheetName(0);
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
var memoryStream = new MemoryStream();
|
||||
|
||||
var config = new OpenXmlConfiguration()
|
||||
{
|
||||
IgnoreTemplateParameterMissing = true,
|
||||
};
|
||||
|
||||
await MiniExcel.SaveAsByTemplateAsync(memoryStream, templateStream.ToArray(), inDto.Data, config);
|
||||
|
||||
memoryStream.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
|
||||
return new FileStreamResult(memoryStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
|
||||
{
|
||||
FileDownloadName = $"{(string.IsNullOrEmpty(inDto.ExportFileName) ? "" : inDto.ExportFileName + "_")}{Path.GetFileNameWithoutExtension(fileName)}_{DateTime.Now.ToString("yyyyMMddHHmmss")}.xlsx"
|
||||
};
|
||||
}
|
||||
|
||||
}
|
|
@ -43,6 +43,34 @@
|
|||
<param name="next"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ExcelExportHelper.DataExportAsync(System.String,IRaCIS.Application.Contracts.ExcelExportInfo,System.String,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CommonDocument},Microsoft.AspNetCore.Hosting.IWebHostEnvironment,IRaCIS.Application.Interfaces.IDictionaryService,System.Type,System.Nullable{IRaCIS.Core.Domain.Share.CriterionType})">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
<param name="code"></param>
|
||||
<param name="data"></param>
|
||||
<param name="exportFileNamePrefix">文件名前缀</param>
|
||||
<param name="_commonDocumentRepository"></param>
|
||||
<param name="_hostEnvironment"></param>
|
||||
<param name="_dictionaryService"></param>
|
||||
<param name="translateType"></param>
|
||||
<param name="criterionType"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ExcelExportHelper.ExportTemplateAsync(IRaCIS.Application.Contracts.ExportTemplateServiceDto)">
|
||||
<summary>
|
||||
导出文件模板
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.IVisitTaskHelpeService.ExportTemplateAsync(IRaCIS.Application.Contracts.ExportTemplateAsyncDto)">
|
||||
<summary>
|
||||
导出
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Service.TaskAllocationRuleService">
|
||||
<summary>
|
||||
分配规则
|
||||
|
@ -245,11 +273,18 @@
|
|||
访视读片任务
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.VisitTaskHelpeService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingJudgeInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModule},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingOncologyTaskInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ClinicalDataTrialSet},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingClinicalData},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingConsistentClinicalData})">
|
||||
<member name="M:IRaCIS.Core.Application.Service.VisitTaskHelpeService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingJudgeInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModule},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CommonDocument},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingOncologyTaskInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ClinicalDataTrialSet},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingClinicalData},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingConsistentClinicalData})">
|
||||
<summary>
|
||||
访视读片任务
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.VisitTaskHelpeService.ExportTemplateAsync(IRaCIS.Application.Contracts.ExportTemplateAsyncDto)">
|
||||
<summary>
|
||||
导出文件模板
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.VisitTaskHelpeService.AddConvertedTask(System.Guid)">
|
||||
<summary>
|
||||
添加转变任务
|
||||
|
@ -2721,6 +2756,19 @@
|
|||
<param name="calculateType"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.IVUSCalculateService.GetIVUSTemplate(IRaCIS.Core.Application.Service.Reading.Dto.GetExportTemplateInDto)">
|
||||
<summary>
|
||||
获取IVUS模板
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.IVUSCalculateService.CalculatePatchDataStatisticsAndPVA(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<summary>
|
||||
计算斑块数据统计和PVA数据
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.IVUSCalculateService.VerifyVisitTaskQuestions(IRaCIS.Core.Application.Service.Reading.Dto.VerifyVisitTaskQuestionsInDto)">
|
||||
<summary>
|
||||
验证访视提交
|
||||
|
@ -2728,40 +2776,23 @@
|
|||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.IVUSCalculateService.GetEEM(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.IVUSCalculateService.GetPlaque1PVA(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<summary>
|
||||
计算NTAV的EEM
|
||||
获取斑块1-PAV
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.IVUSCalculateService.GetEEMLumenSum(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.IVUSCalculateService.GetPlaque2PVA(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<summary>
|
||||
获取(EEM-Lumen)求和
|
||||
获取斑块2-PAV
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.IVUSCalculateService.GetNTAVEEMLumenSumOrRetraceImageCount(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.IVUSCalculateService.GetPlaque3PVA(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<summary>
|
||||
计算NTAV的(EEM-Lumen)求和/回撤中的图像数
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.IVUSCalculateService.GetPAV(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<summary>
|
||||
冠状动脉粥样硬化体积百分比(PAV)
|
||||
</summary>
|
||||
<remarks>
|
||||
(EEM-Lumen)求和/EEM求和✖️100,单位%
|
||||
</remarks>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.IVUSCalculateService.GetNTAV(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<summary>
|
||||
总动脉粥样硬化体积(NTAV)
|
||||
获取斑块3-PAV
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
|
@ -16289,6 +16320,26 @@
|
|||
读片数量分类统计
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Application.Contracts.ExportTemplateAsyncDto">
|
||||
<summary>
|
||||
导出文件
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Application.Contracts.ExportTemplateAsyncDto.TemplateCode">
|
||||
<summary>
|
||||
模板Code
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Application.Contracts.ExportTemplateAsyncDto.ExportFileName">
|
||||
<summary>
|
||||
导出的文件名
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Application.Contracts.ExportTemplateAsyncDto.Data">
|
||||
<summary>
|
||||
数据
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Application.Contracts.WorkLoadDetailDTO">
|
||||
<summary>
|
||||
后台 工作量审核视图模型
|
||||
|
|
|
@ -5,7 +5,9 @@
|
|||
//--------------------------------------------------------------------
|
||||
|
||||
|
||||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
|
@ -18,6 +20,13 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
Task AddConvertedTask(Guid taskId);
|
||||
|
||||
/// <summary>
|
||||
/// 导出
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
Task<FileResult> ExportTemplateAsync(ExportTemplateAsyncDto inDto);
|
||||
|
||||
Task BaseCritrionGenerateVisitTask(Guid trialId, Guid confirmedTrialReadingCriterionId, bool? isManualSelectVisit = null, List<Guid>? subjectVisitIdList = null);
|
||||
}
|
||||
}
|
|
@ -4,6 +4,7 @@
|
|||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
|
@ -28,7 +29,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
IRepository<ReadingJudgeInfo> _readingJudgeInfoRepository,
|
||||
IRepository<SubjectUser> _subjectUserRepository,
|
||||
IRepository<ReadModule> _readModuleRepository,
|
||||
|
||||
IRepository<CommonDocument> _commonDocumentRepository,
|
||||
IRepository<ReadingOncologyTaskInfo> _readingOncologyTaskInfoRepository,
|
||||
|
||||
IRepository<ReadingQuestionCriterionTrial> _trialReadingCriterionRepository,
|
||||
|
@ -39,6 +40,26 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 导出文件模板
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
public async Task<FileResult> ExportTemplateAsync(ExportTemplateAsyncDto inDto)
|
||||
{
|
||||
return await ExcelExportHelper.ExportTemplateAsync(new ExportTemplateServiceDto()
|
||||
{
|
||||
Data=inDto.Data,
|
||||
commonDocumentRepository= _commonDocumentRepository,
|
||||
TemplateCode=inDto.TemplateCode,
|
||||
ExportFileName=inDto.ExportFileName,
|
||||
hostEnvironment=_hostEnvironment,
|
||||
IsEnglish=_userInfo.IsEn_Us,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//查询列表的时候,一致性核查通过未产生任务的 自动产生任务 如果是一致性核查,那么还会自动分配
|
||||
public async Task GenerateVisitTaskAsync(Guid trialId, List<Guid> subjectVisitIdList, bool isAssignSubjectToDoctor = false)
|
||||
{
|
||||
|
|
|
@ -196,6 +196,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
public List<int> NotEq { get; set; } = new List<int>();
|
||||
}
|
||||
|
||||
|
||||
public class GetExportTemplateInDto
|
||||
{
|
||||
public Guid VisitTaskId { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 阅片计算Dto
|
||||
/// </summary>
|
||||
|
|
|
@ -784,7 +784,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
var groupIds = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == trialReadingCriterionId&& x.Type == ReadingQestionType.Table || x.Type == ReadingQestionType.BasicTable).Select(x => x.GroupId).Distinct().ToListAsync();
|
||||
|
||||
var questionIds = await _readingQuestionTrialRepository
|
||||
.WhereIf(!criterionIdInfo.IseCRFShowInDicomReading, x => x.IsShowInDicom)
|
||||
.Where(x => x.IsShowInDicom)
|
||||
.Where(x => groupIds.Contains(x.GroupId)).Select(x => x.Id).ToListAsync();
|
||||
|
||||
|
||||
|
@ -792,8 +792,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
var questions = await _readingQuestionTrialRepository
|
||||
.Where(x=> !questionIds.Contains(x.Id))
|
||||
.WhereIf(questionClassify != null, x => x.QuestionClassify == questionClassify)
|
||||
.WhereIf(criterionIdInfo.IseCRFShowInDicomReading, x => x.ReadingQuestionCriterionTrialId == trialReadingCriterionId && x.Type != ReadingQestionType.Table && x.Type != ReadingQestionType.BasicTable)
|
||||
.WhereIf(!criterionIdInfo.IseCRFShowInDicomReading, x => x.IsShowInDicom && x.ReadingQuestionCriterionTrialId == trialReadingCriterionId && x.Type != ReadingQestionType.Table && x.Type != ReadingQestionType.BasicTable)
|
||||
|
||||
.Where( x => x.IsShowInDicom && x.ReadingQuestionCriterionTrialId == trialReadingCriterionId && x.Type != ReadingQestionType.Table && x.Type != ReadingQestionType.BasicTable)
|
||||
|
||||
.ProjectTo<DicomReadingQuestionAnswer>(_mapper.ConfigurationProvider, new
|
||||
{
|
||||
|
@ -1083,6 +1083,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).FirstNotNullAsync();
|
||||
|
||||
var qusetionList = await _readingQuestionTrialRepository
|
||||
.Where(x=>x.IsShowInDicom)
|
||||
.WhereIf(inDto.QuestionClassify != null, x => x.QuestionClassify == inDto.QuestionClassify)
|
||||
.Where(x => x.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId).ProjectTo<TrialReadQuestionData>(_mapper.ConfigurationProvider, new
|
||||
{
|
||||
|
@ -1126,23 +1127,17 @@ namespace IRaCIS.Core.Application.Service
|
|||
// 是否获取所有问题
|
||||
if (inDto.IsGetallQuestion)
|
||||
{
|
||||
if (!criterionInfo.IseCRFShowInDicomReading)
|
||||
{
|
||||
qusetionList = qusetionList.Where(x => x.IsShowInDicom).OrderBy(x => x.ShowOrder).ToList();
|
||||
}
|
||||
qusetionList = qusetionList.Where(x => x.IsShowInDicom).OrderBy(x => x.ShowOrder).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!criterionInfo.IseCRFShowInDicomReading)
|
||||
{
|
||||
List<string> types = new List<string>()
|
||||
List<string> types = new List<string>()
|
||||
{
|
||||
ReadingQestionType.Table,
|
||||
ReadingQestionType.BasicTable,
|
||||
ReadingQestionType.Group,
|
||||
};
|
||||
qusetionList = qusetionList.Where(x => x.IsShowInDicom && types.Contains(x.Type)).OrderBy(x => x.ShowOrder).ToList();
|
||||
}
|
||||
qusetionList = qusetionList.Where(x => x.IsShowInDicom && types.Contains(x.Type)).OrderBy(x => x.ShowOrder).ToList();
|
||||
|
||||
|
||||
if (inDto.TaskId != null)
|
||||
|
@ -1164,10 +1159,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
break;
|
||||
|
||||
case ReadingTool.NoDicom:
|
||||
if (!criterionInfo.IseCRFShowInDicomReading)
|
||||
{
|
||||
qusetionList = qusetionList.Where(x => x.IsShowInDicom).OrderBy(x => x.ShowOrder).ToList();
|
||||
}
|
||||
qusetionList = qusetionList.Where(x => x.IsShowInDicom).OrderBy(x => x.ShowOrder).ToList();
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,8 +2,10 @@
|
|||
using IRaCIS.Core.Application.ViewModel;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infra.EFCore.Common;
|
||||
using MassTransit;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
{
|
||||
|
@ -22,6 +24,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
IRepository<TumorAssessment_IRECIST1Point1> _tumorAssessmentRepository,
|
||||
IGeneralCalculateService _generalCalculateService,
|
||||
IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswerRepository,
|
||||
IVisitTaskHelpeService _visitTaskHelpeService,
|
||||
ILogger<IRECIST1Point1CalculateService> _logger) : BaseService, ICriterionCalculateService
|
||||
{
|
||||
|
||||
|
@ -82,7 +85,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
|
||||
//public async Task<FileResult> GetMeasuredValueTemplate(GetMeasuredValueTemplateInDto inDto)
|
||||
//{
|
||||
|
||||
|
||||
//}
|
||||
|
||||
#region 获取阅片报告
|
||||
|
@ -449,23 +452,20 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
#region 计算 这里顺序非常重要 后面计算的值要依赖前面计算的结果
|
||||
var needAddList = new List<ReadingTaskQuestionAnswer>();
|
||||
|
||||
// 计算斑块数据统计和PVA数据
|
||||
await this.CalculatePatchDataStatisticsAndPVA(inDto);
|
||||
|
||||
List<ReadingCalculateData> calculateList = new List<ReadingCalculateData>()
|
||||
{
|
||||
// EEM求和
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.EEMSum,GetDecimalNullFun=GetEEM},
|
||||
// 斑块1-PAV
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.Plaque1PVA,GetDecimalNullFun=GetPlaque1PVA},
|
||||
|
||||
// (EEM-Lumen)求和
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.EEMLumenSum,GetDecimalNullFun=GetEEMLumenSum},
|
||||
// 斑块2-PAV
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.Plaque2PVA,GetDecimalNullFun=GetPlaque2PVA},
|
||||
|
||||
// 计算NTAV的(EEM-Lumen)求和/回撤中的图像数
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.NTAVEEMLumenSumOrRetraceImageCount,GetDecimalNullFun=GetNTAVEEMLumenSumOrRetraceImageCount},
|
||||
// 斑块3-PAV
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.Plaque3PVA,GetDecimalNullFun=GetPlaque3PVA},
|
||||
|
||||
// 冠状动脉粥样硬化体积百分比(PAV)
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.PAV,GetDecimalNullFun=GetPAV},
|
||||
|
||||
// 总动脉粥样硬化体积(NTAV)
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.NTAV,GetDecimalNullFun=GetNTAV},
|
||||
|
||||
|
||||
|
||||
|
@ -561,9 +561,201 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取IVUS模板
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<FileResult> GetIVUSTemplate(GetExportTemplateInDto inDto)
|
||||
{
|
||||
|
||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
|
||||
|
||||
var values = new
|
||||
{
|
||||
SubjectID = taskinfo.BlindSubjectCode,
|
||||
TaskBlindName = taskinfo.TaskBlindName,
|
||||
};
|
||||
return await _visitTaskHelpeService.ExportTemplateAsync(new IRaCIS.Application.Contracts.ExportTemplateAsyncDto()
|
||||
{
|
||||
ExportFileName= "IVUS_Template",
|
||||
TemplateCode= StaticData.Export.IVUSTheMeasuredValueOfEachMatchedFragment,
|
||||
Data= values
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 计算斑块数据统计和PVA数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task CalculatePatchDataStatisticsAndPVA(ReadingCalculateDto inDto)
|
||||
{
|
||||
// 斑块的表格问题Id
|
||||
var questionInfo = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.PatchDataStatistics).FirstOrDefault();
|
||||
|
||||
// pAV 问题信息
|
||||
var pAVquestionInfo = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.PAV).FirstOrDefault();
|
||||
|
||||
|
||||
// 测量值集合
|
||||
var matchValuesAnswerList = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.MatchValues).SelectMany(x => x.TableRowInfoList).ToList();
|
||||
|
||||
// 获取编号
|
||||
var nums = matchValuesAnswerList.SelectMany(x => x.TableQuestionList).Where(x => x.QuestionMark == QuestionMark.PlaqueNumber).Select(x => int.Parse(x.Answer)).Distinct().OrderBy(x => x).ToList();
|
||||
|
||||
List<ReadingTableAnswerRowInfo> tableAnsweRowInfos = new List<ReadingTableAnswerRowInfo>();
|
||||
List<ReadingTableQuestionAnswer> tableAnswers = new List<ReadingTableQuestionAnswer>();
|
||||
|
||||
foreach (var item in nums)
|
||||
{
|
||||
var newRowId = NewId.NextGuid();
|
||||
|
||||
var thisnumTableRows = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.MatchValues).SelectMany(x => x.TableRowInfoList).Where(x => x.TableQuestionList.Any(y => y.QuestionMark == QuestionMark.PlaqueNumber && y.Answer == item.ToString())).ToList();
|
||||
|
||||
// 斑块数据统计
|
||||
tableAnsweRowInfos.Add(new ReadingTableAnswerRowInfo()
|
||||
{
|
||||
Id = newRowId,
|
||||
QuestionId = questionInfo!.QuestionId,
|
||||
VisitTaskId = inDto.VisitTaskId,
|
||||
TrialId = inDto.TrialId,
|
||||
RowIndex = item,
|
||||
IsCurrentTaskAdd = true,
|
||||
BlindName = inDto.BlindName,
|
||||
OrderMark = questionInfo.OrderMark,
|
||||
FristAddTaskNum = inDto.VisitTaskNum,
|
||||
FristAddTaskId = inDto.VisitTaskId,
|
||||
RowMark = questionInfo.OrderMark + decimal.Parse(item.ToString()).GetLesionMark()
|
||||
});
|
||||
|
||||
// 斑块
|
||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||
{
|
||||
Answer = item.ToString(),
|
||||
Id = NewId.NextGuid(),
|
||||
QuestionId = questionInfo!.QuestionId,
|
||||
TrialId = inDto.TrialId,
|
||||
VisitTaskId = inDto.VisitTaskId,
|
||||
RowId = newRowId,
|
||||
RowIndex = item,
|
||||
TableQuestionId = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == questionInfo.QuestionId && x.QuestionMark == QuestionMark.PlaqueNumber).Select(x => x.Id).FirstOrDefaultAsync(),
|
||||
});
|
||||
|
||||
|
||||
|
||||
#region 数据计算
|
||||
var emm = thisnumTableRows.SelectMany(x => x.TableQuestionList)
|
||||
.Where(x => x.QuestionMark == QuestionMark.ElasticArea).Select(x => x.Answer.IsNullOrEmptyReturn0()).Sum().ToString();
|
||||
|
||||
var EEMLumen = thisnumTableRows.SelectMany(x => x.TableQuestionList)
|
||||
.Where(x => x.QuestionMark == QuestionMark.ElasticAreaDiffValue).Select(x => x.Answer.IsNullOrEmptyReturn0()).Sum().ToString();
|
||||
|
||||
var pav = "";
|
||||
|
||||
if (emm != null && EEMLumen != null)
|
||||
{
|
||||
var emmNum = decimal.Round(decimal.Parse(emm ?? "0"));
|
||||
var EEMLumenNum = decimal.Round(decimal.Parse(EEMLumen ?? "0"));
|
||||
if (emmNum != 0)
|
||||
{
|
||||
pav = (EEMLumenNum * 100 / emmNum).ToString();
|
||||
}
|
||||
}
|
||||
|
||||
if (inDto.DigitPlaces != -1)
|
||||
{
|
||||
emm = decimal.Round(decimal.Parse(emm ?? "0"), inDto.DigitPlaces).ToString("F" + inDto.DigitPlaces.ToString());
|
||||
EEMLumen = decimal.Round(decimal.Parse(EEMLumen ?? "0"), inDto.DigitPlaces).ToString("F" + inDto.DigitPlaces.ToString());
|
||||
pav = decimal.Round(decimal.Parse(pav ?? "0"), inDto.DigitPlaces).ToString("F" + inDto.DigitPlaces.ToString());
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 冠状动脉粥样硬化体积百分比(PAV)
|
||||
|
||||
var newPAVRowId = NewId.NextGuid();
|
||||
// 斑块数据统计
|
||||
tableAnsweRowInfos.Add(new ReadingTableAnswerRowInfo()
|
||||
{
|
||||
Id = newPAVRowId,
|
||||
QuestionId = pAVquestionInfo!.QuestionId,
|
||||
VisitTaskId = inDto.VisitTaskId,
|
||||
TrialId = inDto.TrialId,
|
||||
RowIndex = item,
|
||||
IsCurrentTaskAdd = true,
|
||||
BlindName = inDto.BlindName,
|
||||
OrderMark = pAVquestionInfo.OrderMark,
|
||||
FristAddTaskNum = inDto.VisitTaskNum,
|
||||
FristAddTaskId = inDto.VisitTaskId,
|
||||
RowMark = pAVquestionInfo.OrderMark + decimal.Parse(item.ToString()).GetLesionMark()
|
||||
});
|
||||
|
||||
// 斑块
|
||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||
{
|
||||
Answer = item.ToString(),
|
||||
Id = NewId.NextGuid(),
|
||||
QuestionId = pAVquestionInfo!.QuestionId,
|
||||
TrialId = inDto.TrialId,
|
||||
VisitTaskId = inDto.VisitTaskId,
|
||||
RowId = newPAVRowId,
|
||||
RowIndex = item,
|
||||
TableQuestionId = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == pAVquestionInfo.QuestionId && x.QuestionMark == QuestionMark.PlaqueNumber).Select(x => x.Id).FirstOrDefaultAsync(),
|
||||
});
|
||||
|
||||
|
||||
|
||||
// PAV
|
||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||
{
|
||||
Answer = pav,
|
||||
Id = NewId.NextGuid(),
|
||||
QuestionId = pAVquestionInfo!.QuestionId,
|
||||
TrialId = inDto.TrialId,
|
||||
VisitTaskId = inDto.VisitTaskId,
|
||||
RowId = newPAVRowId,
|
||||
RowIndex = item,
|
||||
TableQuestionId = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == pAVquestionInfo.QuestionId && x.QuestionMark == QuestionMark.PAV).Select(x => x.Id).FirstOrDefaultAsync(),
|
||||
});
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
// EMM 求和
|
||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||
{
|
||||
Answer = emm,
|
||||
QuestionId = questionInfo!.QuestionId,
|
||||
TrialId = inDto.TrialId,
|
||||
VisitTaskId = inDto.VisitTaskId,
|
||||
RowId = newRowId,
|
||||
RowIndex = item,
|
||||
TableQuestionId = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == questionInfo.QuestionId && x.QuestionMark == QuestionMark.EEMSum).Select(x => x.Id).FirstOrDefaultAsync(),
|
||||
});
|
||||
|
||||
// (EEM-Lumen)求和
|
||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||
{
|
||||
Answer = EEMLumen,
|
||||
Id = NewId.NextGuid(),
|
||||
QuestionId = questionInfo!.QuestionId,
|
||||
TrialId = inDto.TrialId,
|
||||
VisitTaskId = inDto.VisitTaskId,
|
||||
RowId = newRowId,
|
||||
RowIndex = item,
|
||||
TableQuestionId = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == questionInfo.QuestionId && x.QuestionMark == QuestionMark.EEMSubtractLumenSum).Select(x => x.Id).FirstOrDefaultAsync(),
|
||||
});
|
||||
}
|
||||
|
||||
await _readingTableAnswerRowInfoRepository.BatchDeleteNoTrackingAsync(x => (x.QuestionId == questionInfo.QuestionId || x.QuestionId == pAVquestionInfo.QuestionId) && x.VisitTaskId == inDto.VisitTaskId);
|
||||
await _readingTableQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => (x.QuestionId == questionInfo.QuestionId || x.QuestionId == pAVquestionInfo.QuestionId) && x.VisitTaskId == inDto.VisitTaskId);
|
||||
await _readingTableAnswerRowInfoRepository.AddRangeAsync(tableAnsweRowInfos);
|
||||
await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers);
|
||||
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 验证访视提交
|
||||
|
@ -576,98 +768,132 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// 计算NTAV的EEM
|
||||
/// 获取斑块1-PAV
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<decimal?> GetEEM(ReadingCalculateDto inDto)
|
||||
public async Task<decimal?> GetPlaque1PVA(ReadingCalculateDto inDto)
|
||||
{
|
||||
if (inDto.QuestionInfo.Where(x => x.LesionType == LesionType.MatchValues).SelectMany(x => x.TableRowInfoList).Count() == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return inDto.QuestionInfo.Where(x => x.LesionType == LesionType.MatchValues).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
||||
.Where(x => x.QuestionMark == QuestionMark.ElasticArea).Select(x => x.Answer.IsNullOrEmptyReturn0()).Sum();
|
||||
|
||||
return inDto.QuestionInfo.Where(x => x.LesionType == LesionType.PAV).SelectMany(x => x.TableRowInfoList).Where(x=>x.TableQuestionList.Any(y=>y.QuestionMark==QuestionMark.PlaqueNumber&&y.Answer.IsNullOrEmptyReturn0()==1)).SelectMany(x => x.TableQuestionList)
|
||||
.Where(x => x.QuestionMark == QuestionMark.PAV).Select(x=>x.Answer).FirstIsNullReturnEmpty().IsNullOrEmptyReturn0();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取(EEM-Lumen)求和
|
||||
/// 获取斑块2-PAV
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<decimal?> GetEEMLumenSum(ReadingCalculateDto inDto)
|
||||
public async Task<decimal?> GetPlaque2PVA(ReadingCalculateDto inDto)
|
||||
{
|
||||
if (inDto.QuestionInfo.Where(x => x.LesionType == LesionType.MatchValues).SelectMany(x => x.TableRowInfoList).Count() == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return inDto.QuestionInfo.Where(x => x.LesionType == LesionType.MatchValues).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
||||
.Where(x => x.QuestionMark == QuestionMark.ElasticAreaDiffValue).Select(x => x.Answer.IsNullOrEmptyReturn0()).Sum();
|
||||
|
||||
return inDto.QuestionInfo.Where(x => x.LesionType == LesionType.PAV).SelectMany(x => x.TableRowInfoList).Where(x => x.TableQuestionList.Any(y => y.QuestionMark == QuestionMark.PlaqueNumber && y.Answer.IsNullOrEmptyReturn0() == 2)).SelectMany(x => x.TableQuestionList)
|
||||
.Where(x => x.QuestionMark == QuestionMark.PAV).Select(x => x.Answer).FirstIsNullReturnEmpty().IsNullOrEmptyReturn0();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 计算NTAV的(EEM-Lumen)求和/回撤中的图像数
|
||||
/// 获取斑块3-PAV
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<decimal?> GetNTAVEEMLumenSumOrRetraceImageCount(ReadingCalculateDto inDto)
|
||||
public async Task<decimal?> GetPlaque3PVA(ReadingCalculateDto inDto)
|
||||
{
|
||||
var eEMLumenSum = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.EEMLumenSum).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
|
||||
var retracedFramesNumber = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.RetracedFramesNumber).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
|
||||
|
||||
if (eEMLumenSum == 0 || retracedFramesNumber == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return eEMLumenSum / retracedFramesNumber;
|
||||
|
||||
return inDto.QuestionInfo.Where(x => x.LesionType == LesionType.PAV).SelectMany(x => x.TableRowInfoList).Where(x => x.TableQuestionList.Any(y => y.QuestionMark == QuestionMark.PlaqueNumber && y.Answer.IsNullOrEmptyReturn0() == 3)).SelectMany(x => x.TableQuestionList)
|
||||
.Where(x => x.QuestionMark == QuestionMark.PAV).Select(x => x.Answer).FirstIsNullReturnEmpty().IsNullOrEmptyReturn0();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 冠状动脉粥样硬化体积百分比(PAV)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// (EEM-Lumen)求和/EEM求和✖️100,单位%
|
||||
/// </remarks>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<decimal?> GetPAV(ReadingCalculateDto inDto)
|
||||
{
|
||||
var eEMLumenSum = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.EEMLumenSum).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
|
||||
var eEMSum = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.EEMSum).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
|
||||
///// <summary>
|
||||
///// 计算NTAV的EEM
|
||||
///// </summary>
|
||||
///// <param name="inDto"></param>
|
||||
///// <returns></returns>
|
||||
//public async Task<decimal?> GetEEM(ReadingCalculateDto inDto)
|
||||
//{
|
||||
// if (inDto.QuestionInfo.Where(x => x.LesionType == LesionType.MatchValues).SelectMany(x => x.TableRowInfoList).Count() == 0)
|
||||
// {
|
||||
// return null;
|
||||
// }
|
||||
// return inDto.QuestionInfo.Where(x => x.LesionType == LesionType.MatchValues).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
||||
// .Where(x => x.QuestionMark == QuestionMark.ElasticArea).Select(x => x.Answer.IsNullOrEmptyReturn0()).Sum();
|
||||
|
||||
if (eEMSum == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
return eEMLumenSum / eEMSum * 100;
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// 总动脉粥样硬化体积(NTAV)
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<decimal?> GetNTAV(ReadingCalculateDto inDto)
|
||||
{
|
||||
var result = await GetNTAVEEMLumenSumOrRetraceImageCount(inDto);
|
||||
///// <summary>
|
||||
///// 获取(EEM-Lumen)求和
|
||||
///// </summary>
|
||||
///// <param name="inDto"></param>
|
||||
///// <returns></returns>
|
||||
//public async Task<decimal?> GetEEMLumenSum(ReadingCalculateDto inDto)
|
||||
//{
|
||||
// if (inDto.QuestionInfo.Where(x => x.LesionType == LesionType.MatchValues).SelectMany(x => x.TableRowInfoList).Count() == 0)
|
||||
// {
|
||||
// return null;
|
||||
// }
|
||||
// return inDto.QuestionInfo.Where(x => x.LesionType == LesionType.MatchValues).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
||||
// .Where(x => x.QuestionMark == QuestionMark.ElasticAreaDiffValue).Select(x => x.Answer.IsNullOrEmptyReturn0()).Sum();
|
||||
|
||||
var medianFrame = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.MedianFrame).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
|
||||
if (result == null || medianFrame == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
return result.Value * medianFrame;
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// 计算NTAV的(EEM-Lumen)求和/回撤中的图像数
|
||||
///// </summary>
|
||||
///// <param name="inDto"></param>
|
||||
///// <returns></returns>
|
||||
//public async Task<decimal?> GetNTAVEEMLumenSumOrRetraceImageCount(ReadingCalculateDto inDto)
|
||||
//{
|
||||
// var eEMLumenSum = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.EEMLumenSum).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
|
||||
// var retracedFramesNumber = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.RetracedFramesNumber).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
|
||||
|
||||
// if (eEMLumenSum == 0 || retracedFramesNumber == 0)
|
||||
// {
|
||||
// return null;
|
||||
// }
|
||||
// return eEMLumenSum / retracedFramesNumber;
|
||||
|
||||
//}
|
||||
|
||||
|
||||
///// <summary>
|
||||
///// 冠状动脉粥样硬化体积百分比(PAV)
|
||||
///// </summary>
|
||||
///// <remarks>
|
||||
///// (EEM-Lumen)求和/EEM求和✖️100,单位%
|
||||
///// </remarks>
|
||||
///// <param name="inDto"></param>
|
||||
///// <returns></returns>
|
||||
//public async Task<decimal?> GetPAV(ReadingCalculateDto inDto)
|
||||
//{
|
||||
// var eEMLumenSum = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.EEMLumenSum).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
|
||||
// var eEMSum = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.EEMSum).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
|
||||
|
||||
// if (eEMSum == 0)
|
||||
// {
|
||||
// return null;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return eEMLumenSum / eEMSum * 100;
|
||||
// }
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// 总动脉粥样硬化体积(NTAV)
|
||||
///// </summary>
|
||||
///// <param name="inDto"></param>
|
||||
///// <returns></returns>
|
||||
//public async Task<decimal?> GetNTAV(ReadingCalculateDto inDto)
|
||||
//{
|
||||
// var result = await GetNTAVEEMLumenSumOrRetraceImageCount(inDto);
|
||||
|
||||
// var medianFrame = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.MedianFrame).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
|
||||
// if (result == null || medianFrame == 0)
|
||||
// {
|
||||
// return null;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return result.Value * medianFrame;
|
||||
// }
|
||||
//}
|
||||
|
||||
#region 将上一次的访视病灶添加到这一次
|
||||
|
||||
|
|
|
@ -449,17 +449,17 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
|
||||
List<ReadingCalculateData> calculateList = new List<ReadingCalculateData>()
|
||||
{
|
||||
// 匹配动脉段最小FCT
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.MinFCT,GetDecimalNullFun=GetAllMinFCT},
|
||||
//// 匹配动脉段最小FCT
|
||||
//new ReadingCalculateData (){QuestionType=QuestionType.MinFCT,GetDecimalNullFun=GetAllMinFCT},
|
||||
|
||||
// 平均最小FCT
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.AverageMinFCT,GetDecimalNullFun=GetAvgMinFCT},
|
||||
// // 平均最小FCT
|
||||
// new ReadingCalculateData (){QuestionType=QuestionType.AverageMinFCT,GetDecimalNullFun=GetAvgMinFCT},
|
||||
|
||||
// 脂质角度平均值
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.AvgLipidAngle,GetDecimalNullFun=GetAvgMinLipidAngle},
|
||||
// // 脂质角度平均值
|
||||
// new ReadingCalculateData (){QuestionType=QuestionType.AvgLipidAngle,GetDecimalNullFun=GetAvgMinLipidAngle},
|
||||
|
||||
// 脂质角度最大值
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.MaxLipidAngle,GetDecimalNullFun=GetAllMaxLipidAngle},
|
||||
// // 脂质角度最大值
|
||||
// new ReadingCalculateData (){QuestionType=QuestionType.MaxLipidAngle,GetDecimalNullFun=GetAllMaxLipidAngle},
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using MiniExcelLibs.Attributes;
|
||||
using Newtonsoft.Json;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
@ -125,6 +126,40 @@ namespace IRaCIS.Application.Contracts
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 导出文件
|
||||
/// </summary>
|
||||
public class ExportTemplateAsyncDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 模板Code
|
||||
/// </summary>
|
||||
public string TemplateCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导出的文件名
|
||||
/// </summary>
|
||||
public string ExportFileName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据
|
||||
/// </summary>
|
||||
public object Data { get; set; }
|
||||
}
|
||||
|
||||
public class ExportTemplateServiceDto : ExportTemplateAsyncDto
|
||||
{
|
||||
public IRepository<CommonDocument> commonDocumentRepository { get; set; }
|
||||
|
||||
public IWebHostEnvironment hostEnvironment { get; set; }
|
||||
|
||||
public bool IsEnglish { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class ExcelExportInfo : TrialSelectDTO
|
||||
{
|
||||
public string CurrentTime { get; set; }
|
||||
|
|
|
@ -1777,19 +1777,29 @@ public enum SUVChangeVSBaseline
|
|||
TriggeringIRECSIT = 8,
|
||||
|
||||
/// <summary>
|
||||
/// FCT
|
||||
/// 斑块数据统计
|
||||
/// </summary>
|
||||
FCT = 101,
|
||||
PatchDataStatistics = 101,
|
||||
|
||||
/// <summary>
|
||||
/// 各匹配片段测量值
|
||||
/// </summary>
|
||||
MatchValues = 102,
|
||||
|
||||
/// <summary>
|
||||
/// 冠状动脉粥样硬化体积百分比(PAV)
|
||||
/// </summary>
|
||||
PAV = 103,
|
||||
|
||||
/// <summary>
|
||||
/// 脂质角度
|
||||
/// </summary>
|
||||
LipidAngle = 103,
|
||||
LipidAngle =111,
|
||||
|
||||
/// <summary>
|
||||
/// FCT
|
||||
/// </summary>
|
||||
FCT = 112,
|
||||
|
||||
}
|
||||
|
||||
|
@ -2066,6 +2076,26 @@ public enum SUVChangeVSBaseline
|
|||
/// </summary>
|
||||
ElasticAreaDiffValue = 1003,
|
||||
|
||||
/// <summary>
|
||||
/// 斑块编号
|
||||
/// </summary>
|
||||
PlaqueNumber = 1004,
|
||||
|
||||
/// <summary>
|
||||
/// EEM求和
|
||||
/// </summary>
|
||||
EEMSum = 1005,
|
||||
|
||||
/// <summary>
|
||||
/// (EEM-Lumen)求和
|
||||
/// </summary>
|
||||
EEMSubtractLumenSum = 1006,
|
||||
|
||||
/// <summary>
|
||||
/// 冠状动脉粥样硬化体积百分比(PAV)
|
||||
/// </summary>
|
||||
PAV = 1007,
|
||||
|
||||
/// <summary>
|
||||
/// FCT第一次测量值
|
||||
/// </summary>
|
||||
|
@ -2096,6 +2126,26 @@ public enum SUVChangeVSBaseline
|
|||
/// </summary>
|
||||
LipidAngle = 1016,
|
||||
|
||||
/// <summary>
|
||||
/// 匹配动脉段最小FCT
|
||||
/// </summary>
|
||||
MiniMumFCT = 1017,
|
||||
|
||||
/// <summary>
|
||||
/// 平均最小FCT
|
||||
/// </summary>
|
||||
AvgMinFCT=1018,
|
||||
|
||||
/// <summary>
|
||||
/// 脂质角度平均值
|
||||
/// </summary>
|
||||
AvgLipidAngle = 1019,
|
||||
|
||||
/// <summary>
|
||||
/// 脂质角度最大值
|
||||
/// </summary>
|
||||
MaxAvgLipidAngle = 1020,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -2458,65 +2508,34 @@ public enum SUVChangeVSBaseline
|
|||
ImageQualityProblem = 67,
|
||||
|
||||
/// <summary>
|
||||
/// 回撤中的图像帧数
|
||||
/// 斑块1-PAV
|
||||
/// </summary>
|
||||
RetracedFramesNumber = 1003,
|
||||
Plaque1PVA = 1003,
|
||||
|
||||
/// <summary>
|
||||
/// 队列分析图像帧数的中位数
|
||||
/// 斑块2-PAV
|
||||
/// </summary>
|
||||
MedianFrame = 1004,
|
||||
Plaque2PVA = 1004,
|
||||
|
||||
/// <summary>
|
||||
/// EEM求和
|
||||
/// 斑块3-PAV
|
||||
/// </summary>
|
||||
EEMSum = 1005,
|
||||
Plaque3PVA = 1005,
|
||||
|
||||
/// <summary>
|
||||
/// (EEM-Lumen)求和
|
||||
/// 斑块1-匹配动脉段最小FCT
|
||||
/// </summary>
|
||||
EEMLumenSum = 1006,
|
||||
Plaque1MinFCT = 1006,
|
||||
|
||||
/// <summary>
|
||||
/// 计算NTAV的(EEM-Lumen)求和/回撤中的图像数
|
||||
/// 斑块2-匹配动脉段最小FCT
|
||||
/// </summary>
|
||||
NTAVEEMLumenSumOrRetraceImageCount = 1007,
|
||||
Plaque2MinFCT = 1007,
|
||||
|
||||
/// <summary>
|
||||
/// 冠状动脉粥样硬化体积百分比(PAV)
|
||||
/// 斑块3-匹配动脉段最小FCT
|
||||
/// </summary>
|
||||
PAV = 1008,
|
||||
|
||||
/// <summary>
|
||||
/// 总动脉粥样硬化体积(NTAV)
|
||||
/// </summary>
|
||||
NTAV = 1009,
|
||||
|
||||
/// <summary>
|
||||
/// 匹配动脉段最小的FCT
|
||||
/// </summary>
|
||||
MinFCT = 1010,
|
||||
|
||||
/// <summary>
|
||||
/// 平均最小FCT
|
||||
/// </summary>
|
||||
AverageMinFCT = 1011,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 脂质角度
|
||||
/// </summary>
|
||||
LipidAngle = 1012,
|
||||
|
||||
/// <summary>
|
||||
/// 脂质角度平均值
|
||||
/// </summary>
|
||||
AvgLipidAngle = 1013,
|
||||
|
||||
/// <summary>
|
||||
/// 脂质角度最大值
|
||||
/// </summary>
|
||||
MaxLipidAngle = 1014,
|
||||
Plaque3MinFCT = 1008,
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -252,6 +252,7 @@ public static class StaticData
|
|||
|
||||
public const string TrialMedicalReviewList_Export = "TrialMedicalReviewList_Export";
|
||||
|
||||
|
||||
|
||||
//public const string TrialRECIST1Point1SelfAnalysisList_Export = "TrialRECIST1Point1SelfAnalysisList_Export";
|
||||
|
||||
|
@ -273,7 +274,7 @@ public static class StaticData
|
|||
public const string PCWG3Point1DetailedOfEvaluatedLesion_Export = "PCWG3Point1DetailedOfEvaluatedLesion_Export";
|
||||
|
||||
|
||||
|
||||
public const string IVUSTheMeasuredValueOfEachMatchedFragment = "IVUS_TheMeasuredValueOfEachMatchedFragment";
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue