Compare commits
22 Commits
bbcab237d4
...
67fd739b0e
| Author | SHA1 | Date |
|---|---|---|
|
|
67fd739b0e | |
|
|
083c68b528 | |
|
|
121d3a3e64 | |
|
|
cfa38f2318 | |
|
|
20f87c953c | |
|
|
4f62f2f2d0 | |
|
|
ace5afca66 | |
|
|
3dfffa557a | |
|
|
2c878a90f8 | |
|
|
03b5a01400 | |
|
|
d7e4a810f6 | |
|
|
338ef9d988 | |
|
|
65c67835f2 | |
|
|
d8d9e25191 | |
|
|
3dd7859752 | |
|
|
358699dbd3 | |
|
|
2754973c8d | |
|
|
8865db72d1 | |
|
|
31158fed0e | |
|
|
ae624730aa | |
|
|
3fd299bb49 | |
|
|
9acfc4c544 |
|
|
@ -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,6 +4407,27 @@
|
||||||
<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>
|
||||||
将上一次的访视病灶添加到这一次
|
将上一次的访视病灶添加到这一次
|
||||||
|
|
@ -5984,6 +6005,62 @@
|
||||||
<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>
|
||||||
验证访视提交
|
验证访视提交
|
||||||
|
|
@ -8652,11 +8729,6 @@
|
||||||
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
|
||||||
|
|
@ -8672,11 +8744,6 @@
|
||||||
外弹力膜面积- 管腔面积
|
外弹力膜面积- 管腔面积
|
||||||
</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>
|
||||||
第一次
|
第一次
|
||||||
|
|
@ -8717,6 +8784,11 @@
|
||||||
官腔面积测量
|
官腔面积测量
|
||||||
</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>
|
||||||
斑块编号
|
斑块编号
|
||||||
|
|
@ -16790,17 +16862,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,6 +703,10 @@ public class QCClaimTaskEventConsumer(
|
||||||
|
|
||||||
|
|
||||||
var userinfo = subjectVisit.CurrentActionUser;
|
var userinfo = subjectVisit.CurrentActionUser;
|
||||||
|
if (userinfo == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var messageToSend = new MimeMessage();
|
var messageToSend = new MimeMessage();
|
||||||
//发件地址
|
//发件地址
|
||||||
|
|
|
||||||
|
|
@ -939,7 +939,8 @@ 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.Any(t => t.SubjectId == inQuery.SubjectId && t.Modality == "IVUS"))
|
&& _noneDicomStudyReposiotry.Where(t => t.SubjectId == inQuery.SubjectId && t.Modality == "IVUS").Count() != _dicomStudyRepository.Where(t => t.SubjectId == inQuery.SubjectId).Select(t => t.SubjectVisitId).Distinct().Count()
|
||||||
|
)
|
||||||
{
|
{
|
||||||
#region ivus 自动创建非dicom检查
|
#region ivus 自动创建非dicom检查
|
||||||
|
|
||||||
|
|
@ -957,6 +958,7 @@ 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");
|
||||||
|
|
||||||
|
|
@ -967,10 +969,12 @@ 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.GroupBy(t => t.SubjectVisitId))
|
foreach (var g in addList.Where(t => !noneDicomStudyVisitIdList.Contains(t.SubjectVisitId)).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,6 +8,7 @@ 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;
|
||||||
|
|
@ -114,7 +115,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -154,6 +155,13 @@ 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,11 +244,6 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
|
|
||||||
public class OCTFCTUploadData
|
public class OCTFCTUploadData
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// 斑块编号
|
|
||||||
/// </summary>
|
|
||||||
public int PlaqueNum { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 第一次
|
/// 第一次
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -290,7 +285,10 @@ 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,6 +11,7 @@ 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
|
||||||
{
|
{
|
||||||
|
|
@ -44,7 +45,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
switch (readingImportType)
|
switch (readingImportType)
|
||||||
{
|
{
|
||||||
case ReadingImportType.IVUS_MatchingSegment:
|
case ReadingImportType.ROI:
|
||||||
await UploadIVUSTemplate();
|
await UploadIVUSTemplate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -273,7 +274,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task ReadingCalculate(ReadingCalculateDto inDto, List<QuestionType>? calculateType = null)
|
public async Task ReadingCalculate(ReadingCalculateDto inDto, List<QuestionType>? calculateType = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
#region 计算 这里顺序非常重要 后面计算的值要依赖前面计算的结果
|
#region 计算 这里顺序非常重要 后面计算的值要依赖前面计算的结果
|
||||||
var needAddList = new List<ReadingTaskQuestionAnswer>();
|
var needAddList = new List<ReadingTaskQuestionAnswer>();
|
||||||
|
|
||||||
|
|
@ -284,23 +285,34 @@ 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.Plaque2PVA,GetDecimalNullFun=GetPlaque2PVA},
|
new ReadingCalculateData (){QuestionType=QuestionType.EEMSubLumenSum,GetDecimalNullFun=GetEEMLumenSum},
|
||||||
|
|
||||||
|
// PAV(冠状动脉粥样硬化体积百分比)
|
||||||
|
new ReadingCalculateData (){QuestionType=QuestionType.PAV,GetDecimalNullFun=GetPAV},
|
||||||
|
|
||||||
// 斑块3-PAV
|
|
||||||
new ReadingCalculateData (){QuestionType=QuestionType.Plaque3PVA,GetDecimalNullFun=GetPlaque3PVA},
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -471,9 +483,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]["B"].ToString()),
|
Emm = getdecimalData(dataTable.Rows[i]["A"].ToString()),
|
||||||
Lumen = getdecimalData(dataTable.Rows[i]["C"].ToString()),
|
Lumen = getdecimalData(dataTable.Rows[i]["B"].ToString()),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
|
|
@ -494,15 +506,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.MatchValues).FirstNotNullAsync();
|
var questionInfo = await _readingQuestionTrialRepository.Where(x =>x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId&& x.LesionType == LesionType.ROI).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>();
|
||||||
|
|
@ -530,16 +542,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();
|
||||||
|
|
@ -633,7 +645,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
|
|
||||||
// 测量值集合
|
// 测量值集合
|
||||||
var matchValuesAnswerList = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.MatchValues).SelectMany(x => x.TableRowInfoList).ToList();
|
var matchValuesAnswerList = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.ROI).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();
|
||||||
|
|
@ -651,7 +663,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
{
|
{
|
||||||
var newRowId = NewId.NextGuid();
|
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();
|
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();
|
||||||
|
|
||||||
// 斑块数据统计
|
// 斑块数据统计
|
||||||
tableAnsweRowInfos.Add(new ReadingTableAnswerRowInfo()
|
tableAnsweRowInfos.Add(new ReadingTableAnswerRowInfo()
|
||||||
|
|
@ -834,7 +846,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.PAV && x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId).FirstNotNullAsync();
|
var question = await _readingQuestionTrialRepository.Where(x => x.LesionType == LesionType.ROI && 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)
|
||||||
|
|
@ -891,6 +903,52 @@ 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,6 +1,10 @@
|
||||||
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;
|
||||||
|
|
@ -40,7 +44,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
switch (readingImportType)
|
switch (readingImportType)
|
||||||
{
|
{
|
||||||
case ReadingImportType.OCT_FCT:
|
case ReadingImportType.ROI:
|
||||||
await UploadOCTFCTTemplate();
|
await UploadOCTFCTTemplate();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -332,21 +336,33 @@ 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]["B"].ToString()),
|
FirstData = getdecimalData(dataTable.Rows[i]["A"].ToString()),
|
||||||
SecondData = getdecimalData(dataTable.Rows[i]["C"].ToString()),
|
SecondData = getdecimalData(dataTable.Rows[i]["B"].ToString()),
|
||||||
ThirdData = getdecimalData(dataTable.Rows[i]["D"].ToString()),
|
ThirdData = getdecimalData(dataTable.Rows[i]["C"].ToString()),
|
||||||
MacrophageInfiltrationMeasurement = dataTable.Rows[i]["E"].ToString() ?? string.Empty,
|
MacrophageInfiltrationMeasurement = getNone(dataTable.Rows[i]["D"].ToString()),
|
||||||
MacrophageInfiltrationAngle = getdecimalEmptyData(dataTable.Rows[i]["F"].ToString() ?? string.Empty),
|
MacrophageInfiltrationAngle = getdecimalEmptyData(dataTable.Rows[i]["E"].ToString() ?? string.Empty),
|
||||||
MicrochannelMeasurement =dataTable.Rows[i]["G"].ToString() ?? string.Empty,
|
MicrochannelMeasurement = getNone(dataTable.Rows[i]["F"].ToString()),
|
||||||
CholesterolCrystalMeasurement = dataTable.Rows[i]["H"].ToString() ?? string.Empty,
|
CholesterolCrystalMeasurement = getNone(dataTable.Rows[i]["G"].ToString()),
|
||||||
LumenAreaMeasurement = getdecimalEmptyData(dataTable.Rows[i]["I"].ToString() ?? string.Empty),
|
LumenAreaMeasurement = getdecimalData(dataTable.Rows[i]["H"].ToString()),
|
||||||
|
LipidAngle = getdecimalEmptyData(dataTable.Rows[i]["I"].ToString() ?? string.Empty),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
|
|
@ -356,7 +372,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
measuredValueList = measuredValueList.OrderBy(x => x.PlaqueNum).ToList();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -366,12 +382,6 @@ 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"},
|
||||||
|
|
@ -413,7 +423,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.FCT).FirstNotNullAsync();
|
var questionInfo = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId && x.LesionType == LesionType.ROI).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>();
|
||||||
|
|
@ -442,16 +452,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();
|
||||||
|
|
||||||
|
|
@ -570,6 +580,18 @@ 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)
|
||||||
{
|
{
|
||||||
|
|
@ -636,173 +658,176 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task UploadOCTLipidAngleTemplate()
|
public async Task UploadOCTLipidAngleTemplate()
|
||||||
{
|
{
|
||||||
var request = httpContext.HttpContext!.Request;
|
#region 这个导入没有了 代码全部注释
|
||||||
var file = request.Form.Files[0];
|
//var request = httpContext.HttpContext!.Request;
|
||||||
Guid visitTaskId = Guid.Parse(request.Form["VisitTaskId"]);
|
//var file = request.Form.Files[0];
|
||||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Include(x => x.Subject).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
|
//Guid visitTaskId = Guid.Parse(request.Form["VisitTaskId"]);
|
||||||
var uploadInfo = await _generalCalculateService.GetDataTableFromUpload(file, "OCTLipidAngle", taskinfo.TrialId);
|
//var taskinfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Include(x => x.Subject).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
|
||||||
List<string> sheetNames = new List<string>()
|
//var uploadInfo = await _generalCalculateService.GetDataTableFromUpload(file, "OCTLipidAngle", taskinfo.TrialId);
|
||||||
{
|
//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,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -824,23 +849,48 @@ 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},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -942,7 +992,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.FCT).FirstOrDefault();
|
var fCTQuestionInfo = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.ROI).FirstOrDefault();
|
||||||
|
|
||||||
List<OCTInfo> oCTFCTInfos=new List<OCTInfo> ();
|
List<OCTInfo> oCTFCTInfos=new List<OCTInfo> ();
|
||||||
|
|
||||||
|
|
@ -1220,6 +1270,123 @@ 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>
|
||||||
|
|
@ -1229,7 +1396,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.PatchDataStatistics && x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId).FirstNotNullAsync();
|
var question = await _readingQuestionTrialRepository.Where(x => x.LesionType == LesionType.ROI && 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)
|
||||||
|
|
@ -1261,7 +1428,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.FCT).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
var allMinFCT = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.ROI).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)
|
||||||
{
|
{
|
||||||
|
|
@ -1277,7 +1444,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.FCT).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList)
|
var allMinFCT = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.ROI).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.SubjectVisitList.Where(t => inQuery.TrialSiteId != null ? t.TrialSiteId == inQuery.TrialSiteId : true)
|
QCFinishedCount = t.QCProcessEnum == TrialQCProcess.NotAudit ? null : 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.SubjectVisitList.Where(t => inQuery.TrialSiteId != null ? t.TrialSiteId == inQuery.TrialSiteId : true)
|
CheckFinishedCount = t.IsImageConsistencyVerification == false ? null : 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,6 +54,11 @@ namespace IRaCIS.Core.Domain.Share
|
||||||
/// </summary>
|
/// </summary>
|
||||||
OCT_LipidAngle = 2,
|
OCT_LipidAngle = 2,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ROI
|
||||||
|
/// </summary>
|
||||||
|
ROI = 3,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -2038,6 +2043,11 @@ namespace IRaCIS.Core.Domain.Share
|
||||||
/// </summary>
|
/// </summary>
|
||||||
PAV = 103,
|
PAV = 103,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ROI测量值
|
||||||
|
/// </summary>
|
||||||
|
ROI = 104,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 脂质角度
|
/// 脂质角度
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -2970,6 +2980,76 @@ 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