Uat_Study
he 2023-04-26 15:52:29 +08:00
commit d495d03619
2 changed files with 190 additions and 42 deletions

View File

@ -0,0 +1,80 @@
--- 1、变更的表名
--EXEC sp_rename 'old_table_name', 'new_table_name';
EXEC sp_rename 'CriterionNidus', 'CriterionNidusSystem';
EXEC sp_rename 'ReadingCriterionDictionary', 'ReadingSystemCriterionDictionary';
---- 2、处理发布环境的表数据拆分
-- CriterionNidusSystem_copy
--SELECT *
--INTO CriterionNidusSystem_copy
--FROM CriterionNidusSystem
--WHERE IsSystemCriterion = 0;
--CriterionNidusTrial
SELECT *
INTO CriterionNidusTrial
FROM CriterionNidusSystem
WHERE IsSystemCriterion = 0;
SELECT *
INTO ReadingTrialCriterionDictionary
FROM ReadingSystemCriterionDictionary
WHERE IsSystemCriterion = 0;
----- 三、维护稽查数据
select Count(*) from DataInspection where EntityName='CriterionNidus'
select Count(*) from DataInspection where EntityName='CriterionNidus' and Identification='CriterionNidus/Add'
select Count(*) from DataInspection where EntityName='CriterionNidus' and Identification='CriterionNidus/Update'
select Count(*) from DataInspection where EntityName='CriterionNidus' and Identification='CriterionNidus/Deleted'
select Count(*) from DataInspection where EntityName='CriterionNidus' and Identification='CriterionNidus/Add/IsTrial'
select Count(*) from DataInspection where EntityName='CriterionNidus' and Identification='CriterionNidus/Add/IsTrial/Auto'
select Count(*) from DataInspection where EntityName='CriterionNidus' and Identification='CriterionNidus/Update/IsTrial'
select Count(*) from DataInspection where EntityName='CriterionNidus' and Identification='CriterionNidus/Deleted/IsTrial'
select Count(*) from DataInspection where EntityName='ReadingCriterionDictionary'
select Count(*) from DataInspection where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/QuestionType'
select Count(*) from DataInspection where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/LesionType'
select Count(*) from DataInspection where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/OncologyAssessType'
select Count(*) from DataInspection where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/GlobalAssessType'
select Count(*) from DataInspection where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/QuestionType/IsTrial'
select Count(*) from DataInspection where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/LesionType/IsTrial'
select Count(*) from DataInspection where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/OncologyAssessType/IsTrial'
select Count(*) from DataInspection where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/GlobalAssessType/IsTrial'
-- CriterionNidusSystem
update DataInspection SET Identification='CriterionNidusSystem/Add', EntityName='CriterionNidusSystem' where EntityName='CriterionNidus' and Identification='CriterionNidus/Add'
update DataInspection SET Identification='CriterionNidusSystem/Update' , EntityName='CriterionNidusSystem' where EntityName='CriterionNidus' and Identification='CriterionNidus/Update'
update DataInspection SET Identification='CriterionNidusSystem/Deleted', EntityName='CriterionNidusSystem' where EntityName='CriterionNidus' and Identification='CriterionNidus/Deleted'
-- CriterionNidusTrial
update DataInspection SET Identification='CriterionNidusTrial/Add' , EntityName='CriterionNidusTrial' where EntityName='CriterionNidus' and Identification='CriterionNidus/Add/IsTrial'
update DataInspection SET Identification='CriterionNidusTrial/Add/Auto' , EntityName='CriterionNidusTrial' where EntityName='CriterionNidus' and Identification='CriterionNidus/Add/IsTrial/Auto'
update DataInspection SET Identification='CriterionNidusTrial/Update' , EntityName='CriterionNidusTrial' where EntityName='CriterionNidus' and Identification='CriterionNidus/Update/IsTrial'
update DataInspection SET Identification='CriterionNidusTrial/Deleted' , EntityName='CriterionNidusTrial' where EntityName='CriterionNidus' and Identification='CriterionNidus/Deleted/IsTrial'
--ReadingSystemCriterionDictionary
update DataInspection SET Identification='ReadingSystemCriterionDictionary/Add/QuestionType', EntityName='ReadingSystemCriterionDictionary' where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/QuestionType'
update DataInspection SET Identification='ReadingSystemCriterionDictionary/Add/LesionType' , EntityName='ReadingSystemCriterionDictionary' where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/LesionType'
update DataInspection SET Identification='ReadingSystemCriterionDictionary/Add/OncologyAssessType', EntityName='ReadingSystemCriterionDictionary' where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/OncologyAssessType'
update DataInspection SET Identification='ReadingSystemCriterionDictionary/Add/GlobalAssessType', EntityName='ReadingSystemCriterionDictionary' where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/GlobalAssessType'
--ReadingTrialCriterionDictionary
update DataInspection SET Identification='ReadingTrialCriterionDictionary/Add/QuestionType', EntityName='ReadingTrialCriterionDictionary' where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/QuestionType/IsTrial'
update DataInspection SET Identification='ReadingTrialCriterionDictionary/Add/LesionType' , EntityName='ReadingTrialCriterionDictionary' where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/LesionType/IsTrial'
update DataInspection SET Identification='ReadingTrialCriterionDictionary/Add/OncologyAssessType', EntityName='ReadingTrialCriterionDictionary' where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/OncologyAssessType/IsTrial'
update DataInspection SET Identification='ReadingTrialCriterionDictionary/Add/GlobalAssessType', EntityName='ReadingTrialCriterionDictionary' where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/GlobalAssessType/IsTrial'

