Uat_Study
he 2023-05-31 16:26:51 +08:00
parent 3a7963d0f9
commit 862128abf0
5 changed files with 187 additions and 22 deletions

View File

@ -1111,6 +1111,15 @@
<returns></returns> <returns></returns>
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception> <exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
</member> </member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.GeneralCalculateService.LogRecord(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto,System.String,IRaCIS.Core.Domain.Share.LesionType)">
<summary>
添加计算错误日志
</summary>
<param name="inDto"></param>
<param name="lesionName"></param>
<param name="lesionType"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.GeneralCalculateService.GetReadingCalculateDto(System.Guid)"> <member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.GeneralCalculateService.GetReadingCalculateDto(System.Guid)">
<summary> <summary>
获取ReadingCalculateDto 获取ReadingCalculateDto
@ -1463,7 +1472,7 @@
{ {
疗效为 ND 疗效为 ND
} }
else if (任一病灶从非“存在”状态改为“存在”状态) else if (存在状态为“明确”的其它既往新病灶)
{ {
疗效为 iUPD 疗效为 iUPD
} }
@ -2303,6 +2312,15 @@
<param name="beforeConvertedTaskId"></param> <param name="beforeConvertedTaskId"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:IRaCIS.Core.Application.Service.IGeneralCalculateService.LogRecord(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto,System.String,IRaCIS.Core.Domain.Share.LesionType)">
<summary>
添加计算错误日志
</summary>
<param name="inDto"></param>
<param name="lesionName"></param>
<param name="lesionType"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.IReadingCalculateService.CalculateTask(IRaCIS.Core.Application.Service.Reading.Dto.CalculateTaskInDto)"> <member name="M:IRaCIS.Core.Application.Service.IReadingCalculateService.CalculateTask(IRaCIS.Core.Application.Service.Reading.Dto.CalculateTaskInDto)">
<summary> <summary>
自动计算 并修改值 自动计算 并修改值
@ -7589,9 +7607,9 @@
所有状态为消失 所有状态为消失
</summary> </summary>
</member> </member>
<member name="P:IRaCIS.Core.Application.ViewModel.IRECISTOtherNewTargetLesionDto.LastTaskNoExists"> <member name="P:IRaCIS.Core.Application.ViewModel.IRECISTOtherNewTargetLesionDto.ExistsClear">
<summary> <summary>
当任一病灶从非“存在”状态改为“存在”状态 存在明确状态
</summary> </summary>
</member> </member>
<member name="P:IRaCIS.Core.Application.ViewModel.IRECISTOtherNewTargetLesionDto.ExixtsUnevaluableState"> <member name="P:IRaCIS.Core.Application.ViewModel.IRECISTOtherNewTargetLesionDto.ExixtsUnevaluableState">

View File

@ -220,9 +220,9 @@ namespace IRaCIS.Core.Application.ViewModel
public bool AllVanish { get; set; } public bool AllVanish { get; set; }
/// <summary> /// <summary>
/// 当任一病灶从非“存在”状态改为“存在”状态 /// 存在明确状态
/// </summary> /// </summary>
public bool LastTaskNoExists { get; set; } public bool ExistsClear { get; set; }
/// <summary> /// <summary>
/// 至少有一个病灶无法评估 /// 至少有一个病灶无法评估

View File

