Compare commits
No commits in common. "5ed24c209fac0fb3cfde42510a858845f644af07" and "77b2d7bed40521ac6c28e0f2d384a30d42211185" have entirely different histories.
5ed24c209f
...
77b2d7bed4
|
|
@ -3654,93 +3654,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
var entity = item.Entity as SegmentBinding;
|
var entity = item.Entity as SegmentBinding;
|
||||||
|
|
||||||
|
|
||||||
var tableQuestionAnswer = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTableQuestionAnswer)).Select(x => x.Entity as ReadingTableQuestionAnswer)
|
|
||||||
.Where(x => x.RowId == entity.RowId && x.TableQuestionId == entity.TableQuestionId).FirstOrDefault();
|
|
||||||
var answer = string.Empty;
|
|
||||||
|
|
||||||
List<UnitData> unitDataList = (await _dbContext.Dictionary.Where(x => x.Parent.Code == "ValueUnit").Where(x => x.Code != "0").ToListAsync()).Select(x => new UnitData()
|
|
||||||
{
|
|
||||||
|
|
||||||
Unit = (ValueUnit)int.Parse(x.Code),
|
|
||||||
UnitName = x.Value.ToString(),
|
|
||||||
}).ToList();
|
|
||||||
if (tableQuestionAnswer != null)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
var tableQuesionList = await _dbContext.ReadingTableQuestionTrial.Where(t => t.Id == tableQuestionAnswer.TableQuestionId).Select(t =>
|
|
||||||
new
|
|
||||||
{
|
|
||||||
TrialReadingCriterionId = t.ReadingQuestionTrial.ReadingQuestionCriterionTrialId, //标准Id
|
|
||||||
Type = t.ReadingQuestionTrial.QuestionName, //病灶类型
|
|
||||||
t.Unit,
|
|
||||||
t.CustomUnit,
|
|
||||||
t.DictionaryCode,
|
|
||||||
t.QuestionName,
|
|
||||||
t.QuestionEnName,
|
|
||||||
QuestionId = t.Id,
|
|
||||||
t.ShowOrder,
|
|
||||||
AnswerType = t.Type,
|
|
||||||
})
|
|
||||||
.OrderBy(t => t.ShowOrder).FirstOrDefaultAsync();
|
|
||||||
|
|
||||||
|
|
||||||
answer = Translationunit(tableQuesionList.AnswerType, tableQuesionList.Unit, tableQuesionList.CustomUnit, unitDataList, tableQuestionAnswer.Answer);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var questionAnswer= entitys.Where(x => x.Entity.GetType() == typeof(ReadingTaskQuestionAnswer)).Select(x => x.Entity as ReadingTaskQuestionAnswer)
|
|
||||||
.Where(x => x.VisitTaskId == entity.VisitTaskId && x.ReadingQuestionTrialId == entity.QuestionId).FirstOrDefault();
|
|
||||||
|
|
||||||
var quesionInfo = await _dbContext.ReadingQuestionTrial.Where(t => t.Id == questionAnswer.ReadingQuestionTrialId).Select(t =>
|
|
||||||
new
|
|
||||||
{
|
|
||||||
|
|
||||||
t.Unit,
|
|
||||||
t.CustomUnit,
|
|
||||||
t.DictionaryCode,
|
|
||||||
t.QuestionName,
|
|
||||||
t.QuestionEnName,
|
|
||||||
QuestionId = t.Id,
|
|
||||||
t.ShowOrder,
|
|
||||||
AnswerType = t.Type,
|
|
||||||
})
|
|
||||||
.OrderBy(t => t.ShowOrder).FirstOrDefaultAsync();
|
|
||||||
|
|
||||||
answer = Translationunit(quesionInfo.AnswerType, quesionInfo.Unit, quesionInfo.CustomUnit, unitDataList, questionAnswer.Answer);
|
|
||||||
}
|
|
||||||
|
|
||||||
var rowMark = await _dbContext.ReadingTableAnswerRowInfo.Where(x => x.Id == entity.RowId).Select(x => x.RowMark).FirstOrDefaultAsync();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var segmentation = await _dbContext.Segmentation.Where(x => x.Id == entity.SegmentationId).FirstOrDefaultAsync()?? new Segmentation() { };
|
|
||||||
|
|
||||||
var segment= await _dbContext.Segment.Where(x => x.Id == entity.SegmentId).FirstOrDefaultAsync()?? new Segment() { };
|
|
||||||
|
|
||||||
var tableQuestionName = await _dbContext.ReadingTableQuestionTrial.Where(x => x.Id == entity.TableQuestionId).Select(x => _userInfo.IsEn_Us ? x.QuestionEnName : x.QuestionName).FirstOrDefaultAsync();
|
|
||||||
var questionName = await _dbContext.ReadingQuestionTrial.Where(x => x.Id == entity.QuestionId).Select(x => _userInfo.IsEn_Us ? x.QuestionEnName : x.QuestionName).FirstOrDefaultAsync();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
await InsertInspection<SegmentBinding>(entity, type, x => new InspectionConvertDTO()
|
await InsertInspection<SegmentBinding>(entity, type, x => new InspectionConvertDTO()
|
||||||
{
|
{
|
||||||
},new
|
|
||||||
{
|
|
||||||
segmentation.SegmentationName,
|
|
||||||
segmentation.SEGUrl,
|
|
||||||
segment.SegmentName,
|
|
||||||
segment.SegmentMumber,
|
|
||||||
segment.ColorRgb,
|
|
||||||
|
|
||||||
QuestionName = questionName,
|
|
||||||
RowMark = rowMark,
|
|
||||||
TableQuestionName = tableQuestionName,
|
|
||||||
Answer = answer,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue