From 719e975a71fd84706e96c93f69e05e1ed05f4ff9 Mon Sep 17 00:00:00 2001
From: he <10978375@qq.com>
Date: Fri, 10 Mar 2023 15:46:40 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E7=89=88?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Reading/Dto/ReadingImageTaskViewModel.cs | 4 +++-
.../Reading/Dto/ReadingQuestionViewModel.cs | 19 +++++++++++++++++
.../ReadingQuestionService.cs | 21 +++++++++++++++----
.../ReadingImageTaskService.cs | 16 +++++++-------
.../ReadingTaskQuestionService.cs | 2 +-
.../Service/Reading/_MapConfig.cs | 4 +++-
.../ReadingCalculate/PCWG3CalculateService.cs | 3 ++-
.../RECIST1Point1CalculateService.cs | 3 ++-
.../SelfDefineCalculateService.cs | 3 ++-
.../Service/TrialSiteUser/_MapConfig.cs | 1 +
.../ReadingQuestionSystem.cs | 11 ++++++++++
.../ReadingQuestionTrial.cs | 9 ++++++++
12 files changed, 78 insertions(+), 18 deletions(-)
diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs
index 71ed7d21d..f8cbfe134 100644
--- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs
+++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs
@@ -40,6 +40,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public Guid TableQuestionId { get; set; }
+ public Guid? GroupId { get; set; }
+
public int ShowOrder { get; set; }
@@ -2207,8 +2209,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public Guid Id { get; set; }
+ public Guid? GroupId { get; set; }
-
///
/// 数据列
diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs
index d87998f20..c74cfbc3e 100644
--- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs
+++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs
@@ -766,6 +766,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public string GroupName { get; set; }
+
+ public Guid? GroupId { get; set; }
+
///
/// 全局阅片显示类型
///
@@ -1035,6 +1038,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
///
public string GroupName { get; set; }
+ public Guid? GroupId { get; set; }
+
///
/// 问题类型
@@ -1299,6 +1304,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public string TypeValue { get; set; }
public string GroupName { get; set; }
+
+ public Guid? GroupId { get; set; }
}
public class SetTrialQuestionIsIsJudgeQuestionInDto
@@ -1362,6 +1369,14 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
}
+ public class GetTrialGroupNameOutDto
+ {
+ public Guid GroupId { get; set; }
+
+ public string GroupName { get; set; } = string.Empty;
+
+
+ }
public class GetTrialGroupNameListInDto
{
///
@@ -1535,6 +1550,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
///
public string GroupName { get; set; }
+ public Guid? GroupId { get; set; }
+
///
/// Id
///
@@ -1724,6 +1741,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
///
public string GroupName { get; set; }
+ public Guid? GroupId { get; set; }
+
///
/// 答案分组
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs
index 7e3602572..ea4523b69 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs
@@ -203,10 +203,14 @@ namespace IRaCIS.Application.Services
///
///
[HttpPost]
- public async Task> GetSystemGroupNameList(GetTrialGroupNameListInDto inDto)
+ public async Task> GetSystemGroupNameList(GetTrialGroupNameListInDto inDto)
{
var result = await _readingQuestionSystemRepository.Where(x => x.ReadingQuestionCriterionSystemId == inDto.CriterionId && x.Type == ReadingQestionType.Group).OrderBy(t=>t.ShowOrder)
- .Select(x => x.GroupName).ToListAsync();
+ .Select(x => new GetTrialGroupNameOutDto() {
+ GroupId=x.Id,
+ GroupName=x.GroupName,
+
+ } ).ToListAsync();
return result;
}
@@ -250,6 +254,7 @@ namespace IRaCIS.Application.Services
QuestionName = x.QuestionName.LanguageName(x.QuestionEnName,_userInfo.IsEn_Us),
TypeValue = x.TypeValue,
GroupName = x.GroupName,
+ GroupId=x.GroupId,
}).ToListAsync();
return questionList;
@@ -590,11 +595,15 @@ namespace IRaCIS.Application.Services
///
///
[HttpPost]
- public async Task> GetTrialGroupNameList(GetTrialGroupNameListInDto inDto)
+ public async Task> GetTrialGroupNameList(GetTrialGroupNameListInDto inDto)
{
var result = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == inDto.CriterionId && x.Type == ReadingQestionType.Group)
.Where(x => x.ReadingCriterionPageId == inDto.ReadingCriterionPageId).OrderBy(t => t.ShowOrder)
- .Select(x =>x.GroupName).ToListAsync();
+ .Select(x => new GetTrialGroupNameOutDto
+ {
+ GroupId=x.Id,
+ GroupName=x.GroupName,
+ }).ToListAsync();
return result;
@@ -867,6 +876,10 @@ namespace IRaCIS.Application.Services
{
question.ParentId = questionRelation[question.ParentId??default(Guid)];
}
+ if (question.GroupId != null)
+ {
+ question.GroupId = questionRelation[question.GroupId ?? default(Guid)];
+ }
if (question.RelevanceId != null)
{
question.RelevanceId = questionRelation[question.RelevanceId ?? default(Guid)];
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs
index 978c0a632..00f209669 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs
@@ -575,9 +575,9 @@ namespace IRaCIS.Application.Services
//排除表格问题 同时排除组问题
- var groups = questions.Where(x => x.Type != ReadingQestionType.Group).Select(x => x.GroupName).ToList();
+ var groupids = questions.Where(x => x.Type != ReadingQestionType.Group).Select(x => x.GroupId).ToList();
- var result = questions.Where(x => x.Type == ReadingQestionType.Group && groups.Contains(x.GroupName)).ToList();
+ var result = questions.Where(x => x.Type == ReadingQestionType.Group && groupids.Contains(x.Id)).ToList();
foreach (var item in result)
{
@@ -593,7 +593,7 @@ namespace IRaCIS.Application.Services
item.Answer = answer.IsNullOrEmpty() ? item.DefaultValue : answer;
- item.Childrens = questions.Where(x => x.ParentId == item.Id || ((item.Type == ReadingQestionType.Group && x.Type != ReadingQestionType.Group && x.ParentId == null && x.GroupName == item.GroupName))).ToList();
+ item.Childrens = questions.Where(x => x.ParentId == item.Id || x.GroupId==item.GroupId).ToList();
if (item.Childrens != null && item.Childrens.Count > 0)
{
foreach (var question in item.Childrens)
@@ -778,8 +778,8 @@ namespace IRaCIS.Application.Services
{
qusetionList = qusetionList.Where(x => x.IsShowInDicom && (x.Type == ReadingQestionType.Table || x.Type == ReadingQestionType.Group)).OrderBy(x => x.ShowOrder).ToList();
}
- var usedGurops = qusetionList.Where(x => x.Type == ReadingQestionType.Table).Select(x => x.GroupName).ToList();
- qusetionList = qusetionList.Where(x => usedGurops.Contains(x.GroupName)).ToList();
+ var usedGuropIds = qusetionList.Where(x => x.Type == ReadingQestionType.Table).Select(x => x.GroupId).ToList();
+ qusetionList = qusetionList.Where(x => usedGuropIds.Contains(x.Id)|| usedGuropIds.Contains(x.GroupId)).ToList();
}
}
@@ -841,7 +841,7 @@ namespace IRaCIS.Application.Services
IsPublicPage = firstData.IsPublicPage,
};
- var pageGroupList = newPageQusetionList.Where(x => x.Type == ReadingQestionType.Group || (x.ParentId == null && x.GroupName.IsNullOrEmpty())).ToList();
+ var pageGroupList = newPageQusetionList.Where(x => x.Type == ReadingQestionType.Group).ToList();
pageGroupList.ForEach(x =>
{
this.FindChildQuestion(x, newPageQusetionList, tableQuestionList, inDto.TableAnswers, inDto.TableAnsweRowInfos,inDto.OrganInfos, baseLineTableAnswer);
@@ -858,7 +858,7 @@ namespace IRaCIS.Application.Services
{
qusetionList = qusetionList.Where(x => x.ReadingCriterionPageId == null).ToList();
- groupList = qusetionList.Where(x => x.Type == ReadingQestionType.Group || (x.ParentId == null && x.GroupName.IsNullOrEmpty())).ToList();
+ groupList = qusetionList.Where(x => x.Type == ReadingQestionType.Group).ToList();
groupList.ForEach(x =>
{
this.FindChildQuestion(x, qusetionList, tableQuestionList, inDto.TableAnswers, inDto.TableAnsweRowInfos, inDto.OrganInfos, baseLineTableAnswer);
@@ -883,7 +883,7 @@ namespace IRaCIS.Application.Services
///
private async void FindChildQuestion(TrialReadQuestionData item, List questionlists, List tableQuestionLists, List tableAnswers, List tableAnsweRowInfos,List organInfos, List baseLineTableAnswer)
{
- item.Childrens = questionlists.Where(x => x.ParentId == item.Id || (item.Type == ReadingQestionType.Group && x.Type != ReadingQestionType.Group && x.ParentId == null && x.GroupName == item.GroupName)).ToList();
+ item.Childrens = questionlists.Where(x => x.ParentId == item.Id ||x.GroupId==item.Id).ToList();
item.TableQuestions = new TrialReadTableQuestion();
item.TableQuestions.Questions = tableQuestionLists.Where(x => x.ReadingQuestionId == item.Id).OrderBy(x => x.ShowOrder).ToList();
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs
index 198ab10c5..cb7a3935e 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs
@@ -159,7 +159,7 @@ namespace IRaCIS.Application.Services
LesionType = data.LesionType,
QuestionGenre = data.QuestionGenre,
DictionaryCode = data.DictionaryCode,
-
+ GroupId=data.GroupId,
ShowOrder = data.ShowOrder,
RelevanceId = data.RelevanceId,
IsShowInDicom = data.IsShowInDicom,
diff --git a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs
index 48bcc3903..d43a4ca0c 100644
--- a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs
+++ b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs
@@ -175,6 +175,7 @@ namespace IRaCIS.Core.Application.Service
CreateMap();
CreateMap()
+ .ForMember(d => d.GroupName, u => u.MapFrom(s => s.GroupInfo==null?s.GroupName:s.GroupInfo.GroupName))
.ForMember(d => d.ParentQuestionName, u => u.MapFrom(s => s.ParentReadingQuestionSystem==null?string.Empty: s.ParentReadingQuestionSystem.QuestionName))
.ForMember(d => d.ParentQuestionShowOrder, u => u.MapFrom(s => s.ParentReadingQuestionSystem.ShowOrder))
.ForMember(d => d.ParentDictionaryCode, u => u.MapFrom(s => s.ParentReadingQuestionSystem.DictionaryCode))
@@ -191,7 +192,8 @@ namespace IRaCIS.Core.Application.Service
CreateMap();
CreateMap()
- .ForMember(d => d.ParentQuestionName, u => u.MapFrom(s => s.ParentReadingQuestionTrial == null ? string.Empty : s.ParentReadingQuestionTrial.QuestionName))
+ .ForMember(d => d.GroupName, u => u.MapFrom(s => s.GroupInfo == null ? s.GroupName : s.GroupInfo.GroupName))
+ .ForMember(d => d.ParentQuestionName, u => u.MapFrom(s => s.ParentReadingQuestionTrial == null ? string.Empty : s.ParentReadingQuestionTrial.QuestionName))
.ForMember(d => d.ParentQuestionShowOrder, u => u.MapFrom(s => s.ParentReadingQuestionTrial.ShowOrder))
.ForMember(d => d.ParentQuestionGenre, u => u.MapFrom(s => s.ParentReadingQuestionTrial.QuestionGenre))
.ForMember(d => d.ParentDictionaryCode, u => u.MapFrom(s => s.ParentReadingQuestionTrial.DictionaryCode))
diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs
index de7e65497..36bec35ac 100644
--- a/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs
+++ b/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs
@@ -155,6 +155,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
GroupEnName=x.GroupEnName,
IsShowInDicom = x.IsShowInDicom,
Type = x.Type,
+ GroupId=x.GroupId,
QuestionType = x.QuestionType,
LesionType = x.LesionType,
QuestionGenre = x.QuestionGenre,
@@ -173,7 +174,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
foreach (var item in questions)
{
// 问题
- item.Childrens = questionList.Where(x => x.GroupName == item.GroupName && x.Type != ReadingQestionType.Group).OrderBy(x => x.ShowOrder).Select(x => new ReadingReportDto()
+ item.Childrens = questionList.Where(x => x.GroupId==item.Id).OrderBy(x => x.ShowOrder).Select(x => new ReadingReportDto()
{
GroupName = x.GroupName,
GroupEnName=x.GroupEnName,
diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs
index 1bd970edb..e0484bd53 100644
--- a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs
+++ b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs
@@ -134,6 +134,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
GroupEnName=x.GroupEnName,
IsShowInDicom = x.IsShowInDicom,
Type = x.Type,
+ GroupId=x.GroupId,
QuestionType = x.QuestionType,
LesionType = x.LesionType,
QuestionGenre = x.QuestionGenre,
@@ -151,7 +152,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
// 分组
foreach (var item in questions)
{
- item.Childrens = questionList.Where(x => x.GroupName == item.GroupName && x.Type != ReadingQestionType.Group).OrderBy(x => x.ShowOrder).Select(x => new ReadingReportDto()
+ item.Childrens = questionList.Where(x => x.GroupId==item.Id).OrderBy(x => x.ShowOrder).Select(x => new ReadingReportDto()
{
GroupName = x.GroupName,
QuestionId = x.Id,
diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/SelfDefineCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/SelfDefineCalculateService.cs
index 0ed8868c8..19896e09f 100644
--- a/IRaCIS.Core.Application/Service/ReadingCalculate/SelfDefineCalculateService.cs
+++ b/IRaCIS.Core.Application/Service/ReadingCalculate/SelfDefineCalculateService.cs
@@ -139,6 +139,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
GroupName = x.GroupName,
IsShowInDicom = x.IsShowInDicom,
Type = x.Type,
+ GroupId=x.GroupId,
GroupEnName=x.GroupEnName,
QuestionType = x.QuestionType,
DataSource= x.DataSource,
@@ -160,7 +161,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
// 分组
foreach (var item in questions)
{
- item.Childrens = questionList.Where(x => x.GroupName == item.GroupName && x.Type != ReadingQestionType.Group).OrderBy(x => x.ShowOrder).Select(x => new ReadingReportDto()
+ item.Childrens = questionList.Where(x => x.GroupId==item.Id).OrderBy(x => x.ShowOrder).Select(x => new ReadingReportDto()
{
GroupName = x.GroupName,
QuestionId = x.Id,
diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/_MapConfig.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/_MapConfig.cs
index 845ce2f0f..e5c12c573 100644
--- a/IRaCIS.Core.Application/Service/TrialSiteUser/_MapConfig.cs
+++ b/IRaCIS.Core.Application/Service/TrialSiteUser/_MapConfig.cs
@@ -245,6 +245,7 @@ namespace IRaCIS.Core.Application.Service
CreateMap()
+ .ForMember(d => d.GroupName, u => u.MapFrom(s => s.GroupInfo == null ? s.GroupName : s.GroupInfo.GroupName))
.ForMember(t => t.PageName, u => u.MapFrom(c => c.ReadingCriterionPage.PageName))
.ForMember(d => d.ParentQuestionGenre, u => u.MapFrom(s => s.ParentReadingQuestionTrial.QuestionGenre))
.ForMember(d => d.ParentDictionaryCode, u => u.MapFrom(s => s.ParentReadingQuestionTrial.DictionaryCode))
diff --git a/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionSystem.cs b/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionSystem.cs
index e8eb0be8b..805bd9a42 100644
--- a/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionSystem.cs
+++ b/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionSystem.cs
@@ -187,11 +187,22 @@ namespace IRaCIS.Core.Domain.Models
///
public int? MaxAnswerLength { get; set; }
+ ///
+ /// 分组ID
+ ///
+ public Guid? GroupId { get; set; }
+
///
/// 文件类型
///
public string? FileType { get; set; }
+
+ [JsonIgnore]
+ [ForeignKey("GroupId")]
+ public ReadingQuestionSystem GroupInfo { get; set; }
+
+
[JsonIgnore]
[ForeignKey("ReadingQuestionCriterionSystemId")]
public ReadingQuestionCriterionSystem ReadingQuestionCriterionSystem { get; set; }
diff --git a/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionTrial.cs b/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionTrial.cs
index 4bb999a83..e3fb96463 100644
--- a/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionTrial.cs
+++ b/IRaCIS.Core.Domain/Reading/ReadingCriterionQuestion/ReadingQuestionTrial.cs
@@ -245,6 +245,15 @@ namespace IRaCIS.Core.Domain.Models
///
public bool IsCopyLesions { get; set; } = false;
+ ///
+ /// 分组ID
+ ///
+ public Guid? GroupId { get; set; }
+
+ [JsonIgnore]
+ [ForeignKey("GroupId")]
+ public ReadingQuestionSystem GroupInfo { get; set; }
+
///
/// 分页标准
///