@ -2,6 +2,7 @@
using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Infra.EFCore.Common; using IRaCIS.Core.Infra.EFCore.Common;
using MassTransit; using MassTransit;
using Microsoft.Extensions.Logging;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@ -16,6 +17,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
private readonly IRepository<ReadingTableQuestionAnswer> _readingTableQuestionAnswerRepository; private readonly IRepository<ReadingTableQuestionAnswer> _readingTableQuestionAnswerRepository;
private readonly IRepository<VisitTask> _visitTaskRepository; private readonly IRepository<VisitTask> _visitTaskRepository;
private readonly IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository; private readonly IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository;
private readonly ILogger<GeneralCalculateService> _logger;
private readonly IRepository<ReadingTableQuestionTrial> _readingTableQuestionTrialRepository; private readonly IRepository<ReadingTableQuestionTrial> _readingTableQuestionTrialRepository;
private readonly IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository; private readonly IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository;
private readonly IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository; private readonly IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository;
@ -26,7 +28,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
public GeneralCalculateService( public GeneralCalculateService(
IRepository<ReadingTableQuestionAnswer> readingTableQuestionAnswerRepository, IRepository<ReadingTableQuestionAnswer> readingTableQuestionAnswerRepository,
IRepository<VisitTask> visitTaskRepository, IRepository<VisitTask> visitTaskRepository,
IRepository<ReadingQuestionCriterionTrial> readingQuestionCriterionTrialRepository, IRepository<ReadingQuestionCriterionTrial> readingQuestionCriterionTrialRepository,
ILogger<GeneralCalculateService> logger,
IRepository<ReadingTableQuestionTrial> readingTableQuestionTrialRepository, IRepository<ReadingTableQuestionTrial> readingTableQuestionTrialRepository,
IRepository<ReadingTableAnswerRowInfo> readingTableAnswerRowInfoRepository, IRepository<ReadingTableAnswerRowInfo> readingTableAnswerRowInfoRepository,
IRepository<ReadingQuestionTrial> readingQuestionTrialRepository, IRepository<ReadingQuestionTrial> readingQuestionTrialRepository,
@ -38,6 +41,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
this._readingTableQuestionAnswerRepository = readingTableQuestionAnswerRepository; this._readingTableQuestionAnswerRepository = readingTableQuestionAnswerRepository;
this._visitTaskRepository = visitTaskRepository; this._visitTaskRepository = visitTaskRepository;
this._readingQuestionCriterionTrialRepository = readingQuestionCriterionTrialRepository; this._readingQuestionCriterionTrialRepository = readingQuestionCriterionTrialRepository;
this._logger = logger;
this._readingTableQuestionTrialRepository = readingTableQuestionTrialRepository; this._readingTableQuestionTrialRepository = readingTableQuestionTrialRepository;
this._readingTableAnswerRowInfoRepository = readingTableAnswerRowInfoRepository; this._readingTableAnswerRowInfoRepository = readingTableAnswerRowInfoRepository;
this._readingQuestionTrialRepository = readingQuestionTrialRepository; this._readingQuestionTrialRepository = readingQuestionTrialRepository;
@ -46,6 +50,52 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
this._readingTaskQuestionAnswerRepository = readingTaskQuestionAnswerRepository; this._readingTaskQuestionAnswerRepository = readingTaskQuestionAnswerRepository;
} }
/// <summary>
/// 添加计算错误日志
/// </summary>
/// <param name="inDto"></param>
/// <param name="lesionName"></param>
/// <param name="lesionType"></param>
/// <returns></returns>
public async Task LogRecord(ReadingCalculateDto inDto,string lesionName, LesionType lesionType)
{
// 这里是记录日志 不需要国际化
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).FirstNotNullAsync();
//错误级别日志:项目、标准、受试者、阅片人、任务。输出其它既往新病灶数据:
StringBuilder builder = new StringBuilder();
builder.AppendLine($"");
builder.AppendLine($"【项目】:【{criterionInfo.Trial.TrialCode}】");
builder.AppendLine($"【项目Id】:【{criterionInfo.TrialId}】");
builder.AppendLine($"【标准】:【{criterionInfo.CriterionName}】");
builder.AppendLine($"【标准Id】:【{criterionInfo.Id}】");
builder.AppendLine($"【受试者】:【{taskInfo.Subject.ShortName}】");
builder.AppendLine($"【受试者Id】:【{taskInfo.Subject.Id}】");
builder.AppendLine($"【阅片人】:【{taskInfo.DoctorUser.FirstName}】");
builder.AppendLine($"【阅片人Id】:【{taskInfo.DoctorUser.Id}】");
builder.AppendLine($"【任务】:【{taskInfo.TaskBlindName}】");
builder.AppendLine($"【任务Id】:【{taskInfo.Id}】");
builder.AppendLine($"【病灶类型】:【{lesionName}】");
var lesionInfo = inDto.QuestionInfo.Where(x => x.LesionType == lesionType).FirstOrDefault();
if (lesionInfo != null)
{
lesionInfo.TableRowInfoList.OrderBy(x => x.RowIndex).ForEach(x =>
{
builder.AppendLine(@$"【病灶编号】:【{x.RowIndex.ToString()}】,
:{x.TableQuestionList.Where(y=>y.QuestionMark==QuestionMark.MajorAxis).Select(y=>y.Answer).FirstIsNullReturnEmpty()},
:{x.TableQuestionList.Where(y => y.QuestionMark == QuestionMark.ShortAxis).Select(y => y.Answer).FirstIsNullReturnEmpty()},
:{x.TableQuestionList.Where(y => y.QuestionMark == QuestionMark.State).Select(y => y.Answer).FirstIsNullReturnEmpty()}");
});
}
_logger.LogError(builder.ToString());
}
/// <summary> /// <summary>
/// 获取ReadingCalculateDto /// 获取ReadingCalculateDto
/// </summary> /// </summary>

