Merge branch 'Test_IRC_Net8' of http://192.168.3.68:2000/XCKJ/irc-netcore-api into Test_IRC_Net8

IRC_NewDev
hang 2024-05-21 14:29:15 +08:00
commit 44d62b187f
4 changed files with 112 additions and 25 deletions

View File

@ -1578,6 +1578,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// </summary>
public decimal? JudgeDifferenceValue { get; set; }
/// <summary>
/// 裁判百分比或绝对值的相差值匹配规则
/// </summary>
public JudgeDifferenceType JudgeDifferenceType { get; set; }
public bool IsHaveChange { get; set; } = false;
public string VisitAnswer { get; set; } = string.Empty;
@ -1820,6 +1825,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// </summary>
public decimal? JudgeDifferenceValue { get; set; }
/// <summary>
/// 裁判百分比或绝对值的相差值匹配规则
/// </summary>
public JudgeDifferenceType JudgeDifferenceType { get; set; }
public List<AnswerCombinationDto> AnswerCombination { get; set; }
@ -1837,6 +1847,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// </summary>
public decimal? JudgeDifferenceValue { get; set; }
/// <summary>
/// 裁判百分比或绝对值的相差值匹配规则
/// </summary>
public JudgeDifferenceType JudgeDifferenceType { get; set; }
public string QuestionName { get; set; }
@ -2276,6 +2291,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// 裁判百分比或绝对值的相差值
/// </summary>
public decimal? JudgeDifferenceValue { get; set; }
/// <summary>
/// 裁判百分比或绝对值的相差值匹配规则
/// </summary>
public JudgeDifferenceType JudgeDifferenceType { get; set; }
public string AnswerGroup { get; set; }
@ -2325,6 +2345,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// 裁判百分比或绝对值的相差值
/// </summary>
public decimal? JudgeDifferenceValue { get; set; }
/// <summary>
/// 裁判百分比或绝对值的相差值匹配规则
/// </summary>
public JudgeDifferenceType JudgeDifferenceType { get; set; }
}

View File

