Uat_Study
parent
6458690f6d
commit
dc3b7f39f4
|
@ -486,7 +486,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
if (_userInfo.RequestUrl == "ReadingImageTask/SubmitDicomVisitTask")
|
||||
{
|
||||
//跳转阅片结果需要该参数
|
||||
var subjectCode=_dbContext.Subject.Where(t=>t.Id==entity.SubjectId).Select(t=>t.Code).First();
|
||||
var subjectCode = _dbContext.Subject.Where(t => t.Id == entity.SubjectId).Select(t => t.Code).First();
|
||||
obj = new { SubjectCode = subjectCode };
|
||||
}
|
||||
|
||||
|
@ -623,7 +623,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
{
|
||||
VisitTaskId = x.VisitTaskId,
|
||||
|
||||
ObjectRelationParentId=x.VisitTaskId,
|
||||
ObjectRelationParentId = x.VisitTaskId,
|
||||
|
||||
TrialReadingCriterionId = x.ReadingQuestionCriterionTrialId,
|
||||
|
||||
|
@ -635,63 +635,73 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
}
|
||||
|
||||
//病灶这里操作
|
||||
if(entitys.Any(x => x.Entity.GetType() == typeof(ReadingTableQuestionAnswer)))
|
||||
//病灶这里操作 ReadingTableAnswerRowInfo ReadingTableQuestionAnswer
|
||||
|
||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ReadingTableAnswerRowInfo)))
|
||||
{
|
||||
|
||||
|
||||
var type = GetEntityAuditOpt(item);
|
||||
|
||||
var entity = item.Entity as ReadingTableAnswerRowInfo;
|
||||
|
||||
var tableQuestionAnswerList = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTableQuestionAnswer)).Select(t => t.Entity as ReadingTableQuestionAnswer).Where(t => t.RowId == entity.Id).ToList();
|
||||
|
||||
|
||||
//var type = GetEntityAuditOpt(item);
|
||||
//获取问题名称 组合成数组
|
||||
var tableQuesionList = await _dbContext.ReadingTableQuestionTrial.Where(t => tableQuestionAnswerList.Select(k => k.TableQuestionId).Contains(t.Id)).Select(t =>
|
||||
new {
|
||||
TrialReadingCriterionId = t.ReadingQuestionTrial.ReadingQuestionCriterionTrialId, //标准Id
|
||||
Type = t.ReadingQuestionTrial.QuestionName, //病灶类型
|
||||
t.ReadingQuestionTrial.Unit,
|
||||
t.ReadingQuestionTrial.CustomUnit,
|
||||
t.ReadingQuestionTrial.DictionaryCode,
|
||||
t.QuestionName,
|
||||
QuestionId = t.Id,
|
||||
t.ShowOrder })
|
||||
.OrderBy(t => t.ShowOrder).ToListAsync();
|
||||
|
||||
//删除病灶接口
|
||||
if (_userInfo.RequestUrl == "ReadingImageTask/deleteReadingRowAnswer")
|
||||
var trialReadingCriterionId = tableQuesionList.FirstOrDefault()?.TrialReadingCriterionId;
|
||||
|
||||
|
||||
|
||||
await InsertInspection<ReadingTableAnswerRowInfo>(entity, type, x => new InspectionConvertDTO()
|
||||
{
|
||||
VisitTaskId = x.VisitTaskId,
|
||||
|
||||
ObjectRelationParentId = x.VisitTaskId,
|
||||
|
||||
TrialReadingCriterionId = trialReadingCriterionId
|
||||
|
||||
}
|
||||
|
||||
//添加/修改病灶接口
|
||||
if (_userInfo.RequestUrl == "ReadingImageTask/submitTableQuestion")
|
||||
}, new
|
||||
{
|
||||
//区分是添加还是删除操作
|
||||
var type = GetEntityAuditOpt(entitys.Where(x => x.Entity.GetType() == typeof(ReadingTableQuestionAnswer)).FirstOrDefault());
|
||||
QuestionAnswerList =
|
||||
|
||||
var tableQuestionAnswerList = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTableQuestionAnswer)).Select(t => t.Entity as ReadingTableQuestionAnswer).ToList();
|
||||
//需要手动添加病灶类型
|
||||
tableQuestionAnswerList.Join(tableQuesionList, t => t.TableQuestionId, u => u.QuestionId, (t, u) => new {
|
||||
Answer= t.Answer /*u.Unit==ValueUnit.Custom? t.Answer+u.CustomUnit:(u.Unit != ValueUnit.None|| u.Unit != null)*/,
|
||||
u.QuestionName,
|
||||
u.ShowOrder }).OrderBy(t => t.ShowOrder).ToList()
|
||||
});
|
||||
|
||||
|
||||
//获取问题名称 组合成数组
|
||||
var tableQuesionList = await _dbContext.ReadingTableQuestionTrial.Where(t => tableQuestionAnswerList.Select(k => k.TableQuestionId).Contains(t.Id)).Select(t => new { TrialReadingCriterionId = t.ReadingQuestionTrial.ReadingQuestionCriterionTrialId, Type = t.ReadingQuestionTrial.QuestionName, t.QuestionName, QuestionId = t.Id, t.ShowOrder }).OrderBy(t => t.ShowOrder).ToListAsync();
|
||||
////添加/修改病灶接口 只会对单个病灶进行操作
|
||||
//if (_userInfo.RequestUrl == "ReadingImageTask/submitTableQuestion")
|
||||
//{
|
||||
//}
|
||||
|
||||
var trialReadingCriterionId = tableQuesionList.FirstOrDefault()?.TrialReadingCriterionId;
|
||||
////删除病灶接口 里面也有更新
|
||||
//if (_userInfo.RequestUrl == "ReadingImageTask/deleteReadingRowAnswer")
|
||||
//{
|
||||
// //有删除 有修改 多条稽查记录
|
||||
|
||||
var firstEntity = tableQuestionAnswerList.First();
|
||||
// var deleteList = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTableQuestionAnswer) && GetEntityAuditOpt(x) == AuditOpt.Deleted).Select(t => t.Entity as ReadingTableQuestionAnswer).ToList();
|
||||
|
||||
var cloneEntity = firstEntity.Clone();
|
||||
|
||||
//保证Id 唯一 用于区分病灶
|
||||
cloneEntity.Id = firstEntity.RowId;
|
||||
|
||||
await InsertInspection<ReadingTableQuestionAnswer>(cloneEntity, type, x => new InspectionConvertDTO()
|
||||
{
|
||||
VisitTaskId = x.VisitTaskId,
|
||||
|
||||
ObjectRelationParentId = x.VisitTaskId,
|
||||
|
||||
TrialReadingCriterionId = trialReadingCriterionId
|
||||
|
||||
}, new { QuestionAnswerList =
|
||||
|
||||
//需要手动添加病灶类型
|
||||
tableQuestionAnswerList.Join(tableQuesionList, t => t.TableQuestionId, u => u.QuestionId, (t, u) => new { t.Answer, u.QuestionName, u.ShowOrder }).OrderBy(t => t.ShowOrder).ToList() });
|
||||
|
||||
|
||||
|
||||
}
|
||||
// var updateList = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTableQuestionAnswer) && GetEntityAuditOpt(x) == AuditOpt.Update).Select(t => t.Entity as ReadingTableQuestionAnswer).ToList();
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue