From c07146e1c72dec59823b9f852574e16b8153b667 Mon Sep 17 00:00:00 2001
From: he <10978375@qq.com>
Date: Tue, 15 Nov 2022 16:09:45 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Reading/Dto/ReadingQuestionViewModel.cs | 59 +++++++++++++++++++
.../ReadingQuestionService.cs | 51 ++++++++++++++++
.../ReadingCalculate/PCWG3CalculateService.cs | 1 +
IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs | 51 ++++++++++++++++
.../ReadingQuestionTrial.cs | 11 ++++
.../ReadingTableQuestionTrial.cs | 10 ++++
6 files changed, 183 insertions(+)
diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs
index 2e75c06f2..b0f0467be 100644
--- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs
+++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs
@@ -272,6 +272,17 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public class ReadingTableQuestionTrialAddOrEdit
{
+
+ ///
+ /// 自定义计算标记
+ ///
+ public CustomCalculateMark? CustomCalculateMark { get; set; }
+
+ ///
+ /// 自定义计算标记
+ ///
+ public string CalculateQuestions { get; set; } = "[]";
+
///
/// 数值类型
///
@@ -803,6 +814,16 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// 单位
///
public ValueUnit? Unit { get; set; }
+
+ ///
+ /// 自定义计算标记
+ ///
+ public CustomCalculateMark? CustomCalculateMark { get; set; }
+
+ ///
+ /// 自定义计算标记
+ ///
+ public string CalculateQuestions { get; set; }
}
public class ReadingQuestionSystemView
@@ -1017,8 +1038,36 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public bool IsJudgeQuestion { get; set; }
}
+ public class GetCalculateQuestionsOutDto
+ {
+ public Guid QuestionId { get; set; }
+
+ public string QuestionName{ get; set; }
+ }
+ public class GetCalculateTableQuestionsOutDto
+ {
+ public Guid TableQuestionId { get; set; }
+
+ public string TableQuestionName { get; set; }
+ }
+
+
+ public class GetCalculateTableQuestionsInDto
+ {
+ [NotDefault]
+ public Guid QuestionId { get; set; }
+
+ }
+
+
+ public class GetCalculateQuestionsInDto
+ {
+ [NotDefault]
+ public Guid TrialCriterionId { get; set; }
+
+ }
public class GetTrialGroupNameListInDto
{
@@ -1449,6 +1498,16 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// 单位
///
public ValueUnit? Unit { get; set; }
+
+ ///
+ /// 自定义计算标记
+ ///
+ public CustomCalculateMark? CustomCalculateMark { get; set; }
+
+ ///
+ /// 自定义计算标记
+ ///
+ public string CalculateQuestions { get; set; } = "[]";
}
public class GetSystemCriterionSelectDto
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs
index 74794b64e..3866620b6 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs
@@ -73,7 +73,58 @@ namespace IRaCIS.Application.Services
this._previousPDFRepository = previousPDFRepository;
}
+ #region 获取计算问题
+ ///
+ /// 获取数值问题
+ ///
+ ///
+ ///
+ public async Task> GetCalculateQuestions(GetCalculateQuestionsInDto inDto)
+ {
+ var result =await _readingQuestionTrialRepository
+
+ .Where(x => x.ReadingQuestionCriterionTrialId == inDto.TrialCriterionId)
+ .Where(x => x.Type == "number")
+ .OrderBy(x => x.ShowOrder)
+ .Select(x => new GetCalculateQuestionsOutDto
+ (){
+ QuestionId = x.Id,
+ QuestionName = x.QuestionName
+
+ }).ToListAsync();
+
+ return result;
+ }
+
+
+ ///
+ /// 获取表格数值问题
+ ///
+ ///
+ ///
+ [HttpPost]
+ public async Task> GetCalculateTableQuestions(GetCalculateTableQuestionsInDto inDto)
+ {
+
+ var result = await _readingTableQuestionTrialRepository
+
+ .Where(x => x.ReadingQuestionId == inDto.QuestionId)
+ .Where(x=>x.Type== "number")
+ .OrderBy(x => x.ShowOrder)
+ .Select(x => new GetCalculateTableQuestionsOutDto
+ ()
+ {
+ TableQuestionId = x.Id,
+ TableQuestionName = x.QuestionName
+
+ }).ToListAsync();
+
+ return result;
+ }
+
+
+ #endregion
#region 系统标准问题
diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs
index b9f4d4ffd..5080c2e2e 100644
--- a/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs
+++ b/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs
@@ -628,6 +628,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
///
public async Task GetBaseLineLesionsCount(ReadingCalculateDto inDto)
{
+
return inDto.QuestionInfo.Where(x => x.LesionType == LesionType.BaselineLesions).SelectMany(x => x.TableRowInfoList)
.Where(x => x.TableQuestionList.Any(y => y.QuestionMark == QuestionMark.State && y.Answer == EvaluationOfState.Exists.GetEnumInt())).Count();
}
diff --git a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs
index 93f35a56d..54c08d2f2 100644
--- a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs
+++ b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs
@@ -16,6 +16,57 @@ namespace IRaCIS.Core.Domain.Share
public static readonly string Group = "group";
}
+ ///
+ /// 自定义计算标记
+ ///
+ public enum CustomCalculateMark
+ {
+
+ ///
+ /// +
+ ///
+ Add = 1,
+
+ ///
+ /// -
+ ///
+ Subtract = 2,
+
+ ///
+ /// ×
+ ///
+ Multiply = 3,
+
+ ///
+ /// ÷
+ ///
+ Divide = 4,
+
+ ///
+ /// ∏ 求积
+ ///
+ Quadrature = 5,
+
+ ///
+ /// ∑
+ ///
+ Sum = 6,
+
+ ///
+ /// Avg
+ ///
+ Avg = 7,
+
+ ///
+ /// Max
+ ///
+ Max = 8,
+
+ ///
+ /// Min
+ ///
+ Min = 9
+ }
///
/// 数值单位
diff --git a/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionTrial.cs b/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionTrial.cs
index 190b46a38..09057b648 100644
--- a/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionTrial.cs
+++ b/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionTrial.cs
@@ -193,6 +193,17 @@ namespace IRaCIS.Core.Domain.Models
///
public ValueUnit? Unit { get; set; }
+
+ ///
+ /// 自定义计算标记
+ ///
+ public CustomCalculateMark? CustomCalculateMark { get; set; }
+
+ ///
+ /// 自定义计算标记
+ ///
+ public string CalculateQuestions { get; set; } = "[]";
+
///
/// 分页标准
///
diff --git a/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingTableQuestionTrial.cs b/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingTableQuestionTrial.cs
index 5526d7574..c4020edf7 100644
--- a/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingTableQuestionTrial.cs
+++ b/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingTableQuestionTrial.cs
@@ -152,6 +152,16 @@ namespace IRaCIS.Core.Domain.Models
///
public ValueUnit? Unit { get; set; }
+ ///
+ /// 自定义计算标记
+ ///
+ public CustomCalculateMark? CustomCalculateMark { get; set; }
+
+ ///
+ /// 自定义计算标记
+ ///
+ public string CalculateQuestions { get; set; } = "[]";
+
[JsonIgnore]
[ForeignKey("DependParentId")]
public ReadingTableQuestionTrial DependParentQuestion { get; set; }