@ -47,7 +47,8 @@ namespace IRaCIS.Application.Services
DictionaryCode=x.DictionaryCode,
JudgeType = x.JudgeType,
ReadingQuestionTrialId = x.Id,
JudgeDifferenceValue= x.JudgeDifferenceValue
JudgeDifferenceValue= x.JudgeDifferenceValue,
JudgeDifferenceType=x.JudgeDifferenceType,
}).ToListAsync();
@ -72,7 +73,7 @@ namespace IRaCIS.Application.Services
AnswerGroup = JsonConvert.SerializeObject(inDto.AnswerGroup),
AnswerCombination = JsonConvert.SerializeObject(inDto.AnswerCombination),
JudgeDifferenceValue= inDto.JudgeDifferenceValue,
JudgeDifferenceType=inDto.JudgeDifferenceType,
JudgeType = inDto.JudgeType,
});
@ -617,6 +618,7 @@ namespace IRaCIS.Application.Services
JudgeType = question.JudgeType,
QuestionId = question.Id,
JudgeDifferenceValue=question.JudgeDifferenceValue,
JudgeDifferenceType=question.JudgeDifferenceType,
VisitTaskId = questionAnswer.VisitTaskId,
};
var globalVisitAnswerlist = await globalVisitQuestionQuery.ToListAsync();
@ -625,14 +627,15 @@ namespace IRaCIS.Application.Services
foreach (var item in taskNums)
{
List<GroupTaskAnswerDto> groupTasks = globalVisitAnswerlist.Where(x => x.VisitTaskNum == item).GroupBy(x => new {x.JudgeDifferenceValue, x.QuestionId, x.AnswerGroup, x.JudgeType, x.AnswerCombination }).Select(x => new GroupTaskAnswerDto
List<GroupTaskAnswerDto> groupTasks = globalVisitAnswerlist.Where(x => x.VisitTaskNum == item).GroupBy(x => new {x.JudgeDifferenceValue,x.JudgeDifferenceType, x.QuestionId, x.AnswerGroup, x.JudgeType, x.AnswerCombination }).Select(x => new GroupTaskAnswerDto
{
QuestionId = x.Key.QuestionId,
AnswerGroup = x.Key.AnswerGroup,
AnswerCombination = x.Key.AnswerCombination,
JudgeType = x.Key.JudgeType,
JudgeDifferenceValue=x.Key.JudgeDifferenceValue,
TaskAnswerList = x.Select(y => y.Answer).ToList(),
JudgeDifferenceType = x.Key.JudgeDifferenceType,
TaskAnswerList = x.Select(y => y.Answer).ToList(),
}).ToList();
noteEqual = noteEqual || ComputeJudgeResult(groupTasks);
}
@ -650,19 +653,21 @@ namespace IRaCIS.Application.Services
JudgeType = question.JudgeType,
QuestionId = question.Id,
JudgeDifferenceValue=question.JudgeDifferenceValue,
VisitTaskId = questionAnswet.VisitTaskId,
JudgeDifferenceType = question.JudgeDifferenceType,
VisitTaskId = questionAnswet.VisitTaskId,
};
var questionAnswerlist = await query.ToListAsync();
// 将答案进行分组
List<GroupTaskAnswerDto> groupTasks = questionAnswerlist.GroupBy(x => new {x.JudgeDifferenceValue, x.QuestionId, x.AnswerGroup, x.JudgeType, x.AnswerCombination }).Select(x => new GroupTaskAnswerDto
List<GroupTaskAnswerDto> groupTasks = questionAnswerlist.GroupBy(x => new {x.JudgeDifferenceValue,x.JudgeDifferenceType, x.QuestionId, x.AnswerGroup, x.JudgeType, x.AnswerCombination }).Select(x => new GroupTaskAnswerDto
{
QuestionId = x.Key.QuestionId,
AnswerGroup = x.Key.AnswerGroup,
AnswerCombination = x.Key.AnswerCombination,
JudgeType = x.Key.JudgeType,
JudgeDifferenceValue=x.Key.JudgeDifferenceValue,
TaskAnswerList = x.Select(y => y.Answer).ToList(),
JudgeDifferenceType = x.Key.JudgeDifferenceType,
TaskAnswerList = x.Select(y => y.Answer).ToList(),
}).ToList();
noteEqual = ComputeJudgeResult(groupTasks);
}
@ -703,7 +708,7 @@ namespace IRaCIS.Application.Services
twoItem.AfterQuestionList.Where(x => x.QuestionId != null && x.IsJudgeQuestion).ToList()
).ToList();
List<GroupTaskAnswerDto> globalGroupTasks = newlist.GroupBy(x => new { x.QuestionId, x.AnswerGroup, x.JudgeType, x.AnswerCombination,x.JudgeDifferenceValue }).Select(x => new GroupTaskAnswerDto
List<GroupTaskAnswerDto> globalGroupTasks = newlist.GroupBy(x => new { x.QuestionId, x.AnswerGroup, x.JudgeType, x.AnswerCombination,x.JudgeDifferenceValue,x.JudgeDifferenceType }).Select(x => new GroupTaskAnswerDto
{
QuestionId = x.Key.QuestionId!.Value,
AnswerGroup = x.Key.AnswerGroup,
@ -711,6 +716,7 @@ namespace IRaCIS.Application.Services
JudgeType = x.Key.JudgeType,
TaskAnswerList = x.Select(y => y.Answer).ToList(),
JudgeDifferenceValue= x.Key.JudgeDifferenceValue,
JudgeDifferenceType = x.Key.JudgeDifferenceType,
}).ToList();
noteEqual = noteEqual || ComputeJudgeResult(globalGroupTasks);
}
@ -755,7 +761,8 @@ namespace IRaCIS.Application.Services
JudgeType = question.JudgeType,
QuestionId = question.Id,
JudgeDifferenceValue=question.JudgeDifferenceValue,
};
JudgeDifferenceType = question.JudgeDifferenceType,
};
var visitTaskQuestions = await query.ToListAsync();
@ -763,14 +770,15 @@ namespace IRaCIS.Application.Services
lastTask.AfterQuestionList.Where(x => x.QuestionId != null).ToList()
).ToList();
List<GroupTaskAnswerDto> globalGroupTasks = newlist.GroupBy(x => new {x.JudgeDifferenceValue, x.QuestionId, x.AnswerGroup, x.JudgeType, x.AnswerCombination }).Select(x => new GroupTaskAnswerDto
List<GroupTaskAnswerDto> globalGroupTasks = newlist.GroupBy(x => new {x.JudgeDifferenceValue,x.JudgeDifferenceType, x.QuestionId, x.AnswerGroup, x.JudgeType, x.AnswerCombination }).Select(x => new GroupTaskAnswerDto
{
QuestionId = x.Key.QuestionId!.Value,
AnswerGroup = x.Key.AnswerGroup,
AnswerCombination = x.Key.AnswerCombination,
JudgeType = x.Key.JudgeType,
JudgeDifferenceValue=x.Key.JudgeDifferenceValue,
TaskAnswerList = x.Select(y => y.Answer).ToList(),
JudgeDifferenceType = x.Key.JudgeDifferenceType,
TaskAnswerList = x.Select(y => y.Answer).ToList(),
}).ToList();
noteEqual = noteEqual || ComputeJudgeResult(globalGroupTasks);
}
@ -937,11 +945,24 @@ namespace IRaCIS.Application.Services
deffaultValue =0 -deffaultValue;
}
if (deffaultValue >= item.JudgeDifferenceValue)
if (item.JudgeDifferenceType == JudgeDifferenceType.Greater)
{
noteEqual = true;
if (deffaultValue > item.JudgeDifferenceValue)
{
noteEqual = true;
}
}
else if(item.JudgeDifferenceType == JudgeDifferenceType.AboveOrEqual)
{
if (deffaultValue >= item.JudgeDifferenceValue)
{
noteEqual = true;
}
}
break;
case JudgeTypeEnum.PercentageDifference:
var value1 = taskAnswer1.IsNullOrEmptyReturn0();
@ -952,15 +973,33 @@ namespace IRaCIS.Application.Services
}
else
{
if (value1 < value2)
{
noteEqual = (value2 - value1)*100 / value1 >= item.JudgeDifferenceValue;
}
else
{
noteEqual = (value1 - value2)*100 / value2 >= item.JudgeDifferenceValue;
if (item.JudgeDifferenceType == JudgeDifferenceType.Greater)
{
if (value1 < value2)
{
noteEqual = (value2 - value1) * 100 / value1 > item.JudgeDifferenceValue;
}
else
{
noteEqual = (value1 - value2) * 100 / value2 > item.JudgeDifferenceValue;
}
}
else if (item.JudgeDifferenceType == JudgeDifferenceType.AboveOrEqual)
{
if (value1 < value2)
{
noteEqual = (value2 - value1) * 100 / value1 >= item.JudgeDifferenceValue;
}
else
{
noteEqual = (value1 - value2) * 100 / value2 >= item.JudgeDifferenceValue;
}
}
}

View File

@ -17,10 +17,28 @@ namespace IRaCIS.Core.Domain.Share
}
/// <summary>
/// GetClinicalType
/// </summary>
public enum GetClinicalType
/// <summary>
/// 裁判匹配类型
/// </summary>
public enum JudgeDifferenceType
{
/// <summary>
/// >
/// </summary>
Greater = 0,
/// <summary>
/// ≥
/// </summary>
AboveOrEqual = 1,
}
/// <summary>
/// GetClinicalType
/// </summary>
public enum GetClinicalType
{
/// <summary>

View File

@ -137,7 +137,12 @@ namespace IRaCIS.Core.Domain.Models
/// <summary>
/// 裁判百分比或绝对值的相差值
/// </summary>
public decimal? JudgeDifferenceValue { get; set; }
public decimal? JudgeDifferenceValue { get; set; }
/// <summary>
/// 裁判百分比或绝对值的相差值匹配规则
/// </summary>
public JudgeDifferenceType JudgeDifferenceType { get; set; }
/// <summary>
/// 创建人