View File

@ -2,13 +2,12 @@
using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Domain.Share;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using IRaCIS.Core.Domain.Models; using IRaCIS.Core.Domain.Models;
using Microsoft.AspNetCore.Mvc;
using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.Interfaces;
using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Application.ViewModel;
using Panda.DynamicWebApi.Attributes; using Panda.DynamicWebApi.Attributes;
using IRaCIS.Core.Infra.EFCore.Common; using IRaCIS.Core.Infra.EFCore.Common;
using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Logging;
using IRaCIS.Core.Infrastructure; using IRaCIS.Core.Infrastructure;
using MassTransit; using MassTransit;
using System.Linq; using System.Linq;
@ -30,6 +29,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
private readonly IRepository<TumorAssessment_IRECIST1Point1> _tumorAssessmentRepository; private readonly IRepository<TumorAssessment_IRECIST1Point1> _tumorAssessmentRepository;
private readonly IGeneralCalculateService _generalCalculateService; private readonly IGeneralCalculateService _generalCalculateService;
private readonly IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswerRepository; private readonly IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswerRepository;
private readonly ILogger<IRECIST1Point1CalculateService> _logger;
public IRECIST1Point1CalculateService( public IRECIST1Point1CalculateService(
IRepository<ReadingTableQuestionAnswer> readingTableQuestionAnswerRepository, IRepository<ReadingTableQuestionAnswer> readingTableQuestionAnswerRepository,
@ -42,6 +44,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
IRepository<SubjectVisit> subjectVisitRepository, IRepository<SubjectVisit> subjectVisitRepository,
IRepository<TumorAssessment_IRECIST1Point1> tumorAssessmentRepository, IRepository<TumorAssessment_IRECIST1Point1> tumorAssessmentRepository,
IGeneralCalculateService generalCalculateService, IGeneralCalculateService generalCalculateService,
ILogger<IRECIST1Point1CalculateService> logger,
IRepository<ReadingTaskQuestionAnswer> readingTaskQuestionAnswerRepository IRepository<ReadingTaskQuestionAnswer> readingTaskQuestionAnswerRepository
) )
{ {
@ -56,6 +59,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
this._tumorAssessmentRepository = tumorAssessmentRepository; this._tumorAssessmentRepository = tumorAssessmentRepository;
this._generalCalculateService = generalCalculateService; this._generalCalculateService = generalCalculateService;
this._readingTaskQuestionAnswerRepository = readingTaskQuestionAnswerRepository; this._readingTaskQuestionAnswerRepository = readingTaskQuestionAnswerRepository;
this._logger = logger;
} }
#region 临时对象 单个请求的生命周期 避免重复查询数据库 #region 临时对象 单个请求的生命周期 避免重复查询数据库
@ -392,7 +396,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
[HttpPost] [HttpPost]
public async Task TestCalculate(Guid visitTaskId, QuestionType type) public async Task TestCalculate(Guid visitTaskId, QuestionType type)
{ {
//_logger.LogError("测试计算");
ReadingCalculateDto readingData = await _generalCalculateService.GetReadingCalculateDto(visitTaskId); ReadingCalculateDto readingData = await _generalCalculateService.GetReadingCalculateDto(visitTaskId);
// await _generalCalculateService.LogRecord(readingData, "其他既往新病灶", LesionType.OtherPreviousNewLesion);
await ReadingCalculate(readingData,new List<QuestionType>() { type}); await ReadingCalculate(readingData,new List<QuestionType>() { type});
} }
@ -2022,6 +2029,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
/// { /// {
/// 疗效为 NE /// 疗效为 NE
/// } /// }
/// else
///{
/// //错误级别日志:项目、标准、受试者、阅片人、任务。输出新靶病灶数据:
///}
/// </remarks> /// </remarks>
/// <param name="inDto"></param> /// <param name="inDto"></param>
/// <returns></returns> /// <returns></returns>
@ -2122,6 +2133,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
// 疗效为 NE // 疗效为 NE
result = NewTargetLesionAssessment.NE; result = NewTargetLesionAssessment.NE;
} }
else
{
//错误级别日志:项目、标准、受试者、阅片人、任务。输出新靶病灶数据:
await _generalCalculateService.LogRecord(inDto, "新靶病灶", LesionType.NewTargetLesion);
}
return result==null?string.Empty: result.Value.GetEnumInt(); return result==null?string.Empty: result.Value.GetEnumInt();
} }
@ -2152,6 +2169,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
/// { /// {
/// 疗效为 NE /// 疗效为 NE
/// } /// }
/// else
/// {
/// //错误级别日志:项目、标准、受试者、阅片人、任务。当前新非靶病灶的病灶数据输出:
/// }
/// </remarks> /// </remarks>
/// <param name="inDto"></param> /// <param name="inDto"></param>
/// <returns></returns> /// <returns></returns>
@ -2218,6 +2239,11 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
{ {
// 疗效为 NE // 疗效为 NE
result = NewNoTargetLesionAssessment.NE; result = NewNoTargetLesionAssessment.NE;
}
else
{
// 错误级别日志:项目、标准、受试者、阅片人、任务。当前新非靶病灶的病灶数据输出:
await _generalCalculateService.LogRecord(inDto, "新非靶病灶", LesionType.NewNonTargetLesion);
} }
return result.GetEnumInt(); return result.GetEnumInt();
@ -2233,7 +2259,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
/// { /// {
/// 疗效为 ND /// 疗效为 ND
/// } /// }
/// else if (任一病灶从非“存在”状态改为“存在”状态) /// else if (存在状态为“明确”的其它既往新病灶)
/// { /// {
/// 疗效为 iUPD /// 疗效为 iUPD
/// } /// }
@ -2245,6 +2271,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
/// { /// {
/// 疗效为 疑似 /// 疗效为 疑似
/// } /// }
/// else
/// {
/// //错误级别日志:项目、标准、受试者、阅片人、任务。输出其它既往新病灶数据:
/// }
/// </remarks> /// </remarks>
/// <param name="inDto"></param> /// <param name="inDto"></param>
/// <returns></returns> /// <returns></returns>
@ -2254,23 +2284,16 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
var lastVisitTaskId = await GetLastVisitTaskId(inDto); var lastVisitTaskId = await GetLastVisitTaskId(inDto);
// 找上一次任务 未被评为显著增大的非靶病灶
ReadingCalculateDto lastTaskCalculateDto = await _generalCalculateService.GetReadingCalculateDto(lastVisitTaskId);
var lastTaskNoExistIndexs = lastTaskCalculateDto.QuestionInfo.Where(x => x.LesionType == LesionType.OtherPreviousNewLesion).SelectMany(x => x.TableRowInfoList)
.Where(x => x.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.State && !x.Answer.EqEnum(OtherPreviousNewLesionState.Exists))).Select(x => x.RowIndex).ToList();
IRECISTOtherNewTargetLesionDto data = new IRECISTOtherNewTargetLesionDto() IRECISTOtherNewTargetLesionDto data = new IRECISTOtherNewTargetLesionDto()
{ {
// 不存在其他既往新病灶 // 不存在其他既往新病灶记录
NotExistsOtherNewTargetLesion = tableQuestion.Count() == 0, NotExistsOtherNewTargetLesion = tableQuestion.Count() == 0,
// 所有状态为消失 // 所有其他既往新病灶状态都为消失
AllVanish = tableQuestion.Count() == tableQuestion.Where(x => x.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(OtherPreviousNewLesionState.Loss))).Count(), AllVanish = tableQuestion.Count() == tableQuestion.Where(x => x.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(OtherPreviousNewLesionState.Loss))).Count(),
// 当任一病灶从非“存在”状态改为“存在”状态 // 存在“明确”状态
LastTaskNoExists = tableQuestion.Where(x => lastTaskNoExistIndexs.Contains(x.RowIndex)).SelectMany(x => x.TableQuestionList).Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(OtherPreviousNewLesionState.Exists)), ExistsClear = tableQuestion.SelectMany(x => x.TableQuestionList).Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(OtherPreviousNewLesionState.Exists)),
// 至少有一个病灶无法评估 // 至少有一个病灶无法评估
ExixtsUnevaluableState = tableQuestion.SelectMany(x => x.TableQuestionList).Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(OtherPreviousNewLesionState.NotEvaluable)), ExixtsUnevaluableState = tableQuestion.SelectMany(x => x.TableQuestionList).Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(OtherPreviousNewLesionState.NotEvaluable)),
@ -2288,8 +2311,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
// 疗效为 ND // 疗效为 ND
result = OtherPreviousNewLesionAssessment.ND; result = OtherPreviousNewLesionAssessment.ND;
} }
// else if (任一病灶从非“存在”状态改为“存在”状态) // else if (存在状态为“明确”的其它既往新病灶)
else if (data.LastTaskNoExists) else if (data.ExistsClear)
{ {
// 疗效为 iUPD // 疗效为 iUPD
result = OtherPreviousNewLesionAssessment.iUPD; result = OtherPreviousNewLesionAssessment.iUPD;
@ -2306,6 +2329,11 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
// 疗效为 疑似 // 疗效为 疑似
result = OtherPreviousNewLesionAssessment.Equivocal; result = OtherPreviousNewLesionAssessment.Equivocal;
} }
else
{
//错误级别日志:项目、标准、受试者、阅片人、任务。输出其它既往新病灶数据:
await _generalCalculateService.LogRecord(inDto, "其它既往新病灶", LesionType.OtherPreviousNewLesion);
}
return result.GetEnumInt(); return result.GetEnumInt();
@ -2419,6 +2447,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
/// { /// {
/// 疗效为 疑似 /// 疗效为 疑似
/// } /// }
/// else
/// {
/// //错误级别日志:项目、标准、受试者、阅片人、任务。输出新病灶数据:
/// }
/// </remarks> /// </remarks>
/// <param name="inDto"></param> /// <param name="inDto"></param>
/// <returns></returns> /// <returns></returns>
@ -2533,7 +2565,34 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
// 疗效为 疑似 // 疗效为 疑似
result = NewLesionAssessment.Suspected; result = NewLesionAssessment.Suspected;
} }
else
{
//错误级别日志:项目、标准、受试者、阅片人、任务。输出新病灶数据:
// 这里是记录日志 不需要国际化
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).FirstNotNullAsync();
StringBuilder builder = new StringBuilder();
builder.AppendLine($"");
builder.AppendLine($"【项目】:【{criterionInfo.Trial.TrialCode}】");
builder.AppendLine($"【项目Id】:【{criterionInfo.TrialId}】");
builder.AppendLine($"【标准】:【{criterionInfo.CriterionName}】");
builder.AppendLine($"【标准Id】:【{criterionInfo.Id}】");
builder.AppendLine($"【受试者】:【{taskInfo.Subject.ShortName}】");
builder.AppendLine($"【受试者Id】:【{taskInfo.Subject.Id}】");
builder.AppendLine($"【阅片人】:【{taskInfo.DoctorUser.FirstName}】");
builder.AppendLine($"【阅片人Id】:【{taskInfo.DoctorUser.Id}】");
builder.AppendLine($"【任务】:【{taskInfo.TaskBlindName}】");
builder.AppendLine($"【任务Id】:【{taskInfo.Id}】");
builder.AppendLine($"【病灶类型】:【新病灶】");
builder.AppendLine($"【新靶病灶评估】:【{inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.NewTargetLesion).Select(x=>x.Answer).FirstIsNullReturnEmpty()}】");
builder.AppendLine($"【新非靶病灶评估】:【{inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.NewNoTargetLesion).Select(x => x.Answer).FirstIsNullReturnEmpty()}】");
builder.AppendLine($"【其它既往新病灶评估】:【{inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.OtherNewTargetLesion).Select(x => x.Answer).FirstIsNullReturnEmpty()}】");
builder.AppendLine($"【触发iRECIST后新病灶评估】:【{inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.IRECISTNewTargetLesion).Select(x => x.Answer).FirstIsNullReturnEmpty()}】");
_logger.LogError(builder.ToString());
)
}
return result == null ? string.Empty : ((NewLesionAssessment)result).GetEnumInt(); return result == null ? string.Empty : ((NewLesionAssessment)result).GetEnumInt();
} }
@ -2671,6 +2730,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
/// { /// {
/// 疗效为 NE /// 疗效为 NE
/// } /// }
/// else
/// {
/// //错误级别日志:项目、标准、受试者、阅片人、任务。输出靶病灶、非靶病灶、新病灶的评估结果:
/// }
/// </remarks> /// </remarks>
/// <param name="inDto"></param> /// <param name="inDto"></param>
/// <returns></returns> /// <returns></returns>
@ -2895,6 +2958,30 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
// 疗效为 NE // 疗效为 NE
result = OverallAssessment.NE; result = OverallAssessment.NE;
} }
else
{
//错误级别日志:项目、标准、受试者、阅片人、任务。输出靶病灶、非靶病灶、新病灶的评估结果:
// 这里是记录日志 不需要国际化
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).FirstNotNullAsync();
StringBuilder builder = new StringBuilder();
builder.AppendLine($"");
builder.AppendLine($"【项目】:【{criterionInfo.Trial.TrialCode}】");
builder.AppendLine($"【项目Id】:【{criterionInfo.TrialId}】");
builder.AppendLine($"【标准】:【{criterionInfo.CriterionName}】");
builder.AppendLine($"【标准Id】:【{criterionInfo.Id}】");
builder.AppendLine($"【受试者】:【{taskInfo.Subject.ShortName}】");
builder.AppendLine($"【受试者Id】:【{taskInfo.Subject.Id}】");
builder.AppendLine($"【阅片人】:【{taskInfo.DoctorUser.FirstName}】");
builder.AppendLine($"【阅片人Id】:【{taskInfo.DoctorUser.Id}】");
builder.AppendLine($"【任务】:【{taskInfo.TaskBlindName}】");
builder.AppendLine($"【任务Id】:【{taskInfo.Id}】");
builder.AppendLine($"【病灶类型】:【新病灶】");
builder.AppendLine($"【靶病灶评估】:【{inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.TargetLesion).Select(x => x.Answer).FirstIsNullReturnEmpty()}】");
builder.AppendLine($"【非靶病灶评估】:【{inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.NoTargetLesion).Select(x => x.Answer).FirstIsNullReturnEmpty()}】");
builder.AppendLine($"【新病灶评估】:【{inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.NewLesionEvaluation).Select(x => x.Answer).FirstIsNullReturnEmpty()}】");
_logger.LogError(builder.ToString());
}
return result == null ? string.Empty : ((OverallAssessment)result).GetEnumInt(); return result == null ? string.Empty : ((OverallAssessment)result).GetEnumInt();
} }

View File

@ -1,4 +1,5 @@
using IRaCIS.Core.Application.Service.Reading.Dto; using IRaCIS.Core.Application.Service.Reading.Dto;
using IRaCIS.Core.Domain.Share;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@ -31,5 +32,14 @@ namespace IRaCIS.Core.Application.Service
/// <param name="beforeConvertedTaskId"></param> /// <param name="beforeConvertedTaskId"></param>
/// <returns></returns> /// <returns></returns>
Task AddConvertedTaskFocus(Guid visitTaskId, Guid beforeConvertedTaskId); Task AddConvertedTaskFocus(Guid visitTaskId, Guid beforeConvertedTaskId);
/// <summary>
/// 添加计算错误日志
/// </summary>
/// <param name="inDto"></param>
/// <param name="lesionName"></param>
/// <param name="lesionType"></param>
/// <returns></returns>
Task LogRecord(ReadingCalculateDto inDto, string lesionName, LesionType lesionType);
} }
} }