View File

@ -570,26 +570,38 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var entity = item.Entity as CriterionNidusSystem; var entity = item.Entity as CriterionNidusSystem;
var extraIdentification = string.Empty;
if (entity.IsSystemCriterion == false)
{
extraIdentification = "/IsTrial";
if (_userInfo.RequestUrl != "OrganInfo/addOrUpdateCriterionNidus" && type == AuditOpt.Add)
{
extraIdentification = "/IsTrial/Auto";
}
}
await InsertInspection<CriterionNidusSystem>(entity, type, x => new InspectionConvertDTO() await InsertInspection<CriterionNidusSystem>(entity, type, x => new InspectionConvertDTO()
{ {
IsDistinctionInterface = false, IsDistinctionInterface = false,
ObjectRelationParentId = entity.CriterionId, ObjectRelationParentId = entity.CriterionId,
TrialReadingCriterionId = entity.IsSystemCriterion == false ? entity.CriterionId : null, });
}
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(CriterionNidusTrial)))
{
var type = GetEntityAuditOpt(item);
var entity = item.Entity as CriterionNidusTrial;
var extraIdentification = string.Empty;
if (_userInfo.RequestUrl != "OrganInfo/addOrUpdateCriterionNidus" && type == AuditOpt.Add)
{
extraIdentification = "/Auto";
}
await InsertInspection<CriterionNidusTrial>(entity, type, x => new InspectionConvertDTO()
{
IsDistinctionInterface = false,
ObjectRelationParentId = entity.CriterionId,
TrialReadingCriterionId = entity.CriterionId,
ExtraIndentification = extraIdentification ExtraIndentification = extraIdentification
@ -597,6 +609,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
}); });
} }
//疗效评估 //疗效评估
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TumorAssessment_RECIST1Point1))) foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TumorAssessment_RECIST1Point1)))
@ -621,8 +634,6 @@ namespace IRaCIS.Core.Infra.EFCore.Common
if (entitys.Any(x => x.Entity.GetType() == typeof(ReadingSystemCriterionDictionary))) if (entitys.Any(x => x.Entity.GetType() == typeof(ReadingSystemCriterionDictionary)))
{ {
var type = AuditOpt.Add; var type = AuditOpt.Add;
var allList = entitys.Where(x => x.Entity.GetType() == typeof(ReadingSystemCriterionDictionary)).Select(t => t.Entity as ReadingSystemCriterionDictionary).ToList(); var allList = entitys.Where(x => x.Entity.GetType() == typeof(ReadingSystemCriterionDictionary)).Select(t => t.Entity as ReadingSystemCriterionDictionary).ToList();
@ -646,15 +657,9 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var extraIdentification = string.Empty; var extraIdentification = string.Empty;
//系统标准
if (cloneEntity.IsSystemCriterion)
{
extraIdentification = $"/{cloneEntity.ParentCode}"; extraIdentification = $"/{cloneEntity.ParentCode}";
}
else
{
extraIdentification = $"/{cloneEntity.ParentCode}/IsTrial";
}
await InsertInspection<ReadingSystemCriterionDictionary>(cloneEntity, type, x => new InspectionConvertDTO() await InsertInspection<ReadingSystemCriterionDictionary>(cloneEntity, type, x => new InspectionConvertDTO()
@ -687,9 +692,70 @@ namespace IRaCIS.Core.Infra.EFCore.Common
}
if (entitys.Any(x => x.Entity.GetType() == typeof(ReadingTrialCriterionDictionary)))
{
var type = AuditOpt.Add;
var allList = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTrialCriterionDictionary)).Select(t => t.Entity as ReadingTrialCriterionDictionary).ToList();
//查询出字典的Value ValueCN Des 保存
var dicIdList = allList.Select(t => t.DictionaryId).ToList();
var selectList = await _dbContext.Dictionary.Where(x => dicIdList.Contains(x.Id)).Select(t => new { t.Id, t.Value, t.ValueCN, t.Description, t.ShowOrder }).ToListAsync();
foreach (var list in allList.GroupBy(t => t.ParentCode))
{
var firstEntity = list.First();
var cloneEntity = list.First().Clone();
//保证Id 唯一
cloneEntity.Id = IdentifierHelper.CreateGuid(firstEntity.CriterionId.ToString(), firstEntity.ParentCode.ToString());
var extraIdentification = string.Empty;
extraIdentification = $"/{cloneEntity.ParentCode}/IsTrial";
await InsertInspection<ReadingTrialCriterionDictionary>(cloneEntity, type, x => new InspectionConvertDTO()
{
ObjectRelationParentId = x.CriterionId,
TrialReadingCriterionId = x.CriterionId,
//不显示区分接口 通过是否是系统字典 以及字典Code 区分
IsDistinctionInterface = false,
ExtraIndentification = extraIdentification
},
new
{
SelectList = selectList.Join(list, t => t.Id, u => u.DictionaryId, (t, u) =>
new
{
t.Value,
t.ValueCN,
t.Description,
t.ShowOrder,
u.IsBaseLineUse,
u.IsFollowVisitUse
}
).OrderBy(t => t.ShowOrder).ToList()
});
}
} }
@ -1980,7 +2046,9 @@ namespace IRaCIS.Core.Infra.EFCore.Common
ExtraIndentification = extraIdentification, ExtraIndentification = extraIdentification,
}, new { QuestionAnswerList = taskQuestionAnswerList.Join(quesionList, t => t.ReadingQuestionTrialId, u => u.QuestionId, (t, u) => }, new
{
QuestionAnswerList = taskQuestionAnswerList.Join(quesionList, t => t.ReadingQuestionTrialId, u => u.QuestionId, (t, u) =>
new { Answer = u.AnswerType == "upload" ? "❄❅❆❇❈❉❊" + t.Answer : t.Answer, u.DictionaryCode, u.QuestionName, u.ShowOrder }).OrderBy(t => t.ShowOrder).ToList() new { Answer = u.AnswerType == "upload" ? "❄❅❆❇❈❉❊" + t.Answer : t.Answer, u.DictionaryCode, u.QuestionName, u.ShowOrder }).OrderBy(t => t.ShowOrder).ToList()
, ,
TableQuestionAndAnswerList = tableQuesionAndAnswerList TableQuestionAndAnswerList = tableQuesionAndAnswerList