Compare commits
No commits in common. "67fd739b0e5f857738ec327f55d6f95a4bc8e30f" and "bbcab237d41f038e105787746945ff635f5b1478" have entirely different histories.
67fd739b0e
...
bbcab237d4
|
|
@ -29,11 +29,11 @@ public class TrialGlobalLimitActionFilter(IFusionCache _fusionCache, IUserInfo _
|
||||||
var requestHost = context.HttpContext.Request.Host;
|
var requestHost = context.HttpContext.Request.Host;
|
||||||
|
|
||||||
// 检查请求是否来自 localhost:6100
|
// 检查请求是否来自 localhost:6100
|
||||||
if (requestHost.Host == "localhost" && (requestHost.Port == 6100 || requestHost.Port == 3305))
|
//if (requestHost.Host == "localhost" && (requestHost.Port == 6100 || requestHost.Port == 3305))
|
||||||
{
|
//{
|
||||||
await next();
|
// await next();
|
||||||
return;
|
// return;
|
||||||
}
|
//}
|
||||||
|
|
||||||
#region 特殊用户类型拦截
|
#region 特殊用户类型拦截
|
||||||
// 用户类型检查
|
// 用户类型检查
|
||||||
|
|
|
||||||
|
|
@ -4407,27 +4407,6 @@
|
||||||
<param name="inDto"></param>
|
<param name="inDto"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.IVUSCalculateService.GetEmmSum(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
|
||||||
<summary>
|
|
||||||
获取EMM求和
|
|
||||||
</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)">
|
|
||||||
<summary>
|
|
||||||
(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>
|
|
||||||
<param name="inDto"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.IVUSCalculateService.AddTaskLesionAnswerFromLastTask(IRaCIS.Core.Application.ViewModel.AddTaskLesionAnswerFromLastTaskInDto)">
|
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.IVUSCalculateService.AddTaskLesionAnswerFromLastTask(IRaCIS.Core.Application.ViewModel.AddTaskLesionAnswerFromLastTaskInDto)">
|
||||||
<summary>
|
<summary>
|
||||||
将上一次的访视病灶添加到这一次
|
将上一次的访视病灶添加到这一次
|
||||||
|
|
@ -6005,62 +5984,6 @@
|
||||||
<param name="inDto"></param>
|
<param name="inDto"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.OCTCalculateService.GetMinFCT(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
|
||||||
<summary>
|
|
||||||
匹配动脉段最小FCT (平均值的最小值)
|
|
||||||
</summary>
|
|
||||||
<param name="inDto"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.OCTCalculateService.GetAvgFCT(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
|
||||||
<summary>
|
|
||||||
平均最小FCT (平均值的平均值)
|
|
||||||
</summary>
|
|
||||||
<param name="inDto"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.OCTCalculateService.GetAvgLipidAngle(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
|
||||||
<summary>
|
|
||||||
脂质角度平均值
|
|
||||||
</summary>
|
|
||||||
<param name="inDto"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.OCTCalculateService.GetMaxLipidAngle(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
|
||||||
<summary>
|
|
||||||
脂质角度最大
|
|
||||||
</summary>
|
|
||||||
<param name="inDto"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.OCTCalculateService.GetMacrophageInfiltration(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
|
||||||
<summary>
|
|
||||||
获取巨噬细胞浸润测量
|
|
||||||
</summary>
|
|
||||||
<param name="inDto"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.OCTCalculateService.GetMacrophageExtensionAngle(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
|
||||||
<summary>
|
|
||||||
巨噬细胞浸润角度测量
|
|
||||||
</summary>
|
|
||||||
<param name="inDto"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.OCTCalculateService.GetMicrochannels(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
|
||||||
<summary>
|
|
||||||
获取微通道汇总
|
|
||||||
</summary>
|
|
||||||
<param name="inDto"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.OCTCalculateService.GetCholesterolCrystallization(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
|
||||||
<summary>
|
|
||||||
获取胆固醇结晶汇总
|
|
||||||
</summary>
|
|
||||||
<param name="inDto"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.OCTCalculateService.VerifyVisitTaskQuestions(IRaCIS.Core.Application.Service.Reading.Dto.VerifyVisitTaskQuestionsInDto)">
|
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.OCTCalculateService.VerifyVisitTaskQuestions(IRaCIS.Core.Application.Service.Reading.Dto.VerifyVisitTaskQuestionsInDto)">
|
||||||
<summary>
|
<summary>
|
||||||
验证访视提交
|
验证访视提交
|
||||||
|
|
@ -8729,6 +8652,11 @@
|
||||||
IVUS测量值导入
|
IVUS测量值导入
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.IVUSMeasuredValue.PlaqueNum">
|
||||||
|
<summary>
|
||||||
|
斑块编号
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.IVUSMeasuredValue.Emm">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.IVUSMeasuredValue.Emm">
|
||||||
<summary>
|
<summary>
|
||||||
外弹力膜面积Emm
|
外弹力膜面积Emm
|
||||||
|
|
@ -8744,6 +8672,11 @@
|
||||||
外弹力膜面积- 管腔面积
|
外弹力膜面积- 管腔面积
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.OCTFCTUploadData.PlaqueNum">
|
||||||
|
<summary>
|
||||||
|
斑块编号
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.OCTFCTUploadData.FirstData">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.OCTFCTUploadData.FirstData">
|
||||||
<summary>
|
<summary>
|
||||||
第一次
|
第一次
|
||||||
|
|
@ -8784,11 +8717,6 @@
|
||||||
官腔面积测量
|
官腔面积测量
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.OCTFCTUploadData.LipidAngle">
|
|
||||||
<summary>
|
|
||||||
脂质角度
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.OCTInfo.PlaqueNum">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.OCTInfo.PlaqueNum">
|
||||||
<summary>
|
<summary>
|
||||||
斑块编号
|
斑块编号
|
||||||
|
|
@ -16862,17 +16790,17 @@
|
||||||
</member>
|
</member>
|
||||||
<member name="F:IRaCIS.Core.Application.ViewModel.AccessToDialogueEnum.Question">
|
<member name="F:IRaCIS.Core.Application.ViewModel.AccessToDialogueEnum.Question">
|
||||||
<summary>
|
<summary>
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
质疑
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="F:IRaCIS.Core.Application.ViewModel.AccessToDialogueEnum.Consistency">
|
<member name="F:IRaCIS.Core.Application.ViewModel.AccessToDialogueEnum.Consistency">
|
||||||
<summary>
|
<summary>
|
||||||
һ<EFBFBD><EFBFBD><EFBFBD>Ժ˲<EFBFBD>
|
一致性核查
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="T:IRaCIS.Core.Application.ViewModel.CopyFrontAuditConfigItemDto">
|
<member name="T:IRaCIS.Core.Application.ViewModel.CopyFrontAuditConfigItemDto">
|
||||||
<summary>
|
<summary>
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
复制
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="T:IRaCIS.Core.Application.ViewModel.SystemNoticeView">
|
<member name="T:IRaCIS.Core.Application.ViewModel.SystemNoticeView">
|
||||||
|
|
|
||||||
|
|
@ -703,10 +703,6 @@ public class QCClaimTaskEventConsumer(
|
||||||
|
|
||||||
|
|
||||||
var userinfo = subjectVisit.CurrentActionUser;
|
var userinfo = subjectVisit.CurrentActionUser;
|
||||||
if (userinfo == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var messageToSend = new MimeMessage();
|
var messageToSend = new MimeMessage();
|
||||||
//发件地址
|
//发件地址
|
||||||
|
|
|
||||||
|
|
@ -939,8 +939,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
//存在ivus 和oct 这两种的项目
|
//存在ivus 和oct 这两种的项目
|
||||||
if (_readingQuestionCriterionTrialRepository.Where(t => t.TrialId == info.TrialId &&
|
if (_readingQuestionCriterionTrialRepository.Where(t => t.TrialId == info.TrialId &&
|
||||||
(t.CriterionType == CriterionType.IVUS || t.CriterionType == CriterionType.OCT)).Distinct().Count() == 2
|
(t.CriterionType == CriterionType.IVUS || t.CriterionType == CriterionType.OCT)).Distinct().Count() == 2
|
||||||
&& _noneDicomStudyReposiotry.Where(t => t.SubjectId == inQuery.SubjectId && t.Modality == "IVUS").Count() != _dicomStudyRepository.Where(t => t.SubjectId == inQuery.SubjectId).Select(t => t.SubjectVisitId).Distinct().Count()
|
&& !_noneDicomStudyReposiotry.Any(t => t.SubjectId == inQuery.SubjectId && t.Modality == "IVUS"))
|
||||||
)
|
|
||||||
{
|
{
|
||||||
#region ivus 自动创建非dicom检查
|
#region ivus 自动创建非dicom检查
|
||||||
|
|
||||||
|
|
@ -958,7 +957,6 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
|
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
var noneDicomStudyVisitIdList = _noneDicomStudyReposiotry.Where(t => t.SubjectId == inQuery.SubjectId && t.Modality == "IVUS").Select(t => t.SubjectVisitId).ToList();
|
|
||||||
|
|
||||||
var @lock = _distributedLockProvider.CreateLock($"NoneDicomCode");
|
var @lock = _distributedLockProvider.CreateLock($"NoneDicomCode");
|
||||||
|
|
||||||
|
|
@ -969,12 +967,10 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
//默认会是0
|
//默认会是0
|
||||||
var code = await _noneDicomStudyReposiotry.Where(t => t.TrialId == trialId).Select(x => x.Code).DefaultIfEmpty().MaxAsync();
|
var code = await _noneDicomStudyReposiotry.Where(t => t.TrialId == trialId).Select(x => x.Code).DefaultIfEmpty().MaxAsync();
|
||||||
|
|
||||||
foreach (var g in addList.Where(t => !noneDicomStudyVisitIdList.Contains(t.SubjectVisitId)).GroupBy(t => t.SubjectVisitId))
|
foreach (var g in addList.GroupBy(t => t.SubjectVisitId))
|
||||||
{
|
{
|
||||||
var addOrEditNoneDicomStudy = g.First();
|
var addOrEditNoneDicomStudy = g.First();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var optEntity = await _noneDicomStudyReposiotry.InsertFromDTOAsync(addOrEditNoneDicomStudy);
|
var optEntity = await _noneDicomStudyReposiotry.InsertFromDTOAsync(addOrEditNoneDicomStudy);
|
||||||
|
|
||||||
optEntity.Code = code + 1;
|
optEntity.Code = code + 1;
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ using IRaCIS.Core.Application.Filter;
|
||||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||||
using IRaCIS.Core.Domain.Models;
|
using IRaCIS.Core.Domain.Models;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using IRaCIS.Core.Infrastructure;
|
|
||||||
using Medallion.Threading;
|
using Medallion.Threading;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using NPOI.SS.Formula.Functions;
|
using NPOI.SS.Formula.Functions;
|
||||||
|
|
@ -115,7 +114,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
var list = await noneDicomStudyQueryable.Where(t => isFilterIVUSNoneDicom ? t.Modality != "IVUS" : true)
|
var list = await noneDicomStudyQueryable.Where(t => isFilterIVUSNoneDicom ? t.Modality != "IVUS" : true)
|
||||||
.OrderBy(x => x.ImageDate).ThenBy(x => x.CreateTime).ToListAsync();
|
.OrderBy(x => x.ImageDate).ThenBy(x => x.CreateTime).ToListAsync();
|
||||||
|
|
||||||
var config = await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).Select(t => new { t.Trial.ImageFormatList, t.Trial.StudyNameList, t.Trial.IsShowStudyName, AuditState = qcAuditState, CriterionType = criterionType }).FirstOrDefaultAsync();
|
var config = await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).Select(t => new { t.Trial.ImageFormatList, t.Trial.StudyNameList, t.Trial.IsShowStudyName, AuditState = qcAuditState, CriterionType=criterionType }).FirstOrDefaultAsync();
|
||||||
return ResponseOutput.Ok(list, config);
|
return ResponseOutput.Ok(list, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -155,13 +154,6 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
{
|
{
|
||||||
if (addOrEditNoneDicomStudy.Id == Guid.Empty || addOrEditNoneDicomStudy.Id == null)
|
if (addOrEditNoneDicomStudy.Id == Guid.Empty || addOrEditNoneDicomStudy.Id == null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (_subjectVisitRepository.Where(t => t.Id == addOrEditNoneDicomStudy.SubjectVisitId).SelectMany(t => t.Trial.TrialReadingCriterionList)
|
|
||||||
.Where(t => (t.CriterionType == CriterionType.IVUS || t.CriterionType == CriterionType.OCT) && t.IsConfirm).Distinct().Count() == 2 && addOrEditNoneDicomStudy.Modality != "OCT")
|
|
||||||
{
|
|
||||||
throw new BusinessValidationFailedException(_localizer["NoneDicomStudy_OnlyNeedOCT"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
//默认会是0
|
//默认会是0
|
||||||
var code = await _noneDicomStudyRepository.Where(t => t.TrialId == addOrEditNoneDicomStudy.TrialId).Select(x => x.Code).DefaultIfEmpty().MaxAsync();
|
var code = await _noneDicomStudyRepository.Where(t => t.TrialId == addOrEditNoneDicomStudy.TrialId).Select(x => x.Code).DefaultIfEmpty().MaxAsync();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -208,10 +208,10 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class IVUSMeasuredValue
|
public class IVUSMeasuredValue
|
||||||
{
|
{
|
||||||
///// <summary>
|
/// <summary>
|
||||||
///// 斑块编号
|
/// 斑块编号
|
||||||
///// </summary>
|
/// </summary>
|
||||||
//public int PlaqueNum { get; set; }
|
public int PlaqueNum { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 外弹力膜面积Emm
|
/// 外弹力膜面积Emm
|
||||||
|
|
@ -244,6 +244,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
|
|
||||||
public class OCTFCTUploadData
|
public class OCTFCTUploadData
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 斑块编号
|
||||||
|
/// </summary>
|
||||||
|
public int PlaqueNum { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 第一次
|
/// 第一次
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -285,10 +290,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public decimal? LumenAreaMeasurement { get; set; }
|
public decimal? LumenAreaMeasurement { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 脂质角度
|
|
||||||
/// </summary>
|
|
||||||
public decimal? LipidAngle { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public decimal Avg { get {
|
public decimal Avg { get {
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.IdentityModel.Tokens;
|
using Microsoft.IdentityModel.Tokens;
|
||||||
using MiniExcelLibs;
|
using MiniExcelLibs;
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
{
|
{
|
||||||
|
|
@ -45,7 +44,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
switch (readingImportType)
|
switch (readingImportType)
|
||||||
{
|
{
|
||||||
case ReadingImportType.ROI:
|
case ReadingImportType.IVUS_MatchingSegment:
|
||||||
await UploadIVUSTemplate();
|
await UploadIVUSTemplate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -285,34 +284,23 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
ComputationTrigger.SaveEICRFQuestions,
|
ComputationTrigger.SaveEICRFQuestions,
|
||||||
|
|
||||||
};
|
};
|
||||||
//if (!computationTriggers.Contains(inDto.ComputationTrigger))
|
if (!computationTriggers.Contains(inDto.ComputationTrigger))
|
||||||
//{
|
{
|
||||||
// // 计算斑块统计数据
|
// 计算斑块统计数据
|
||||||
// await this.CalculatePatchDataStatisticsAndPVA(inDto);
|
await this.CalculatePatchDataStatisticsAndPVA(inDto);
|
||||||
// inDto = await _generalCalculateService.GetReadingCalculateDto(inDto.VisitTaskId);
|
inDto = await _generalCalculateService.GetReadingCalculateDto(inDto.VisitTaskId);
|
||||||
//}
|
}
|
||||||
|
|
||||||
List<ReadingCalculateData> calculateList = new List<ReadingCalculateData>()
|
List<ReadingCalculateData> calculateList = new List<ReadingCalculateData>()
|
||||||
{
|
{
|
||||||
//// 斑块1-PAV
|
// 斑块1-PAV
|
||||||
//new ReadingCalculateData (){QuestionType=QuestionType.Plaque1PVA,GetDecimalNullFun=GetPlaque1PVA},
|
new ReadingCalculateData (){QuestionType=QuestionType.Plaque1PVA,GetDecimalNullFun=GetPlaque1PVA},
|
||||||
|
|
||||||
// // 斑块2-PAV
|
|
||||||
//new ReadingCalculateData (){QuestionType=QuestionType.Plaque2PVA,GetDecimalNullFun=GetPlaque2PVA},
|
|
||||||
|
|
||||||
// // 斑块3-PAV
|
|
||||||
//new ReadingCalculateData (){QuestionType=QuestionType.Plaque3PVA,GetDecimalNullFun=GetPlaque3PVA},
|
|
||||||
|
|
||||||
|
|
||||||
// (EEM-Lumen)求和
|
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.EEMSum,GetDecimalNullFun=GetEmmSum},
|
|
||||||
|
|
||||||
// 斑块2-PAV
|
// 斑块2-PAV
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.EEMSubLumenSum,GetDecimalNullFun=GetEEMLumenSum},
|
new ReadingCalculateData (){QuestionType=QuestionType.Plaque2PVA,GetDecimalNullFun=GetPlaque2PVA},
|
||||||
|
|
||||||
// PAV(冠状动脉粥样硬化体积百分比)
|
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.PAV,GetDecimalNullFun=GetPAV},
|
|
||||||
|
|
||||||
|
// 斑块3-PAV
|
||||||
|
new ReadingCalculateData (){QuestionType=QuestionType.Plaque3PVA,GetDecimalNullFun=GetPlaque3PVA},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -483,9 +471,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
{
|
{
|
||||||
iVUSMeasuredValue = new IVUSMeasuredValue()
|
iVUSMeasuredValue = new IVUSMeasuredValue()
|
||||||
{
|
{
|
||||||
//PlaqueNum = int.Parse(dataTable.Rows[i]["A"].ToString()),
|
PlaqueNum = int.Parse(dataTable.Rows[i]["A"].ToString()),
|
||||||
Emm = getdecimalData(dataTable.Rows[i]["A"].ToString()),
|
Emm = getdecimalData(dataTable.Rows[i]["B"].ToString()),
|
||||||
Lumen = getdecimalData(dataTable.Rows[i]["B"].ToString()),
|
Lumen = getdecimalData(dataTable.Rows[i]["C"].ToString()),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
|
|
@ -506,15 +494,15 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
var errorRows= string.Join(',', errorRow.Select(i => i.ToString()));
|
var errorRows= string.Join(',', errorRow.Select(i => i.ToString()));
|
||||||
throw new BusinessValidationFailedException(_localizer["Service_TemplateException", errorRows]);
|
throw new BusinessValidationFailedException(_localizer["Service_TemplateException", errorRows]);
|
||||||
}
|
}
|
||||||
//List<int> nums = new List<int>() { 1, 2, 3 };
|
List<int> nums = new List<int>() { 1, 2, 3 };
|
||||||
//if (measuredValueList.Any(x => !nums.Contains(x.PlaqueNum)))
|
if (measuredValueList.Any(x => !nums.Contains(x.PlaqueNum)))
|
||||||
//{
|
{
|
||||||
// throw new BusinessValidationFailedException(_localizer["IVUSOCT_PlaqueNum123"]);
|
throw new BusinessValidationFailedException(_localizer["IVUSOCT_PlaqueNum123"]);
|
||||||
//}
|
}
|
||||||
//measuredValueList = measuredValueList.OrderBy(x => x.PlaqueNum).ToList();
|
measuredValueList = measuredValueList.OrderBy(x => x.PlaqueNum).ToList();
|
||||||
|
|
||||||
|
|
||||||
var questionInfo = await _readingQuestionTrialRepository.Where(x =>x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId&& x.LesionType == LesionType.ROI).FirstNotNullAsync();
|
var questionInfo = await _readingQuestionTrialRepository.Where(x =>x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId&& x.LesionType == LesionType.MatchValues).FirstNotNullAsync();
|
||||||
var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == questionInfo.Id).ToListAsync();
|
var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == questionInfo.Id).ToListAsync();
|
||||||
List<ReadingTableAnswerRowInfo> tableAnsweRowInfos = new List<ReadingTableAnswerRowInfo>();
|
List<ReadingTableAnswerRowInfo> tableAnsweRowInfos = new List<ReadingTableAnswerRowInfo>();
|
||||||
List<ReadingTableQuestionAnswer> tableAnswers = new List<ReadingTableQuestionAnswer>();
|
List<ReadingTableQuestionAnswer> tableAnswers = new List<ReadingTableQuestionAnswer>();
|
||||||
|
|
@ -542,16 +530,16 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
});
|
});
|
||||||
|
|
||||||
// 编号
|
// 编号
|
||||||
//tableAnswers.Add(new ReadingTableQuestionAnswer()
|
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||||
//{
|
{
|
||||||
// Answer = item.PlaqueNum.ToString(),
|
Answer = item.PlaqueNum.ToString(),
|
||||||
// QuestionId = questionInfo.Id,
|
QuestionId = questionInfo.Id,
|
||||||
// TrialId = taskinfo.TrialId,
|
TrialId = taskinfo.TrialId,
|
||||||
// VisitTaskId = taskinfo.Id,
|
VisitTaskId = taskinfo.Id,
|
||||||
// RowId = newRowId,
|
RowId = newRowId,
|
||||||
// RowIndex = maxnum,
|
RowIndex = maxnum,
|
||||||
// TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.PlaqueNumber).Select(x => x.Id).FirstOrDefault(),
|
TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.PlaqueNumber).Select(x => x.Id).FirstOrDefault(),
|
||||||
//});
|
});
|
||||||
|
|
||||||
var emm = item.Emm.ToString();
|
var emm = item.Emm.ToString();
|
||||||
var lumen=item.Lumen.ToString();
|
var lumen=item.Lumen.ToString();
|
||||||
|
|
@ -645,7 +633,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
|
|
||||||
// 测量值集合
|
// 测量值集合
|
||||||
var matchValuesAnswerList = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.ROI).SelectMany(x => x.TableRowInfoList).ToList();
|
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();
|
var nums = matchValuesAnswerList.SelectMany(x => x.TableQuestionList).Where(x => x.QuestionMark == QuestionMark.PlaqueNumber).Select(x => int.Parse(x.Answer)).Distinct().OrderBy(x => x).ToList();
|
||||||
|
|
@ -663,7 +651,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
{
|
{
|
||||||
var newRowId = NewId.NextGuid();
|
var newRowId = NewId.NextGuid();
|
||||||
|
|
||||||
var thisnumTableRows = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.ROI).SelectMany(x => x.TableRowInfoList).Where(x => x.TableQuestionList.Any(y => y.QuestionMark == QuestionMark.PlaqueNumber && y.Answer == item.ToString())).ToList();
|
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()
|
tableAnsweRowInfos.Add(new ReadingTableAnswerRowInfo()
|
||||||
|
|
@ -846,7 +834,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
{
|
{
|
||||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.Subject).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
|
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.Subject).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
|
||||||
|
|
||||||
var question = await _readingQuestionTrialRepository.Where(x => x.LesionType == LesionType.ROI && x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId).FirstNotNullAsync();
|
var question = await _readingQuestionTrialRepository.Where(x => x.LesionType == LesionType.PAV && x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId).FirstNotNullAsync();
|
||||||
|
|
||||||
|
|
||||||
var tableQuestions = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == question.Id)
|
var tableQuestions = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == question.Id)
|
||||||
|
|
@ -903,52 +891,6 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
.Where(x => x.QuestionMark == QuestionMark.PAV).Select(x => x.Answer).FirstIsNullReturnEmpty().IsNullOrEmptyReturnNull();
|
.Where(x => x.QuestionMark == QuestionMark.PAV).Select(x => x.Answer).FirstIsNullReturnEmpty().IsNullOrEmptyReturnNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取EMM求和
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inDto"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<decimal?> GetEmmSum(ReadingCalculateDto inDto)
|
|
||||||
{
|
|
||||||
return inDto.QuestionInfo.Where(x => x.LesionType == LesionType.ROI).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
|
||||||
.Where(x => x.QuestionMark == QuestionMark.ElasticArea).Select(x => x.Answer.IsNullOrEmptyReturn0()).Sum();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// (EEM-Lumen)求和
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inDto"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<decimal?> GetEEMLumenSum(ReadingCalculateDto inDto)
|
|
||||||
{
|
|
||||||
var emm = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.ROI).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
|
||||||
.Where(x => x.QuestionMark == QuestionMark.ElasticArea).Select(x => x.Answer.IsNullOrEmptyReturn0()).Sum();
|
|
||||||
|
|
||||||
var lumen = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.ROI).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
|
||||||
.Where(x => x.QuestionMark == QuestionMark.LumenArea).Select(x => x.Answer.IsNullOrEmptyReturn0()).Sum();
|
|
||||||
|
|
||||||
return emm - lumen;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// PAV(冠状动脉粥样硬化体积百分比)
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inDto"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<decimal?> GetPAV(ReadingCalculateDto inDto)
|
|
||||||
{
|
|
||||||
var eEMLumenSum = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.EEMSubLumenSum).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
|
|
||||||
var eEMSum = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.EEMSum).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
|
|
||||||
|
|
||||||
decimal pav = 0;
|
|
||||||
if (eEMSum != 0)
|
|
||||||
{
|
|
||||||
pav = eEMLumenSum * 100 / eEMSum;
|
|
||||||
}
|
|
||||||
|
|
||||||
return pav;
|
|
||||||
}
|
|
||||||
|
|
||||||
///// <summary>
|
///// <summary>
|
||||||
///// 计算NTAV的EEM
|
///// 计算NTAV的EEM
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,6 @@
|
||||||
using DocumentFormat.OpenXml.Drawing.Diagrams;
|
using DocumentFormat.OpenXml.Drawing.Diagrams;
|
||||||
using DocumentFormat.OpenXml.Drawing.Spreadsheet;
|
|
||||||
using DocumentFormat.OpenXml.Office.SpreadSheetML.Y2023.MsForms;
|
|
||||||
using DocumentFormat.OpenXml.Office2010.Excel;
|
|
||||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
using IRaCIS.Core.Domain.Models;
|
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using IRaCIS.Core.Infra.EFCore.Common;
|
using IRaCIS.Core.Infra.EFCore.Common;
|
||||||
using IRaCIS.Core.Infrastructure;
|
using IRaCIS.Core.Infrastructure;
|
||||||
|
|
@ -44,7 +40,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
switch (readingImportType)
|
switch (readingImportType)
|
||||||
{
|
{
|
||||||
case ReadingImportType.ROI:
|
case ReadingImportType.OCT_FCT:
|
||||||
await UploadOCTFCTTemplate();
|
await UploadOCTFCTTemplate();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -336,33 +332,21 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
List<OCTFCTUploadData> measuredValueList = new List<OCTFCTUploadData>();
|
List<OCTFCTUploadData> measuredValueList = new List<OCTFCTUploadData>();
|
||||||
var errorRow = new List<int> { };
|
var errorRow = new List<int> { };
|
||||||
|
|
||||||
string getNone(string value)
|
|
||||||
{
|
|
||||||
if (value == string.Empty || value == null)
|
|
||||||
{
|
|
||||||
return "无";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (int i = 3; i < dataTable.Rows.Count; i++)
|
for (int i = 3; i < dataTable.Rows.Count; i++)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
measuredValueList.Add(new OCTFCTUploadData()
|
measuredValueList.Add(new OCTFCTUploadData()
|
||||||
{
|
{
|
||||||
//PlaqueNum = int.Parse(dataTable.Rows[i]["A"].ToString()),
|
PlaqueNum = int.Parse(dataTable.Rows[i]["A"].ToString()),
|
||||||
FirstData = getdecimalData(dataTable.Rows[i]["A"].ToString()),
|
FirstData = getdecimalData(dataTable.Rows[i]["B"].ToString()),
|
||||||
SecondData = getdecimalData(dataTable.Rows[i]["B"].ToString()),
|
SecondData = getdecimalData(dataTable.Rows[i]["C"].ToString()),
|
||||||
ThirdData = getdecimalData(dataTable.Rows[i]["C"].ToString()),
|
ThirdData = getdecimalData(dataTable.Rows[i]["D"].ToString()),
|
||||||
MacrophageInfiltrationMeasurement = getNone(dataTable.Rows[i]["D"].ToString()),
|
MacrophageInfiltrationMeasurement = dataTable.Rows[i]["E"].ToString() ?? string.Empty,
|
||||||
MacrophageInfiltrationAngle = getdecimalEmptyData(dataTable.Rows[i]["E"].ToString() ?? string.Empty),
|
MacrophageInfiltrationAngle = getdecimalEmptyData(dataTable.Rows[i]["F"].ToString() ?? string.Empty),
|
||||||
MicrochannelMeasurement = getNone(dataTable.Rows[i]["F"].ToString()),
|
MicrochannelMeasurement =dataTable.Rows[i]["G"].ToString() ?? string.Empty,
|
||||||
CholesterolCrystalMeasurement = getNone(dataTable.Rows[i]["G"].ToString()),
|
CholesterolCrystalMeasurement = dataTable.Rows[i]["H"].ToString() ?? string.Empty,
|
||||||
LumenAreaMeasurement = getdecimalData(dataTable.Rows[i]["H"].ToString()),
|
LumenAreaMeasurement = getdecimalEmptyData(dataTable.Rows[i]["I"].ToString() ?? string.Empty),
|
||||||
LipidAngle = getdecimalEmptyData(dataTable.Rows[i]["I"].ToString() ?? string.Empty),
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
|
|
@ -372,7 +356,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
measuredValueList = measuredValueList.OrderBy(x => x.PlaqueNum).ToList();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -382,6 +366,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
throw new BusinessValidationFailedException(_localizer["Service_TemplateException", errorRows]);
|
throw new BusinessValidationFailedException(_localizer["Service_TemplateException", errorRows]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<int> nums = new List<int>() { 1, 2, 3 };
|
||||||
|
if (measuredValueList.Any(x => !nums.Contains(x.PlaqueNum)))
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException(_localizer["IVUSOCT_PlaqueNum123"]);
|
||||||
|
}
|
||||||
|
|
||||||
Dictionary<string, string> isPresent = new Dictionary<string, string>()
|
Dictionary<string, string> isPresent = new Dictionary<string, string>()
|
||||||
{
|
{
|
||||||
{ "有","1"},
|
{ "有","1"},
|
||||||
|
|
@ -423,7 +413,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
throw new BusinessValidationFailedException(_localizer["Service_TemplateException", errorRows]);
|
throw new BusinessValidationFailedException(_localizer["Service_TemplateException", errorRows]);
|
||||||
}
|
}
|
||||||
|
|
||||||
var questionInfo = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId && x.LesionType == LesionType.ROI).FirstNotNullAsync();
|
var questionInfo = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId && x.LesionType == LesionType.FCT).FirstNotNullAsync();
|
||||||
var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == questionInfo.Id).ToListAsync();
|
var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == questionInfo.Id).ToListAsync();
|
||||||
List<ReadingTableAnswerRowInfo> tableAnsweRowInfos = new List<ReadingTableAnswerRowInfo>();
|
List<ReadingTableAnswerRowInfo> tableAnsweRowInfos = new List<ReadingTableAnswerRowInfo>();
|
||||||
List<ReadingTableQuestionAnswer> tableAnswers = new List<ReadingTableQuestionAnswer>();
|
List<ReadingTableQuestionAnswer> tableAnswers = new List<ReadingTableQuestionAnswer>();
|
||||||
|
|
@ -452,16 +442,16 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
});
|
});
|
||||||
|
|
||||||
// 编号
|
// 编号
|
||||||
//tableAnswers.Add(new ReadingTableQuestionAnswer()
|
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||||
//{
|
{
|
||||||
// Answer = item.PlaqueNum.ToString(),
|
Answer = item.PlaqueNum.ToString(),
|
||||||
// QuestionId = questionInfo.Id,
|
QuestionId = questionInfo.Id,
|
||||||
// TrialId = taskinfo.TrialId,
|
TrialId = taskinfo.TrialId,
|
||||||
// VisitTaskId = taskinfo.Id,
|
VisitTaskId = taskinfo.Id,
|
||||||
// RowId = newRowId,
|
RowId = newRowId,
|
||||||
// RowIndex = maxnum,
|
RowIndex = maxnum,
|
||||||
// TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.PlaqueNumber).Select(x => x.Id).FirstOrDefault(),
|
TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.PlaqueNumber).Select(x => x.Id).FirstOrDefault(),
|
||||||
//});
|
});
|
||||||
|
|
||||||
var avg = item.Avg.ToString();
|
var avg = item.Avg.ToString();
|
||||||
|
|
||||||
|
|
@ -580,18 +570,6 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.LumenAreaMeasurement).Select(x => x.Id).FirstOrDefault(),
|
TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.LumenAreaMeasurement).Select(x => x.Id).FirstOrDefault(),
|
||||||
});
|
});
|
||||||
|
|
||||||
// 脂质角度
|
|
||||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
|
||||||
{
|
|
||||||
Answer = item.LipidAngle.ToString(),
|
|
||||||
QuestionId = questionInfo.Id,
|
|
||||||
TrialId = taskinfo.TrialId,
|
|
||||||
VisitTaskId = taskinfo.Id,
|
|
||||||
RowId = newRowId,
|
|
||||||
RowIndex = maxnum,
|
|
||||||
TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.LipidAngle).Select(x => x.Id).FirstOrDefault(),
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
|
@ -658,176 +636,173 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task UploadOCTLipidAngleTemplate()
|
public async Task UploadOCTLipidAngleTemplate()
|
||||||
{
|
{
|
||||||
#region 这个导入没有了 代码全部注释
|
var request = httpContext.HttpContext!.Request;
|
||||||
//var request = httpContext.HttpContext!.Request;
|
var file = request.Form.Files[0];
|
||||||
//var file = request.Form.Files[0];
|
Guid visitTaskId = Guid.Parse(request.Form["VisitTaskId"]);
|
||||||
//Guid visitTaskId = Guid.Parse(request.Form["VisitTaskId"]);
|
var taskinfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Include(x => x.Subject).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
|
||||||
//var taskinfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Include(x => x.Subject).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
|
var uploadInfo = await _generalCalculateService.GetDataTableFromUpload(file, "OCTLipidAngle", taskinfo.TrialId);
|
||||||
//var uploadInfo = await _generalCalculateService.GetDataTableFromUpload(file, "OCTLipidAngle", taskinfo.TrialId);
|
List<string> sheetNames = new List<string>()
|
||||||
//List<string> sheetNames = new List<string>()
|
{
|
||||||
//{
|
"脂质角度","LipidAngle"
|
||||||
// "脂质角度","LipidAngle"
|
};
|
||||||
//};
|
|
||||||
|
|
||||||
//if (sheetNames.Intersect(uploadInfo.SheetNames).Count() == 0)
|
if (sheetNames.Intersect(uploadInfo.SheetNames).Count() == 0)
|
||||||
//{
|
{
|
||||||
// throw new BusinessValidationFailedException(_localizer["IVUS_UplpadDataError"]);
|
throw new BusinessValidationFailedException(_localizer["IVUS_UplpadDataError"]);
|
||||||
//}
|
}
|
||||||
//var dataTable = uploadInfo.DataTable;
|
var dataTable = uploadInfo.DataTable;
|
||||||
|
|
||||||
//var values = new TemplateData()
|
var values = new TemplateData()
|
||||||
//{
|
{
|
||||||
// SubjectID = taskinfo.BlindSubjectCode.IsNullOrEmpty() ? taskinfo.Subject.Code : taskinfo.BlindSubjectCode,
|
SubjectID = taskinfo.BlindSubjectCode.IsNullOrEmpty() ? taskinfo.Subject.Code : taskinfo.BlindSubjectCode,
|
||||||
// TaskBlindName = taskinfo.TaskBlindName,
|
TaskBlindName = taskinfo.TaskBlindName,
|
||||||
//};
|
};
|
||||||
|
|
||||||
//if (values.SubjectID != dataTable.Rows[0]["B"].ToString() || values.TaskBlindName != dataTable.Rows[1]["B"].ToString())
|
if (values.SubjectID != dataTable.Rows[0]["B"].ToString() || values.TaskBlindName != dataTable.Rows[1]["B"].ToString())
|
||||||
//{
|
{
|
||||||
// throw new BusinessValidationFailedException(_localizer["IVUS_UploadVisitTaskError"]);
|
throw new BusinessValidationFailedException(_localizer["IVUS_UploadVisitTaskError"]);
|
||||||
//}
|
}
|
||||||
|
|
||||||
//var digitPlaces = taskinfo.TrialReadingCriterion.DigitPlaces ?? 0;
|
var digitPlaces = taskinfo.TrialReadingCriterion.DigitPlaces ?? 0;
|
||||||
//decimal getdecimalData(string value)
|
decimal getdecimalData(string value)
|
||||||
//{
|
{
|
||||||
// return decimal.Parse(decimal.Round(decimal.Parse(value ?? "0"), digitPlaces, MidpointRounding.AwayFromZero).ToString("F" + digitPlaces.ToString()));
|
return decimal.Parse(decimal.Round(decimal.Parse(value ?? "0"), digitPlaces, MidpointRounding.AwayFromZero).ToString("F" + digitPlaces.ToString()));
|
||||||
//}
|
}
|
||||||
//;
|
;
|
||||||
|
|
||||||
//List<OCTFCTUploadData> measuredValueList = new List<OCTFCTUploadData>();
|
List<OCTFCTUploadData> measuredValueList = new List<OCTFCTUploadData>();
|
||||||
//var errorRow = new List<int> { };
|
var errorRow = new List<int> { };
|
||||||
|
|
||||||
//for (int i = 3; i < dataTable.Rows.Count; i++)
|
for (int i = 3; i < dataTable.Rows.Count; i++)
|
||||||
//{
|
{
|
||||||
// try
|
try
|
||||||
// {
|
{
|
||||||
// measuredValueList.Add(new OCTFCTUploadData()
|
measuredValueList.Add(new OCTFCTUploadData()
|
||||||
// {
|
{
|
||||||
// PlaqueNum = int.Parse(dataTable.Rows[i]["A"].ToString()),
|
PlaqueNum = int.Parse(dataTable.Rows[i]["A"].ToString()),
|
||||||
// FirstData = getdecimalData(dataTable.Rows[i]["B"].ToString()),
|
FirstData = getdecimalData(dataTable.Rows[i]["B"].ToString()),
|
||||||
|
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
// catch (Exception)
|
catch (Exception)
|
||||||
// {
|
{
|
||||||
|
|
||||||
// errorRow.Add(i + 1);
|
errorRow.Add(i+1);
|
||||||
// }
|
}
|
||||||
|
|
||||||
//}
|
}
|
||||||
|
|
||||||
//measuredValueList = measuredValueList.OrderBy(x => x.PlaqueNum).ToList();
|
measuredValueList = measuredValueList.OrderBy(x => x.PlaqueNum).ToList();
|
||||||
|
|
||||||
//if (errorRow.Count() > 0)
|
if (errorRow.Count() > 0)
|
||||||
//{
|
{
|
||||||
// var errorRows = string.Join(',', errorRow.Select(i => i.ToString()));
|
var errorRows = string.Join(',', errorRow.Select(i => i.ToString()));
|
||||||
// throw new BusinessValidationFailedException(_localizer["Service_TemplateException", errorRows]);
|
throw new BusinessValidationFailedException(_localizer["Service_TemplateException", errorRows]);
|
||||||
//}
|
}
|
||||||
|
|
||||||
|
|
||||||
//List<int> nums = new List<int>() { 1, 2, 3 };
|
List<int> nums = new List<int>() { 1, 2, 3 };
|
||||||
//if (measuredValueList.Any(x => !nums.Contains(x.PlaqueNum)))
|
if (measuredValueList.Any(x => !nums.Contains(x.PlaqueNum)))
|
||||||
//{
|
{
|
||||||
// throw new BusinessValidationFailedException(_localizer["IVUSOCT_PlaqueNum123"]);
|
throw new BusinessValidationFailedException(_localizer["IVUSOCT_PlaqueNum123"]);
|
||||||
//}
|
}
|
||||||
|
|
||||||
|
|
||||||
//foreach (var item in measuredValueList)
|
foreach (var item in measuredValueList)
|
||||||
//{
|
{
|
||||||
// if (item.FirstData > 360)
|
if (item.FirstData > 360)
|
||||||
// {
|
{
|
||||||
// throw new BusinessValidationFailedException(_localizer["IVUS_LipidAngleLess360"]);
|
throw new BusinessValidationFailedException(_localizer["IVUS_LipidAngleLess360"]);
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
|
|
||||||
//var questionInfo = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId && x.LesionType == LesionType.LipidAngle).FirstNotNullAsync();
|
var questionInfo = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId && x.LesionType == LesionType.LipidAngle).FirstNotNullAsync();
|
||||||
//var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == questionInfo.Id).ToListAsync();
|
var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == questionInfo.Id).ToListAsync();
|
||||||
//List<ReadingTableAnswerRowInfo> tableAnsweRowInfos = new List<ReadingTableAnswerRowInfo>();
|
List<ReadingTableAnswerRowInfo> tableAnsweRowInfos = new List<ReadingTableAnswerRowInfo>();
|
||||||
//List<ReadingTableQuestionAnswer> tableAnswers = new List<ReadingTableQuestionAnswer>();
|
List<ReadingTableQuestionAnswer> tableAnswers = new List<ReadingTableQuestionAnswer>();
|
||||||
|
|
||||||
//var maxnum = 0;
|
var maxnum = 0;
|
||||||
|
|
||||||
|
|
||||||
//foreach (var item in measuredValueList)
|
foreach (var item in measuredValueList)
|
||||||
//{
|
{
|
||||||
// maxnum = maxnum + 1;
|
maxnum = maxnum + 1;
|
||||||
// var newRowId = NewId.NextGuid();
|
var newRowId = NewId.NextGuid();
|
||||||
// // 斑块数据统计
|
// 斑块数据统计
|
||||||
// tableAnsweRowInfos.Add(new ReadingTableAnswerRowInfo()
|
tableAnsweRowInfos.Add(new ReadingTableAnswerRowInfo()
|
||||||
// {
|
{
|
||||||
// Id = newRowId,
|
Id = newRowId,
|
||||||
// QuestionId = questionInfo.Id,
|
QuestionId = questionInfo.Id,
|
||||||
// VisitTaskId = taskinfo.Id,
|
VisitTaskId = taskinfo.Id,
|
||||||
// TrialId = taskinfo.TrialId,
|
TrialId = taskinfo.TrialId,
|
||||||
// RowIndex = maxnum,
|
RowIndex = maxnum,
|
||||||
// IsCurrentTaskAdd = true,
|
IsCurrentTaskAdd = true,
|
||||||
// BlindName = taskinfo.TaskBlindName,
|
BlindName = taskinfo.TaskBlindName,
|
||||||
// OrderMark = questionInfo.OrderMark,
|
OrderMark = questionInfo.OrderMark,
|
||||||
// FristAddTaskId = taskinfo.Id,
|
FristAddTaskId = taskinfo.Id,
|
||||||
// RowMark = questionInfo.OrderMark + decimal.Parse(maxnum.ToString()).GetLesionMark()
|
RowMark = questionInfo.OrderMark + decimal.Parse(maxnum.ToString()).GetLesionMark()
|
||||||
// });
|
});
|
||||||
|
|
||||||
// // 编号
|
// 编号
|
||||||
// tableAnswers.Add(new ReadingTableQuestionAnswer()
|
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||||
// {
|
{
|
||||||
// Answer = item.PlaqueNum.ToString(),
|
Answer = item.PlaqueNum.ToString(),
|
||||||
// QuestionId = questionInfo.Id,
|
QuestionId = questionInfo.Id,
|
||||||
// TrialId = taskinfo.TrialId,
|
TrialId = taskinfo.TrialId,
|
||||||
// VisitTaskId = taskinfo.Id,
|
VisitTaskId = taskinfo.Id,
|
||||||
// RowId = newRowId,
|
RowId = newRowId,
|
||||||
// RowIndex = maxnum,
|
RowIndex = maxnum,
|
||||||
// TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.PlaqueNumber).Select(x => x.Id).FirstOrDefault(),
|
TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.PlaqueNumber).Select(x => x.Id).FirstOrDefault(),
|
||||||
// });
|
});
|
||||||
|
|
||||||
// var avg = item.Avg.ToString();
|
var avg = item.Avg.ToString();
|
||||||
|
|
||||||
|
|
||||||
// if (taskinfo.TrialReadingCriterion.DigitPlaces != -1)
|
if (taskinfo.TrialReadingCriterion.DigitPlaces != -1)
|
||||||
// {
|
{
|
||||||
// avg = decimal.Round(decimal.Parse(avg ?? "0"), digitPlaces, MidpointRounding.AwayFromZero).ToString("F" + digitPlaces.ToString());
|
avg = decimal.Round(decimal.Parse(avg ?? "0"), digitPlaces, MidpointRounding.AwayFromZero).ToString("F" + digitPlaces.ToString());
|
||||||
|
|
||||||
// }
|
}
|
||||||
|
|
||||||
// // 脂质角度
|
// 脂质角度
|
||||||
// tableAnswers.Add(new ReadingTableQuestionAnswer()
|
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||||
// {
|
{
|
||||||
// Answer = item.FirstData.ToString(),
|
Answer = item.FirstData.ToString(),
|
||||||
// QuestionId = questionInfo.Id,
|
QuestionId = questionInfo.Id,
|
||||||
// TrialId = taskinfo.TrialId,
|
TrialId = taskinfo.TrialId,
|
||||||
// VisitTaskId = taskinfo.Id,
|
VisitTaskId = taskinfo.Id,
|
||||||
// RowId = newRowId,
|
RowId = newRowId,
|
||||||
// RowIndex = maxnum,
|
RowIndex = maxnum,
|
||||||
// TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.LipidAngle).Select(x => x.Id).FirstOrDefault(),
|
TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.LipidAngle).Select(x => x.Id).FirstOrDefault(),
|
||||||
// });
|
});
|
||||||
|
|
||||||
// // 添加其他问题答案
|
// 添加其他问题答案
|
||||||
// foreach (var otherQuestion in tableQuestionList.Where(x => !tableAnswers.Any(y => y.TableQuestionId == x.Id && y.RowId == newRowId)))
|
foreach (var otherQuestion in tableQuestionList.Where(x => !tableAnswers.Any(y => y.TableQuestionId == x.Id && y.RowId == newRowId)))
|
||||||
// {
|
{
|
||||||
// tableAnswers.Add(new ReadingTableQuestionAnswer()
|
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||||
// {
|
{
|
||||||
// Answer = string.Empty,
|
Answer = string.Empty,
|
||||||
// QuestionId = questionInfo.Id,
|
QuestionId = questionInfo.Id,
|
||||||
// TrialId = taskinfo.TrialId,
|
TrialId = taskinfo.TrialId,
|
||||||
// VisitTaskId = taskinfo.Id,
|
VisitTaskId = taskinfo.Id,
|
||||||
// RowId = newRowId,
|
RowId = newRowId,
|
||||||
// RowIndex = maxnum,
|
RowIndex = maxnum,
|
||||||
// TableQuestionId = otherQuestion.Id,
|
TableQuestionId = otherQuestion.Id,
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
//await _readingTableAnswerRowInfoRepository.DeleteFromQueryAsync(x => x.QuestionId == questionInfo.Id && x.VisitTaskId == taskinfo.Id);
|
await _readingTableAnswerRowInfoRepository.DeleteFromQueryAsync(x => x.QuestionId == questionInfo.Id && x.VisitTaskId == taskinfo.Id);
|
||||||
//await _readingTableQuestionAnswerRepository.DeleteFromQueryAsync(x => x.QuestionId == questionInfo.Id && x.VisitTaskId == taskinfo.Id);
|
await _readingTableQuestionAnswerRepository.DeleteFromQueryAsync(x => x.QuestionId == questionInfo.Id && x.VisitTaskId == taskinfo.Id);
|
||||||
//await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
||||||
//await _readingTableAnswerRowInfoRepository.AddRangeAsync(tableAnsweRowInfos);
|
await _readingTableAnswerRowInfoRepository.AddRangeAsync(tableAnsweRowInfos);
|
||||||
//await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers);
|
await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers);
|
||||||
//await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
||||||
|
|
||||||
//await this.CalculateTask(new CalculateTaskInDto()
|
await this.CalculateTask(new CalculateTaskInDto()
|
||||||
//{
|
{
|
||||||
|
|
||||||
// VisitTaskId = taskinfo.Id,
|
|
||||||
//});
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
VisitTaskId = taskinfo.Id,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -849,48 +824,23 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
ComputationTrigger.SaveEICRFQuestions,
|
ComputationTrigger.SaveEICRFQuestions,
|
||||||
|
|
||||||
};
|
};
|
||||||
//if (!computationTriggers.Contains(inDto.ComputationTrigger))
|
if (!computationTriggers.Contains(inDto.ComputationTrigger))
|
||||||
//{
|
{
|
||||||
// // 计算斑块统计数据
|
// 计算斑块统计数据
|
||||||
// await this.CalculatePatchDataStatistics(inDto);
|
await this.CalculatePatchDataStatistics(inDto);
|
||||||
// inDto = await _generalCalculateService.GetReadingCalculateDto(inDto.VisitTaskId);
|
inDto = await _generalCalculateService.GetReadingCalculateDto(inDto.VisitTaskId);
|
||||||
//}
|
}
|
||||||
|
|
||||||
List<ReadingCalculateData> calculateList = new List<ReadingCalculateData>()
|
List<ReadingCalculateData> calculateList = new List<ReadingCalculateData>()
|
||||||
{
|
{
|
||||||
//// 斑块1-匹配动脉段最小FCT
|
// 斑块1-匹配动脉段最小FCT
|
||||||
//new ReadingCalculateData (){QuestionType=QuestionType.Plaque1MinFCT,GetDecimalNullFun=GetPlaque1MinFCT},
|
new ReadingCalculateData (){QuestionType=QuestionType.Plaque1MinFCT,GetDecimalNullFun=GetPlaque1MinFCT},
|
||||||
|
|
||||||
// // 斑块2-匹配动脉段最小FCT
|
// 斑块2-匹配动脉段最小FCT
|
||||||
//new ReadingCalculateData (){QuestionType=QuestionType.Plaque2MinFCT,GetDecimalNullFun=GetPlaque2MinFCT},
|
new ReadingCalculateData (){QuestionType=QuestionType.Plaque2MinFCT,GetDecimalNullFun=GetPlaque2MinFCT},
|
||||||
|
|
||||||
// // 斑块3-匹配动脉段最小FCT
|
// 斑块3-匹配动脉段最小FCT
|
||||||
//new ReadingCalculateData (){QuestionType=QuestionType.Plaque3MinFCT,GetDecimalNullFun=GetPlaque3MinFCT},
|
new ReadingCalculateData (){QuestionType=QuestionType.Plaque3MinFCT,GetDecimalNullFun=GetPlaque3MinFCT},
|
||||||
|
|
||||||
|
|
||||||
// 匹配动脉段最小FCT
|
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.MatchingTheMinimumFCT,GetDecimalNullFun=GetMinFCT},
|
|
||||||
|
|
||||||
// 平均最小FCT
|
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.AvgMinFCT,GetDecimalNullFun=GetAvgFCT},
|
|
||||||
|
|
||||||
// 脂质角度平均值
|
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.AvgLipidAngle,GetDecimalNullFun=GetAvgLipidAngle},
|
|
||||||
|
|
||||||
// 脂质角度最大值
|
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.MaxLipidAngle,GetDecimalNullFun=GetMaxLipidAngle},
|
|
||||||
|
|
||||||
//巨噬细胞浸润测量
|
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.MacrophageInfiltrationMeasurement,GetStringFun=GetMacrophageInfiltration},
|
|
||||||
|
|
||||||
//巨噬细胞浸润角度测量
|
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.MacrophageInfiltrationAngle,GetStringFun=GetMacrophageExtensionAngle},
|
|
||||||
|
|
||||||
//微通道测量
|
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.MicrochannelMeasurement,GetStringFun=GetMicrochannels},
|
|
||||||
|
|
||||||
//胆固醇结晶测量
|
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.CholesterolCrystalMeasurement,GetStringFun=GetCholesterolCrystallization},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -992,7 +942,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
public async Task CalculatePatchDataStatistics(ReadingCalculateDto inDto)
|
public async Task CalculatePatchDataStatistics(ReadingCalculateDto inDto)
|
||||||
{
|
{
|
||||||
// FCT 问题信息
|
// FCT 问题信息
|
||||||
var fCTQuestionInfo = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.ROI).FirstOrDefault();
|
var fCTQuestionInfo = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.FCT).FirstOrDefault();
|
||||||
|
|
||||||
List<OCTInfo> oCTFCTInfos=new List<OCTInfo> ();
|
List<OCTInfo> oCTFCTInfos=new List<OCTInfo> ();
|
||||||
|
|
||||||
|
|
@ -1270,123 +1220,6 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
.Where(x => x.QuestionMark == QuestionMark.MiniMumFCT).Select(x => x.Answer).FirstIsNullReturnEmpty().IsNullOrEmptyReturnNull();
|
.Where(x => x.QuestionMark == QuestionMark.MiniMumFCT).Select(x => x.Answer).FirstIsNullReturnEmpty().IsNullOrEmptyReturnNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 匹配动脉段最小FCT (平均值的最小值)
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inDto"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<decimal?> GetMinFCT(ReadingCalculateDto inDto)
|
|
||||||
{
|
|
||||||
return inDto.QuestionInfo.Where(x => x.LesionType == LesionType.ROI).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
|
||||||
.Where(x => x.QuestionMark == QuestionMark.AvgFCT).Select(x => x.Answer.IsNullOrEmptyReturn0()).MinOrDefault();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 平均最小FCT (平均值的平均值)
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inDto"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<decimal?> GetAvgFCT(ReadingCalculateDto inDto)
|
|
||||||
{
|
|
||||||
return inDto.QuestionInfo.Where(x => x.LesionType == LesionType.ROI).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
|
||||||
.Where(x => x.QuestionMark == QuestionMark.AvgFCT).Select(x => x.Answer.IsNullOrEmptyReturn0()).DefaultIfEmpty(0).Average();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 脂质角度平均值
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inDto"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<decimal?> GetAvgLipidAngle(ReadingCalculateDto inDto)
|
|
||||||
{
|
|
||||||
return inDto.QuestionInfo.Where(x => x.LesionType == LesionType.ROI).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
|
||||||
.Where(x => x.QuestionMark == QuestionMark.LipidAngle).Select(x => x.Answer.IsNullOrEmptyReturn0()).DefaultIfEmpty(0).Average();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 脂质角度最大
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inDto"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<decimal?> GetMaxLipidAngle(ReadingCalculateDto inDto)
|
|
||||||
{
|
|
||||||
return inDto.QuestionInfo.Where(x => x.LesionType == LesionType.ROI).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
|
||||||
.Where(x => x.QuestionMark == QuestionMark.LipidAngle).Select(x => x.Answer.IsNullOrEmptyReturn0()).MaxOrDefault();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<List<OCTInfo>> GetOCTInfo(ReadingCalculateDto inDto)
|
|
||||||
{
|
|
||||||
var fCTQuestionInfo = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.ROI).FirstOrDefault();
|
|
||||||
List<OCTInfo> oCTFCTInfos = new List<OCTInfo>();
|
|
||||||
foreach (var item in fCTQuestionInfo!.TableRowInfoList)
|
|
||||||
{
|
|
||||||
oCTFCTInfos.Add(new OCTInfo()
|
|
||||||
{
|
|
||||||
|
|
||||||
// Data = item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.AvgFCT).Select(x => decimal.Parse(x.Answer)).FirstOrDefault(),
|
|
||||||
MacrophageInfiltrationMeasurement = item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.MacrophageInfiltrationMeasurement).Select(x => x.Answer).FirstOrDefault() ?? string.Empty,
|
|
||||||
MacrophageInfiltrationAngle = item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.MacrophageInfiltrationAngle).Select(x => x.Answer.IsNullOrEmptyReturnNull()).FirstOrDefault(),
|
|
||||||
MicrochannelMeasurement = item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.MicrochannelMeasurement).Select(x => x.Answer).FirstOrDefault() ?? string.Empty,
|
|
||||||
CholesterolCrystalMeasurement = item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.CholesterolCrystalMeasurement).Select(x => x.Answer).FirstOrDefault() ?? string.Empty,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return oCTFCTInfos;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取巨噬细胞浸润测量
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inDto"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<string> GetMacrophageInfiltration(ReadingCalculateDto inDto)
|
|
||||||
{
|
|
||||||
List<OCTInfo> oCTFCTInfos = await GetOCTInfo(inDto);
|
|
||||||
return oCTFCTInfos.Any(x => x.MacrophageInfiltrationMeasurement != string.Empty) ?
|
|
||||||
oCTFCTInfos.Any(x => x.MacrophageInfiltrationMeasurement.EqEnum(IsPresent.Existence)) ? IsPresent.Existence.GetEnumInt() : IsPresent.NonExistence.GetEnumInt()
|
|
||||||
: IsPresent.NonExistence.GetEnumInt();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 巨噬细胞浸润角度测量
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inDto"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<string> GetMacrophageExtensionAngle(ReadingCalculateDto inDto)
|
|
||||||
{
|
|
||||||
List<OCTInfo> oCTFCTInfos = await GetOCTInfo(inDto);
|
|
||||||
return oCTFCTInfos.Where(x =>x.MacrophageInfiltrationAngle != null).Count() == 0 ? string.Empty : oCTFCTInfos.Max(x => x.MacrophageInfiltrationAngle ?? 0).ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取微通道汇总
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inDto"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<string> GetMicrochannels(ReadingCalculateDto inDto)
|
|
||||||
{
|
|
||||||
List<OCTInfo> oCTFCTInfos = await GetOCTInfo(inDto);
|
|
||||||
return oCTFCTInfos.Any(x => x.MicrochannelMeasurement != string.Empty) ?
|
|
||||||
oCTFCTInfos.Any(x => x.MicrochannelMeasurement.EqEnum(IsPresent.Existence)) ? IsPresent.Existence.GetEnumInt() : IsPresent.NonExistence.GetEnumInt()
|
|
||||||
: IsPresent.NonExistence.GetEnumInt();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取胆固醇结晶汇总
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inDto"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<string> GetCholesterolCrystallization(ReadingCalculateDto inDto)
|
|
||||||
{
|
|
||||||
List<OCTInfo> oCTFCTInfos = await GetOCTInfo(inDto);
|
|
||||||
return oCTFCTInfos.Any(x => x.CholesterolCrystalMeasurement != string.Empty) ?
|
|
||||||
oCTFCTInfos.Any(x => x.CholesterolCrystalMeasurement.EqEnum(IsPresent.Existence)) ? IsPresent.Existence.GetEnumInt() : IsPresent.NonExistence.GetEnumInt()
|
|
||||||
: IsPresent.NonExistence.GetEnumInt();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 验证访视提交
|
/// 验证访视提交
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -1396,7 +1229,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
{
|
{
|
||||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.Subject).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
|
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.Subject).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
|
||||||
|
|
||||||
var question = await _readingQuestionTrialRepository.Where(x => x.LesionType == LesionType.ROI && x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId).FirstNotNullAsync();
|
var question = await _readingQuestionTrialRepository.Where(x => x.LesionType == LesionType.PatchDataStatistics && x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId).FirstNotNullAsync();
|
||||||
|
|
||||||
|
|
||||||
var tableQuestions = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId== question.Id)
|
var tableQuestions = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId== question.Id)
|
||||||
|
|
@ -1428,7 +1261,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
public async Task<decimal?> GetAllMinFCT(ReadingCalculateDto inDto)
|
public async Task<decimal?> GetAllMinFCT(ReadingCalculateDto inDto)
|
||||||
{
|
{
|
||||||
|
|
||||||
var allMinFCT = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.ROI).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
var allMinFCT = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.FCT).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
||||||
.Where(x => x.QuestionMark == QuestionMark.MinFCT).Select(x => x.Answer.IsNullOrEmptyReturn0()).MinOrDefault();
|
.Where(x => x.QuestionMark == QuestionMark.MinFCT).Select(x => x.Answer.IsNullOrEmptyReturn0()).MinOrDefault();
|
||||||
if (allMinFCT == 0)
|
if (allMinFCT == 0)
|
||||||
{
|
{
|
||||||
|
|
@ -1444,7 +1277,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<decimal?> GetAvgMinFCT(ReadingCalculateDto inDto)
|
public async Task<decimal?> GetAvgMinFCT(ReadingCalculateDto inDto)
|
||||||
{
|
{
|
||||||
var allMinFCT = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.ROI).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
var allMinFCT = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.FCT).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
||||||
.Where(x => x.QuestionMark == QuestionMark.MinFCT).Select(x => x.Answer.IsNullOrEmptyReturn0()).ToList();
|
.Where(x => x.QuestionMark == QuestionMark.MinFCT).Select(x => x.Answer.IsNullOrEmptyReturn0()).ToList();
|
||||||
if (allMinFCT.Count() == 0)
|
if (allMinFCT.Count() == 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -42,9 +42,9 @@ public class TrialStatService(
|
||||||
{
|
{
|
||||||
UploadedCount = t.SubjectVisitList.Where(t => inQuery.TrialSiteId != null ? t.TrialSiteId == inQuery.TrialSiteId : true)
|
UploadedCount = t.SubjectVisitList.Where(t => inQuery.TrialSiteId != null ? t.TrialSiteId == inQuery.TrialSiteId : true)
|
||||||
.Where(t => t.SubmitState == SubmitStateEnum.Submitted).Count(),
|
.Where(t => t.SubmitState == SubmitStateEnum.Submitted).Count(),
|
||||||
QCFinishedCount = t.QCProcessEnum == TrialQCProcess.NotAudit ? null : t.SubjectVisitList.Where(t => inQuery.TrialSiteId != null ? t.TrialSiteId == inQuery.TrialSiteId : true)
|
QCFinishedCount = t.SubjectVisitList.Where(t => inQuery.TrialSiteId != null ? t.TrialSiteId == inQuery.TrialSiteId : true)
|
||||||
.Where(t => t.AuditState == AuditStateEnum.QCPassed || t.AuditState == AuditStateEnum.QCFailed).Count(),
|
.Where(t => t.AuditState == AuditStateEnum.QCPassed || t.AuditState == AuditStateEnum.QCFailed).Count(),
|
||||||
CheckFinishedCount = t.IsImageConsistencyVerification == false ? null : t.SubjectVisitList.Where(t => inQuery.TrialSiteId != null ? t.TrialSiteId == inQuery.TrialSiteId : true)
|
CheckFinishedCount = t.SubjectVisitList.Where(t => inQuery.TrialSiteId != null ? t.TrialSiteId == inQuery.TrialSiteId : true)
|
||||||
.Where(t => t.CheckState == CheckStateEnum.CVPassed).Count(),
|
.Where(t => t.CheckState == CheckStateEnum.CVPassed).Count(),
|
||||||
|
|
||||||
CriterionList = t.TrialReadingCriterionList.Where(t => inQuery.TrialReadingCriterionId != null ? t.Id == inQuery.TrialReadingCriterionId : true)
|
CriterionList = t.TrialReadingCriterionList.Where(t => inQuery.TrialReadingCriterionId != null ? t.Id == inQuery.TrialReadingCriterionId : true)
|
||||||
|
|
|
||||||
|
|
@ -54,11 +54,6 @@ namespace IRaCIS.Core.Domain.Share
|
||||||
/// </summary>
|
/// </summary>
|
||||||
OCT_LipidAngle = 2,
|
OCT_LipidAngle = 2,
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ROI
|
|
||||||
/// </summary>
|
|
||||||
ROI = 3,
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -2043,11 +2038,6 @@ namespace IRaCIS.Core.Domain.Share
|
||||||
/// </summary>
|
/// </summary>
|
||||||
PAV = 103,
|
PAV = 103,
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ROI测量值
|
|
||||||
/// </summary>
|
|
||||||
ROI = 104,
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 脂质角度
|
/// 脂质角度
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -2980,76 +2970,6 @@ namespace IRaCIS.Core.Domain.Share
|
||||||
/// </summary>
|
/// </summary>
|
||||||
TargetSegmentRemarks = 1012,
|
TargetSegmentRemarks = 1012,
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ROI起始回撤距离
|
|
||||||
/// </summary>
|
|
||||||
ROIStart = 1013,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ROI终止回撤距离
|
|
||||||
/// </summary>
|
|
||||||
ROIEnd = 1014,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ROI段落总长度
|
|
||||||
/// </summary>
|
|
||||||
ROIAllLength = 1015,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// PAV(冠状动脉粥样硬化体积百分比)
|
|
||||||
/// </summary>
|
|
||||||
PAV =1019,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// EEM求和
|
|
||||||
/// </summary>
|
|
||||||
EEMSum = 1020,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// (EEM-Lumen)求和
|
|
||||||
/// </summary>
|
|
||||||
EEMSubLumenSum = 1021,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 匹配动脉段最小FCT
|
|
||||||
/// </summary>
|
|
||||||
MatchingTheMinimumFCT = 1022,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 平均最小FCT
|
|
||||||
/// </summary>
|
|
||||||
AvgMinFCT = 1023,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 脂质角度平均值
|
|
||||||
/// </summary>
|
|
||||||
AvgLipidAngle = 1024,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 脂质角度最大值
|
|
||||||
/// </summary>
|
|
||||||
MaxLipidAngle = 1025,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 巨噬细胞浸润测量
|
|
||||||
/// </summary>
|
|
||||||
MacrophageInfiltrationMeasurement = 1026,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 巨噬细胞浸润角度测量
|
|
||||||
/// </summary>
|
|
||||||
MacrophageInfiltrationAngle = 1027,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 微通道测量
|
|
||||||
/// </summary>
|
|
||||||
MicrochannelMeasurement = 1028,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 胆固醇结晶测量
|
|
||||||
/// </summary>
|
|
||||||
CholesterolCrystalMeasurement = 1029,
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 脂肪分数总平均值
|
/// 脂肪分数总平均值
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue