Merge branch 'Test_IRC_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net8
commit
9082caa57c
|
@ -674,6 +674,13 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
public CriterionType CriterionType { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class MarkAuditInfo
|
||||
{
|
||||
public string Param { get; set; }
|
||||
|
||||
public bool IsGeneralMark { get; set; }
|
||||
}
|
||||
public class ChangeDicomReadingQuestionAnswerInDto
|
||||
{
|
||||
public Guid VisitTaskId { get; set; }
|
||||
|
|
|
@ -1997,8 +1997,32 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
inDto.param= param;
|
||||
|
||||
List<MarkAuditInfo> markAuditInfos = new List<MarkAuditInfo>() {
|
||||
|
||||
// 自定义
|
||||
new MarkAuditInfo (){Param="-10",IsGeneralMark=true },
|
||||
|
||||
// 保存脾尖
|
||||
new MarkAuditInfo (){Param="4",IsGeneralMark=true },
|
||||
|
||||
// 保存脾底
|
||||
new MarkAuditInfo (){Param="5",IsGeneralMark=true },
|
||||
|
||||
// 测量纵膈血池
|
||||
new MarkAuditInfo (){Param="3",IsGeneralMark=false },
|
||||
|
||||
// 测量肝脏血池
|
||||
new MarkAuditInfo (){Param="2",IsGeneralMark=false }
|
||||
};
|
||||
|
||||
|
||||
var markInfo= markAuditInfos.Where(x => x.Param == param).FirstOrDefault();
|
||||
|
||||
// 当 param == -10 时,为自定义标准 需要区分 绑定 更改 标记
|
||||
if (param == "-10")
|
||||
if (markInfo!=null)
|
||||
{
|
||||
|
||||
if (markInfo.IsGeneralMark)
|
||||
{
|
||||
// 自定义这边 移除标记 还是会传过来 不过 MeasureData 为空字符串
|
||||
inDto.QuestionMarkInfoList = inDto.QuestionMarkInfoList.Where(x => x.MeasureData.IsNotNullOrEmpty()).ToList();
|
||||
|
@ -2007,7 +2031,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
var questionMarkList = inDto.QuestionMarkInfoList.Select(x => x.QuestionId).ToList();
|
||||
|
||||
var existsMark = await _readingTaskQuestionMarkRepository.AnyAsync(x => x.VisitTaskId == inDto.VisitTaskId && x.MeasureData != string.Empty && questionMarkList.Contains(x.QuestionId));
|
||||
if (!existsMark && inDto.QuestionMarkInfoList.Count(x=>x.MeasureData.IsNotNullOrEmpty()) > 0)
|
||||
if (!existsMark && inDto.QuestionMarkInfoList.Count(x => x.MeasureData.IsNotNullOrEmpty()) > 0)
|
||||
{
|
||||
_userInfo.AuditIdentification = "AddMark";
|
||||
}
|
||||
|
@ -2020,6 +2044,29 @@ namespace IRaCIS.Core.Application.Service
|
|||
_userInfo.AuditIdentification = "DeleteMark";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
inDto.QuestionMarkInfoList = inDto.QuestionMarkInfoList.Where(x => x.OtherMeasureData.IsNotNullOrEmpty()).ToList();
|
||||
|
||||
|
||||
var questionMarkList = inDto.QuestionMarkInfoList.Select(x => x.QuestionId).ToList();
|
||||
|
||||
var existsMark = await _readingTaskQuestionMarkRepository.AnyAsync(x => x.VisitTaskId == inDto.VisitTaskId && x.OtherMeasureData != string.Empty && questionMarkList.Contains(x.QuestionId));
|
||||
if (!existsMark && inDto.QuestionMarkInfoList.Count(x => x.OtherMeasureData.IsNotNullOrEmpty()) > 0)
|
||||
{
|
||||
_userInfo.AuditIdentification = "AddMark";
|
||||
}
|
||||
else if (existsMark && inDto.QuestionMarkInfoList.Count(x => x.OtherMeasureData.IsNotNullOrEmpty()) > 0)
|
||||
{
|
||||
_userInfo.AuditIdentification = "UpdateMark";
|
||||
}
|
||||
else
|
||||
{
|
||||
_userInfo.AuditIdentification = "DeleteMark";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
|
||||
try
|
||||
|
@ -2132,13 +2179,13 @@ namespace IRaCIS.Core.Application.Service
|
|||
var markquestionId = inDto.QuestionMarkInfoList.Select(y => (Guid?)y.QuestionId).ToList();
|
||||
|
||||
List<Guid?> needDeleteMarkQuestonIds = inDto.Answers.Where(x => x.Answer == string.Empty).Select(x => (Guid?)x.Id).ToList();
|
||||
|
||||
var needDeleteMarkQuestionIds = questionList.Except(markquestionId).ToList();
|
||||
switch (taskInfo.TrialReadingCriterion.CriterionType)
|
||||
{
|
||||
|
||||
case CriterionType.SelfDefine:
|
||||
// 先找到需要删除的
|
||||
var needDeleteMarkQuestionIds = questionList.Except(markquestionId).ToList();
|
||||
|
||||
foreach (var item in needDeleteMarkQuestionIds)
|
||||
{
|
||||
// 对于要删除的标记不能删除 要与问题解绑
|
||||
|
@ -2176,21 +2223,19 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
case CriterionType.Lugano2014:
|
||||
|
||||
await _readingTaskQuestionMarkRepository.BatchUpdateNoTrackingAsync(x =>
|
||||
(x.QuestionType == QuestionType.SplenicTopPosition || x.QuestionType == QuestionType.SplenicBottomPosition) &&
|
||||
x.VisitTaskId == inDto.VisitTaskId && needDeleteMarkQuestonIds.Contains(x.QuestionId), x => new ReadingTaskQuestionMark()
|
||||
{
|
||||
PicturePath = string.Empty,
|
||||
MeasureData = string.Empty,
|
||||
});
|
||||
// 先找到需要删除的
|
||||
|
||||
await _readingTaskQuestionMarkRepository.BatchUpdateNoTrackingAsync(x =>
|
||||
(x.QuestionType == QuestionType.LiverSUVmax || x.QuestionType == QuestionType.MediastinumSUVmax) &&
|
||||
x.VisitTaskId == inDto.VisitTaskId && needDeleteMarkQuestonIds.Contains(x.QuestionId), x => new ReadingTaskQuestionMark()
|
||||
foreach (var item in needDeleteMarkQuestionIds)
|
||||
{
|
||||
OtherPicturePath = string.Empty,
|
||||
OtherMeasureData = string.Empty,
|
||||
});
|
||||
// 对于要删除的标记不能删除 要与问题解绑
|
||||
// 但是对于一个标记绑定多个问题的情况 相当于是要删除掉这条信息
|
||||
var questionMark = await _readingTaskQuestionMarkRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == item).FirstOrDefaultAsync();
|
||||
if (questionMark != null)
|
||||
{
|
||||
await _readingTaskQuestionMarkRepository.DeleteAsync(questionMark);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
await addOrEditmark(inDto.QuestionMarkInfoList);
|
||||
|
||||
|
|
|
@ -3368,12 +3368,14 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
// 这里本来就批量展示问题的 现在又需要单个展示
|
||||
var thisQuestinonAnswer = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTaskQuestionAnswer)).Select(x => x.Entity as ReadingTaskQuestionAnswer).FirstOrDefault();
|
||||
|
||||
var question = await _dbContext.ReadingQuestionTrial.Where(x => x.Id == thisQuestinonAnswer.ReadingQuestionTrialId).FirstOrDefaultAsync();
|
||||
|
||||
string questionName = string.Empty;
|
||||
string questionAnswer = string.Empty;
|
||||
if (thisQuestinonAnswer != null)
|
||||
{
|
||||
questionName = await _dbContext.ReadingQuestionTrial.Where(x => x.Id == thisQuestinonAnswer.ReadingQuestionTrialId).Select(x => _userInfo.IsEn_Us ? x.QuestionEnName : x.QuestionName).FirstOrDefaultAsync();
|
||||
questionAnswer = thisQuestinonAnswer.Answer;
|
||||
questionName = _userInfo.IsEn_Us ? question.QuestionEnName : question.QuestionName;
|
||||
questionAnswer = Translationunit(question.Type, question.Unit, question.CustomUnit, unitDataList, thisQuestinonAnswer.Answer) ;
|
||||
}
|
||||
|
||||
await InsertInspection<ReadingTaskQuestionAnswer>(cloneEntity, type, x => new InspectionConvertDTO()
|
||||
|
@ -3429,7 +3431,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
var entity = item.Entity as ReadingTableQuestionAnswer;
|
||||
|
||||
var tableQuestionName = await _dbContext.ReadingTableQuestionTrial.Where(x => x.Id == entity.TableQuestionId).Select(x => _userInfo.IsEn_Us ? x.QuestionEnName : x.QuestionName).FirstOrDefaultAsync();
|
||||
var tableQuestion = await _dbContext.ReadingTableQuestionTrial.Where(x => x.Id == entity.TableQuestionId).FirstOrDefaultAsync();
|
||||
var questionName = await _dbContext.ReadingQuestionTrial.Where(x => x.Id == entity.QuestionId).Select(x => _userInfo.IsEn_Us ? x.QuestionEnName : x.QuestionName).FirstOrDefaultAsync();
|
||||
var generalId = IdentifierHelper.CreateGuid(entity.VisitTaskId.ToString(), entity.QuestionId.ToString(), entity.RowId.ToString(), entity.TableQuestionId.ToString(), "ReadingTableQuestionAnswer");
|
||||
var rowMark = await _dbContext.ReadingTableAnswerRowInfo.Where(x => x.Id == entity.RowId).Select(x => x.RowMark).FirstOrDefaultAsync();
|
||||
|
@ -3444,7 +3446,12 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
{
|
||||
markName = mark.OrderMarkName;
|
||||
}
|
||||
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();
|
||||
|
||||
await InsertInspection<ReadingTableQuestionAnswer>(entity, type, x => new InspectionConvertDTO()
|
||||
{
|
||||
|
@ -3455,11 +3462,12 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
}, new
|
||||
{
|
||||
Answer= Translationunit(tableQuestion.Type, tableQuestion.Unit, tableQuestion.CustomUnit, unitDataList, entity.Answer),
|
||||
MarkName = markName,
|
||||
PicturePath = mark != null ? mark.PicturePath : string.Empty,
|
||||
QuestionName = questionName,
|
||||
RowMark = rowMark,
|
||||
TableQuestionName = tableQuestionName,
|
||||
TableQuestionName = _userInfo.IsEn_Us ? tableQuestion.QuestionEnName : tableQuestion.QuestionName,
|
||||
}, _userInfo.AuditIdentification);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue