Merge branch 'Test_IRC_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-01-08 16:09:54 +08:00
7 changed files with 115 additions and 13 deletions
@@ -725,6 +725,25 @@ namespace IRaCIS.Application.Contracts
/// </summary>
public string HospitalCN { get; set; } = string.Empty;
/// <summary>
/// 大学
/// </summary>
public string UniversityAffiliated { get; set; } = string.Empty;
/// <summary>
/// 大学
/// </summary>
public string UniversityAffiliatedCN { get; set; } = string.Empty;
/// <summary>
/// 医院
/// </summary>
public string HospitalName { get; set; } = string.Empty;
/// <summary>
/// 医院
/// </summary>
public string HospitalNameCN { get; set; } = string.Empty;
}
#endregion
@@ -77,7 +77,7 @@ namespace IRaCIS.Core.Application.Service
medicalReviewInfo.ArmEnum = taskInfo.ArmEnum;
medicalReviewInfo.SubjectCode = taskInfo.IsAnalysisCreate ? taskInfo.BlindSubjectCode : taskInfo.Subject.Code;
medicalReviewInfo.TaskBlindName = taskInfo.TaskBlindName;
medicalReviewInfo.ReadingUser = taskInfo.DoctorUser.IdentityUser.FullName;
medicalReviewInfo.ReadingUser = taskInfo.DoctorUser.FullName;
medicalReviewInfo.SubjectId = taskInfo.SubjectId;
medicalReviewInfo.IsClosedDialog = medicalReviewInfo.MedicalReviewInfo.IsClosedDialog;
medicalReviewInfo.AuditState = medicalReviewInfo.MedicalReviewInfo.AuditState;
@@ -129,7 +129,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
{
// 这里是记录日志 不需要国际化
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).Include(x => x.Trial).FirstNotNullAsync();
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.Subject).Include(x => x.DoctorUser).ThenInclude(t => t.IdentityUser).FirstNotNullAsync();
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.Subject).Include(x => x.DoctorUser).FirstNotNullAsync();
//错误级别日志:项目、标准、受试者、阅片人、任务。输出其它既往新病灶数据:
@@ -141,7 +141,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
builder.AppendLine($"【标准Id】:【{criterionInfo.Id}】");
builder.AppendLine($"【受试者】:【{taskInfo.Subject.ShortName}】");
builder.AppendLine($"【受试者Id】:【{taskInfo.Subject.Id}】");
builder.AppendLine($"【阅片人】:【{taskInfo.DoctorUser.IdentityUser.FullName}】");
builder.AppendLine($"【阅片人】:【{taskInfo.DoctorUser.FullName}】");
builder.AppendLine($"【阅片人Id】:【{taskInfo.DoctorUser.Id}】");
builder.AppendLine($"【任务】:【{taskInfo.TaskBlindName}】");
builder.AppendLine($"【任务Id】:【{taskInfo.Id}】");
@@ -2698,7 +2698,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
//错误级别日志:项目、标准、受试者、阅片人、任务。输出新病灶数据:
// 这里是记录日志 不需要国际化
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).Include(x => x.Trial).FirstNotNullAsync();
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.Subject).Include(x => x.DoctorUser).ThenInclude(t => t.IdentityUser).FirstNotNullAsync();
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.Subject).Include(x => x.DoctorUser).FirstNotNullAsync();
StringBuilder builder = new StringBuilder();
builder.AppendLine($"");
builder.AppendLine($"【项目】:【{criterionInfo.Trial.TrialCode}】");
@@ -2707,7 +2707,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
builder.AppendLine($"【标准Id】:【{criterionInfo.Id}】");
builder.AppendLine($"【受试者】:【{taskInfo.Subject.ShortName}】");
builder.AppendLine($"【受试者Id】:【{taskInfo.Subject.Id}】");
builder.AppendLine($"【阅片人】:【{taskInfo.DoctorUser.IdentityUser.FullName}】");
builder.AppendLine($"【阅片人】:【{taskInfo.DoctorUser.FullName}】");
builder.AppendLine($"【阅片人Id】:【{taskInfo.DoctorUser.Id}】");
builder.AppendLine($"【任务】:【{taskInfo.TaskBlindName}】");
builder.AppendLine($"【任务Id】:【{taskInfo.Id}】");
@@ -3091,7 +3091,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
//错误级别日志:项目、标准、受试者、阅片人、任务。输出靶病灶、非靶病灶、新病灶的评估结果:
// 这里是记录日志 不需要国际化
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).Include(x => x.Trial).FirstNotNullAsync();
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.Subject).Include(x => x.DoctorUser).ThenInclude(t=>t.IdentityUser).FirstNotNullAsync();
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.Subject).Include(x => x.DoctorUser).FirstNotNullAsync();
StringBuilder builder = new StringBuilder();
builder.AppendLine($"");
builder.AppendLine($"【项目】:【{criterionInfo.Trial.TrialCode}】");
@@ -3100,7 +3100,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
builder.AppendLine($"【标准Id】:【{criterionInfo.Id}】");
builder.AppendLine($"【受试者】:【{taskInfo.Subject.ShortName}】");
builder.AppendLine($"【受试者Id】:【{taskInfo.Subject.Id}】");
builder.AppendLine($"【阅片人】:【{taskInfo.DoctorUser.IdentityUser.FullName}】");
builder.AppendLine($"【阅片人】:【{taskInfo.DoctorUser.FullName}】");
builder.AppendLine($"【阅片人Id】:【{taskInfo.DoctorUser.Id}】");
builder.AppendLine($"【任务】:【{taskInfo.TaskBlindName}】");
builder.AppendLine($"【任务Id】:【{taskInfo.Id}】");
@@ -498,6 +498,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
{
// 脂肪平均
new ReadingCalculateData (){QuestionType=QuestionType.TotalMeanFraction,GetStringFun=GetFatFractionAvg},
// 脂肪分级
new ReadingCalculateData (){QuestionType=QuestionType.FattyLiverGrading,GetStringFun=GetFattyLiverGrading},
};
@@ -597,8 +600,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
var rowInfo = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.FatFraction)
.SelectMany(x => x.TableRowInfoList).ToList();
var tableQuestionList = rowInfo.Where(x=>x.TableQuestionList.Any(x=>x.QuestionMark== QuestionMark.IsMeasurable&& x.Answer.EqEnum(YesOrNoOrNa.Yes))).SelectMany(x => x.TableQuestionList).ToList();
var tableQuestionList = rowInfo.Where(x=>x.TableQuestionList.Any(x=>x.QuestionMark== QuestionMark.IsMeasurable && x.Answer.EqEnum(YesOrNoOrNa.Yes))).SelectMany(x => x.TableQuestionList).ToList();
if (rowInfo.Where(x => x.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.AverageValue && x.Answer.IsNotNullOrEmpty())).SelectMany(x => x.TableQuestionList).ToList().Count() != 8)
{
return string.Empty;
}
if (tableQuestionList.Count() == 0)
{
return "NE";
@@ -608,6 +615,37 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
}
/// <summary>
/// 获取脂肪肝分级
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
public async Task<string> GetFattyLiverGrading(ReadingCalculateDto inDto)
{
var answer = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.TotalMeanFraction).Select(x => x.Answer).FirstIsNullReturnEmpty();
if (answer == "NE")
{
return FattyLiverClassification.NE.GetEnumInt();
}
else if(answer == string.Empty)
{
return string.Empty;
}
if (decimal.TryParse(answer, out var value))
{
return value switch
{
< 5 => FattyLiverClassification.Level0.GetEnumInt(),
< 10 => FattyLiverClassification.Level1.GetEnumInt(),
< 25 => FattyLiverClassification.Level2.GetEnumInt(),
_ => FattyLiverClassification.Level3.GetEnumInt()
};
}
return FattyLiverClassification.NE.GetEnumInt();
}
/// <summary>
/// 计算平均值
/// </summary>
@@ -678,7 +716,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
var rowInfo = readingData.QuestionInfo.Where(x => x.LesionType == LesionType.FatFraction)
.SelectMany(x => x.TableRowInfoList).ToList();
var tableQuestionList = rowInfo.Where(x => x.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsMeasurable && x.Answer.IsNotNullOrEmpty())).ToList();
var tableQuestionList = rowInfo.Where(x => x.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.AverageValue && x.Answer.IsNotNullOrEmpty())).ToList();
if (tableQuestionList.Count() != 8)
{