Merge branch 'Test_IRC_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net8
This commit is contained in:
@@ -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; }
|
||||
|
||||
+74
-29
@@ -1997,28 +1997,75 @@ 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)
|
||||
{
|
||||
// 自定义这边 移除标记 还是会传过来 不过 MeasureData 为空字符串
|
||||
inDto.QuestionMarkInfoList = inDto.QuestionMarkInfoList.Where(x => x.MeasureData.IsNotNullOrEmpty()).ToList();
|
||||
|
||||
|
||||
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 (markInfo.IsGeneralMark)
|
||||
{
|
||||
_userInfo.AuditIdentification = "AddMark";
|
||||
}
|
||||
else if (existsMark && inDto.QuestionMarkInfoList.Count(x => x.MeasureData.IsNotNullOrEmpty()) > 0)
|
||||
{
|
||||
_userInfo.AuditIdentification = "UpdateMark";
|
||||
// 自定义这边 移除标记 还是会传过来 不过 MeasureData 为空字符串
|
||||
inDto.QuestionMarkInfoList = inDto.QuestionMarkInfoList.Where(x => x.MeasureData.IsNotNullOrEmpty()).ToList();
|
||||
|
||||
|
||||
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)
|
||||
{
|
||||
_userInfo.AuditIdentification = "AddMark";
|
||||
}
|
||||
else if (existsMark && inDto.QuestionMarkInfoList.Count(x => x.MeasureData.IsNotNullOrEmpty()) > 0)
|
||||
{
|
||||
_userInfo.AuditIdentification = "UpdateMark";
|
||||
}
|
||||
else
|
||||
{
|
||||
_userInfo.AuditIdentification = "DeleteMark";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_userInfo.AuditIdentification = "DeleteMark";
|
||||
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();
|
||||
@@ -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()
|
||||
// 先找到需要删除的
|
||||
|
||||
foreach (var item in needDeleteMarkQuestionIds)
|
||||
{
|
||||
PicturePath = string.Empty,
|
||||
MeasureData = string.Empty,
|
||||
});
|
||||
// 对于要删除的标记不能删除 要与问题解绑
|
||||
// 但是对于一个标记绑定多个问题的情况 相当于是要删除掉这条信息
|
||||
var questionMark = await _readingTaskQuestionMarkRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == item).FirstOrDefaultAsync();
|
||||
if (questionMark != null)
|
||||
{
|
||||
await _readingTaskQuestionMarkRepository.DeleteAsync(questionMark);
|
||||
}
|
||||
|
||||
await _readingTaskQuestionMarkRepository.BatchUpdateNoTrackingAsync(x =>
|
||||
(x.QuestionType == QuestionType.LiverSUVmax || x.QuestionType == QuestionType.MediastinumSUVmax) &&
|
||||
x.VisitTaskId == inDto.VisitTaskId && needDeleteMarkQuestonIds.Contains(x.QuestionId), x => new ReadingTaskQuestionMark()
|
||||
{
|
||||
OtherPicturePath = string.Empty,
|
||||
OtherMeasureData = string.Empty,
|
||||
});
|
||||
}
|
||||
|
||||
await addOrEditmark(inDto.QuestionMarkInfoList);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user