修改导表bug
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
68845ae44b
commit
fc70ec7ad0
|
@ -2386,6 +2386,125 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
fistLeveLNameList = trialConfigQuestionList.Select(t =>
|
||||
(t.QuestionType == QuestionType.ExistDisease || t.QuestionType == QuestionType.Tumor) ? (_userInfo.IsEn_Us ? "Overall Response" : "整体肿瘤评估") : t.QuestionName).Distinct().ToList();
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
else if (criterion.CriterionType == CriterionType.Lugano2014 || criterion.CriterionType == CriterionType.Lugano2014WithoutPET)
|
||||
{
|
||||
fistLeveLNameList = trialConfigQuestionList.Select(t =>
|
||||
(t.QuestionType == QuestionType.ExistDisease || t.QuestionType == QuestionType.ImgOncology) ? (_userInfo.IsEn_Us ? "Overall Response" : "整体肿瘤评估") : t.QuestionName).Distinct().ToList();
|
||||
|
||||
}
|
||||
else if (criterion.CriterionType == CriterionType.PCWG3)
|
||||
{
|
||||
fistLeveLNameList = trialConfigQuestionList.Select(t => t.QuestionName).ToList();
|
||||
}
|
||||
|
||||
var exTralDicNameList = new List<string>() { "LesionType" };
|
||||
|
||||
translateDicNameList = trialConfigQuestionList.Union(trialConfigTableQuestionList).Where(t => t.TranslateDicName.IsNotNullOrEmpty()).Select(t => t.TranslateDicName).Union(exTralDicNameList).Distinct().ToList();
|
||||
}
|
||||
else
|
||||
//非肿瘤评估,非CDISC 导出
|
||||
{
|
||||
fistLeveLNameList = trialConfigQuestionList.Select(t => t.QuestionName).ToList();
|
||||
|
||||
translateDicNameList = trialConfigQuestionList.Union(trialConfigTableQuestionList).Where(t => t.TranslateDicName.IsNotNullOrEmpty()).Select(t => t.TranslateDicName).Distinct().ToList();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 表格问题 处理增加列
|
||||
|
||||
//肿瘤 表格问题直接去重、同时添加一些列 外层问题合并一些列
|
||||
if (criterion.CriterionGroup == CriterionGroup.Tumor)
|
||||
{
|
||||
var extralNameList = new List<string>() { };
|
||||
|
||||
if (criterion.CriterionType == CriterionType.RECIST1Point1 || criterion.CriterionType == CriterionType.RECIST1Pointt1_MB
|
||||
|| criterion.CriterionType == CriterionType.IRECIST1Point1 || criterion.CriterionType == CriterionType.Lugano2014 || criterion.CriterionType == CriterionType.Lugano2014WithoutPET)
|
||||
{
|
||||
|
||||
if(inQuery.ReadingExportType == ExportResult.DetailedTableOfLesions)
|
||||
{
|
||||
extralNameList.Add(_userInfo.IsEn_Us ? "Lesion ID" : "病灶编号");
|
||||
extralNameList.Add(_userInfo.IsEn_Us ? "Lesion Type" : "病灶类型");
|
||||
}
|
||||
|
||||
}
|
||||
else if (criterion.CriterionType == CriterionType.PCWG3)
|
||||
{
|
||||
if (inQuery.ReadingExportType == ExportResult.DetailedTableOfLesions)
|
||||
{
|
||||
extralNameList.Add(_userInfo.IsEn_Us ? "Lesion Type" : "病灶类型");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
var tableNameList = trialConfigTableQuestionList.Select(t => t.QuestionName).Distinct().ToList();
|
||||
|
||||
configCoumNameList = fistLeveLNameList.Union(extralNameList).Union(tableNameList).ToList();
|
||||
|
||||
|
||||
#region 扩展病灶
|
||||
|
||||
|
||||
//最终的病灶列表 要把裁判的也要加进去,需要处理裁判标记
|
||||
|
||||
foreach (var item in taskList.OrderBy(t => t.SubjectCode).ThenBy(t => t.ArmEnum).ThenBy(t => t.VisitTaskNum))
|
||||
{
|
||||
if (item.LesionList.Count > 0)
|
||||
{
|
||||
foreach (var lession in item.LesionList.OrderBy(t => t.LessionType).ThenBy(t => t.LessionCode))
|
||||
{
|
||||
|
||||
var addLessionInfoList = new List<CommonQuesionInfo>();
|
||||
|
||||
if (criterion.CriterionType == CriterionType.RECIST1Point1 || criterion.CriterionType == CriterionType.RECIST1Pointt1_MB
|
||||
|| criterion.CriterionType == CriterionType.IRECIST1Point1 || criterion.CriterionType == CriterionType.Lugano2014 || criterion.CriterionType == CriterionType.Lugano2014WithoutPET)
|
||||
{
|
||||
//病灶编号 和病灶类型没有配置,但是需要有的
|
||||
addLessionInfoList.Add(new CommonQuesionInfo() { QuestionName = _userInfo.IsEn_Us ? "Lesion ID" : "病灶编号", QuestionValue = lession.LessionCode });
|
||||
addLessionInfoList.Add(new CommonQuesionInfo() { QuestionName = _userInfo.IsEn_Us ? "Lesion Type" : "病灶类型", QuestionValue = lession.LessionType, TranslateDicName = "LesionType" });
|
||||
|
||||
}
|
||||
else if (criterion.CriterionType == CriterionType.PCWG3)
|
||||
{
|
||||
addLessionInfoList.Add(new CommonQuesionInfo() { QuestionName = _userInfo.IsEn_Us ? "Lesion Type" : "病灶类型", QuestionValue = lession.LessionType, TranslateDicName = "LesionType" });
|
||||
}
|
||||
|
||||
var dynamicPartialLessionInfoList = lession.LessionAnswerList.Select(t => new CommonQuesionInfo() { QuestionName = t.QuestionName, QuestionValue = t.QuestionValue, TranslateDicName = t.TranslateDicName });
|
||||
|
||||
//有三部分组成 外层问题+ 没有配置病灶编号和类型+ 动态的表格问题
|
||||
var dynamicLessionInfoList = item.QuestionAnswerList.Union(addLessionInfoList).Union(dynamicPartialLessionInfoList).ToList();
|
||||
|
||||
//OCT 多个表格,但是只导出一个表格,有的问题答案就是空的
|
||||
if (dynamicLessionInfoList.Count > 0)
|
||||
{
|
||||
|
||||
var cloneItem = item.Clone();
|
||||
cloneItem.QuestionAnswerList = dynamicLessionInfoList;
|
||||
|
||||
list.Add(cloneItem);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//要把裁判任务加进去 裁判任务上没有病灶
|
||||
|
||||
list.Add(item);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 处理好数据后合并
|
||||
if (criterion.CriterionType == CriterionType.RECIST1Point1 || criterion.CriterionType == CriterionType.RECIST1Pointt1_MB || criterion.CriterionType == CriterionType.IRECIST1Point1)
|
||||
{
|
||||
//针对1.1 整体肿瘤评估 有的两列要合并一列
|
||||
foreach (var item in list)
|
||||
{
|
||||
|
@ -2410,16 +2529,9 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
item.QuestionAnswerList = item.QuestionAnswerList.Where(t => t.QuestionType != QuestionType.ExistDisease).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else if (criterion.CriterionType == CriterionType.Lugano2014 || criterion.CriterionType == CriterionType.Lugano2014WithoutPET)
|
||||
{
|
||||
fistLeveLNameList = trialConfigQuestionList.Select(t =>
|
||||
(t.QuestionType == QuestionType.ExistDisease || t.QuestionType == QuestionType.ImgOncology) ? (_userInfo.IsEn_Us ? "Overall Response" : "整体肿瘤评估") : t.QuestionName).Distinct().ToList();
|
||||
|
||||
|
||||
|
||||
foreach (var item in list)
|
||||
{
|
||||
//处理合并表头
|
||||
|
@ -2443,174 +2555,82 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (criterion.CriterionType == CriterionType.PCWG3)
|
||||
{
|
||||
fistLeveLNameList = trialConfigQuestionList.Select(t => t.QuestionName).ToList();
|
||||
}
|
||||
|
||||
var exTralDicNameList = new List<string>() { "LesionType" };
|
||||
#endregion
|
||||
|
||||
translateDicNameList = trialConfigQuestionList.Union(trialConfigTableQuestionList).Where(t => t.TranslateDicName.IsNotNullOrEmpty()).Select(t => t.TranslateDicName).Union(exTralDicNameList).Distinct().ToList();
|
||||
}
|
||||
//非肿瘤的 问题名称是 表格名称_表格子问题名
|
||||
else
|
||||
//非肿瘤评估,非CDISC 导出
|
||||
{
|
||||
fistLeveLNameList = trialConfigQuestionList.Select(t => t.QuestionName).ToList();
|
||||
var extralNameList = new List<string>() { _userInfo.IsEn_Us ? "Table Name" : "表格名称" };
|
||||
|
||||
translateDicNameList = trialConfigQuestionList.Union(trialConfigTableQuestionList).Where(t => t.TranslateDicName.IsNotNullOrEmpty()).Select(t => t.TranslateDicName).Distinct().ToList();
|
||||
var tableNameList = trialConfigTableQuestionList.Select(t => t.TableName + "_" + t.QuestionName).ToList();
|
||||
|
||||
}
|
||||
configCoumNameList = fistLeveLNameList.Union(extralNameList).Union(tableNameList).ToList();
|
||||
|
||||
#endregion
|
||||
|
||||
#region 表格问题 处理增加列
|
||||
#region 扩展病灶
|
||||
|
||||
|
||||
//有多个表格问题
|
||||
if (trialConfigTableQuestionList.Select(t => t.TableName).Distinct().Count() > 1)
|
||||
{
|
||||
//肿瘤 表格问题直接去重、同时添加一些列 外层问题合并一些列
|
||||
if (criterion.CriterionGroup == CriterionGroup.Tumor)
|
||||
//最终的病灶列表 要把裁判的也要加进去,需要处理裁判标记
|
||||
foreach (var item in taskList.OrderBy(t => t.SubjectCode).ThenBy(t => t.ArmEnum).ThenBy(t => t.VisitTaskNum))
|
||||
{
|
||||
var extralNameList = new List<string>() { };
|
||||
|
||||
if (criterion.CriterionType == CriterionType.RECIST1Point1 || criterion.CriterionType == CriterionType.RECIST1Pointt1_MB
|
||||
|| criterion.CriterionType == CriterionType.IRECIST1Point1 || criterion.CriterionType == CriterionType.Lugano2014 || criterion.CriterionType == CriterionType.Lugano2014WithoutPET)
|
||||
//有病灶,并且至少配置了一个病灶问题
|
||||
if (item.LesionList.Count > 0 && item.LesionList.SelectMany(t => t.LessionAnswerList).Any())
|
||||
{
|
||||
|
||||
extralNameList.Add(_userInfo.IsEn_Us ? "Lesion ID" : "病灶编号");
|
||||
extralNameList.Add(_userInfo.IsEn_Us ? "Lesion Type" : "病灶类型");
|
||||
|
||||
|
||||
}
|
||||
else if (criterion.CriterionType == CriterionType.PCWG3)
|
||||
{
|
||||
extralNameList.Add(_userInfo.IsEn_Us ? "Lesion Type" : "病灶类型");
|
||||
}
|
||||
|
||||
var tableNameList = trialConfigTableQuestionList.Select(t => t.QuestionName).Distinct().ToList();
|
||||
|
||||
configCoumNameList = fistLeveLNameList.Union(extralNameList).Union(tableNameList).ToList();
|
||||
|
||||
|
||||
#region 扩展病灶
|
||||
|
||||
|
||||
//最终的病灶列表 要把裁判的也要加进去,需要处理裁判标记
|
||||
|
||||
foreach (var item in taskList.OrderBy(t => t.SubjectCode).ThenBy(t => t.ArmEnum).ThenBy(t => t.VisitTaskNum))
|
||||
{
|
||||
if (item.LesionList.Count > 0)
|
||||
foreach (var lession in item.LesionList.OrderBy(t => t.LessionType).ThenBy(t => t.LessionCode))
|
||||
{
|
||||
foreach (var lession in item.LesionList.OrderBy(t => t.LessionType).ThenBy(t => t.LessionCode))
|
||||
//病灶配置了问题 才进行导出
|
||||
if (lession.LessionAnswerList.Count > 0)
|
||||
{
|
||||
|
||||
var firstLessionAnser = lession.LessionAnswerList.FirstOrDefault();
|
||||
var addLessionInfoList = new List<CommonQuesionInfo>();
|
||||
|
||||
if (criterion.CriterionType == CriterionType.RECIST1Point1 || criterion.CriterionType == CriterionType.RECIST1Pointt1_MB
|
||||
|| criterion.CriterionType == CriterionType.IRECIST1Point1 || criterion.CriterionType == CriterionType.Lugano2014 || criterion.CriterionType == CriterionType.Lugano2014WithoutPET)
|
||||
{
|
||||
//病灶编号 和病灶类型没有配置,但是需要有的
|
||||
addLessionInfoList.Add(new CommonQuesionInfo() { QuestionName = _userInfo.IsEn_Us ? "Lesion ID" : "病灶编号", QuestionValue = lession.LessionCode });
|
||||
addLessionInfoList.Add(new CommonQuesionInfo() { QuestionName = _userInfo.IsEn_Us ? "Lesion Type" : "病灶类型", QuestionValue = lession.LessionType, TranslateDicName = "LesionType" });
|
||||
addLessionInfoList.Add(new CommonQuesionInfo() { QuestionName = _userInfo.IsEn_Us ? "Table Name" : "表格名称", QuestionValue = firstLessionAnser.TableName });
|
||||
|
||||
}
|
||||
else if (criterion.CriterionType == CriterionType.PCWG3)
|
||||
{
|
||||
addLessionInfoList.Add(new CommonQuesionInfo() { QuestionName = _userInfo.IsEn_Us ? "Lesion Type" : "病灶类型", QuestionValue = lession.LessionType, TranslateDicName = "LesionType" });
|
||||
}
|
||||
var dynamicPartialLessionInfoList = lession.LessionAnswerList.Select(t => new CommonQuesionInfo() { QuestionName = t.TableName + "_" + t.QuestionName, QuestionValue = t.QuestionValue, TranslateDicName = t.TranslateDicName, CDISCCode = t.CDISCCode });
|
||||
|
||||
var dynamicPartialLessionInfoList = lession.LessionAnswerList.Select(t => new CommonQuesionInfo() { QuestionName = t.QuestionName, QuestionValue = t.QuestionValue, TranslateDicName = t.TranslateDicName });
|
||||
//有三部分组成 外层问题+ 固定列表格名称 + 动态的表格问题
|
||||
var dynamicLessionInfoList = item.QuestionAnswerList.Union(addLessionInfoList).Union(dynamicPartialLessionInfoList).ToList();
|
||||
|
||||
//有三部分组成 外层问题+ 没有配置病灶编号和类型+ 动态的表格问题
|
||||
var dynamicLessionInfoList = addLessionInfoList.Union(dynamicPartialLessionInfoList).Union(item.QuestionAnswerList).ToList();
|
||||
|
||||
//OCT 多个表格,但是只导出一个表格,有的问题答案就是空的
|
||||
if (dynamicLessionInfoList.Count > 0)
|
||||
{
|
||||
|
||||
var cloneItem = item.Clone();
|
||||
cloneItem.QuestionAnswerList = dynamicLessionInfoList;
|
||||
|
||||
list.Add(cloneItem);
|
||||
}
|
||||
|
||||
var cloneItem = item.Clone();
|
||||
cloneItem.QuestionAnswerList = dynamicLessionInfoList;
|
||||
list.Add(cloneItem);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//要把裁判任务加进去 裁判任务上没有病灶
|
||||
|
||||
list.Add(item);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
//非肿瘤的 问题名称是 表格名称_表格子问题名
|
||||
else
|
||||
{
|
||||
var extralNameList = new List<string>() { _userInfo.IsEn_Us ? "Table Name" : "表格名称" };
|
||||
|
||||
var tableNameList = trialConfigTableQuestionList.Select(t => t.TableName + "_" + t.QuestionName).ToList();
|
||||
|
||||
configCoumNameList = fistLeveLNameList.Union(extralNameList).Union(tableNameList).ToList();
|
||||
|
||||
#region 扩展病灶
|
||||
|
||||
|
||||
//最终的病灶列表 要把裁判的也要加进去,需要处理裁判标记
|
||||
foreach (var item in taskList.OrderBy(t => t.SubjectCode).ThenBy(t => t.ArmEnum).ThenBy(t => t.VisitTaskNum))
|
||||
else
|
||||
{
|
||||
//有病灶,并且至少配置了一个病灶问题
|
||||
if (item.LesionList.Count > 0 && item.LesionList.SelectMany(t => t.LessionAnswerList).Any())
|
||||
{
|
||||
foreach (var lession in item.LesionList.OrderBy(t => t.LessionType).ThenBy(t => t.LessionCode))
|
||||
{
|
||||
//病灶配置了问题 才进行导出
|
||||
if (lession.LessionAnswerList.Count > 0)
|
||||
{
|
||||
var firstLessionAnser = lession.LessionAnswerList.FirstOrDefault();
|
||||
var addLessionInfoList = new List<CommonQuesionInfo>();
|
||||
|
||||
addLessionInfoList.Add(new CommonQuesionInfo() { QuestionName = _userInfo.IsEn_Us ? "Table Name" : "表格名称", QuestionValue = firstLessionAnser.TableName });
|
||||
|
||||
var dynamicPartialLessionInfoList = lession.LessionAnswerList.Select(t => new CommonQuesionInfo() { QuestionName = t.TableName + "_" + t.QuestionName, QuestionValue = t.QuestionValue, TranslateDicName = t.TranslateDicName, CDISCCode = t.CDISCCode });
|
||||
|
||||
//有三部分组成 外层问题+ 固定列表格名称 + 动态的表格问题
|
||||
var dynamicLessionInfoList = item.QuestionAnswerList.Union(addLessionInfoList).Union(dynamicPartialLessionInfoList).ToList();
|
||||
|
||||
|
||||
var cloneItem = item.Clone();
|
||||
cloneItem.QuestionAnswerList = dynamicLessionInfoList;
|
||||
list.Add(cloneItem);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//要把裁判任务加进去 裁判任务上没有病灶
|
||||
|
||||
list.Add(item);
|
||||
}
|
||||
//要把裁判任务加进去 裁判任务上没有病灶
|
||||
|
||||
list.Add(item);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
//单个表格,或者没有配置表格 直接用表格问题名称
|
||||
else
|
||||
{
|
||||
var tableNameList = trialConfigTableQuestionList.Select(t => t.QuestionName).ToList();
|
||||
#endregion
|
||||
|
||||
configCoumNameList = fistLeveLNameList.Union(tableNameList).ToList();
|
||||
}
|
||||
|
||||
|
||||
#region 多个表格问题 单个表格问题
|
||||
////有多个表格问题
|
||||
//if (trialConfigTableQuestionList.Select(t => t.TableName).Distinct().Count() > 1)
|
||||
//{
|
||||
|
||||
|
||||
//}
|
||||
////单个表格,或者没有配置表格 直接用表格问题名称
|
||||
//else
|
||||
//{
|
||||
// var tableNameList = trialConfigTableQuestionList.Select(t => t.QuestionName).ToList();
|
||||
|
||||
// configCoumNameList = fistLeveLNameList.Union(tableNameList).ToList();
|
||||
//}
|
||||
#endregion
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
dynamicColumnConfig = new DynamicColumnConfig()
|
||||
|
|
Loading…
Reference in New Issue