Uat_Study
parent
3a7963d0f9
commit
862128abf0
|
@ -1111,6 +1111,15 @@
|
|||
<returns></returns>
|
||||
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
|
||||
</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)">
|
||||
<summary>
|
||||
获取ReadingCalculateDto
|
||||
|
@ -1463,7 +1472,7 @@
|
|||
{
|
||||
疗效为 ND
|
||||
}
|
||||
else if (任一病灶从非“存在”状态改为“存在”状态)
|
||||
else if (存在状态为“明确”的其它既往新病灶)
|
||||
{
|
||||
疗效为 iUPD
|
||||
}
|
||||
|
@ -2303,6 +2312,15 @@
|
|||
<param name="beforeConvertedTaskId"></param>
|
||||
<returns></returns>
|
||||
</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)">
|
||||
<summary>
|
||||
自动计算 并修改值
|
||||
|
@ -7589,9 +7607,9 @@
|
|||
所有状态为消失
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.ViewModel.IRECISTOtherNewTargetLesionDto.LastTaskNoExists">
|
||||
<member name="P:IRaCIS.Core.Application.ViewModel.IRECISTOtherNewTargetLesionDto.ExistsClear">
|
||||
<summary>
|
||||
当任一病灶从非“存在”状态改为“存在”状态
|
||||
存在明确状态
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.ViewModel.IRECISTOtherNewTargetLesionDto.ExixtsUnevaluableState">
|
||||
|
|
|
@ -220,9 +220,9 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
public bool AllVanish { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 当任一病灶从非“存在”状态改为“存在”状态
|
||||
/// 存在明确状态
|
||||
/// </summary>
|
||||
public bool LastTaskNoExists { get; set; }
|
||||
public bool ExistsClear { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 至少有一个病灶无法评估
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infra.EFCore.Common;
|
||||
using MassTransit;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
@ -16,6 +17,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
private readonly IRepository<ReadingTableQuestionAnswer> _readingTableQuestionAnswerRepository;
|
||||
private readonly IRepository<VisitTask> _visitTaskRepository;
|
||||
private readonly IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository;
|
||||
private readonly ILogger<GeneralCalculateService> _logger;
|
||||
private readonly IRepository<ReadingTableQuestionTrial> _readingTableQuestionTrialRepository;
|
||||
private readonly IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository;
|
||||
private readonly IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository;
|
||||
|
@ -26,7 +28,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
public GeneralCalculateService(
|
||||
IRepository<ReadingTableQuestionAnswer> readingTableQuestionAnswerRepository,
|
||||
IRepository<VisitTask> visitTaskRepository,
|
||||
IRepository<ReadingQuestionCriterionTrial> readingQuestionCriterionTrialRepository,
|
||||
IRepository<ReadingQuestionCriterionTrial> readingQuestionCriterionTrialRepository,
|
||||
ILogger<GeneralCalculateService> logger,
|
||||
IRepository<ReadingTableQuestionTrial> readingTableQuestionTrialRepository,
|
||||
IRepository<ReadingTableAnswerRowInfo> readingTableAnswerRowInfoRepository,
|
||||
IRepository<ReadingQuestionTrial> readingQuestionTrialRepository,
|
||||
|
@ -38,6 +41,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
this._readingTableQuestionAnswerRepository = readingTableQuestionAnswerRepository;
|
||||
this._visitTaskRepository = visitTaskRepository;
|
||||
this._readingQuestionCriterionTrialRepository = readingQuestionCriterionTrialRepository;
|
||||
this._logger = logger;
|
||||
this._readingTableQuestionTrialRepository = readingTableQuestionTrialRepository;
|
||||
this._readingTableAnswerRowInfoRepository = readingTableAnswerRowInfoRepository;
|
||||
this._readingQuestionTrialRepository = readingQuestionTrialRepository;
|
||||
|
@ -46,6 +50,52 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
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>
|
||||
/// 获取ReadingCalculateDto
|
||||
/// </summary>
|
||||
|
|
|
@ -2,13 +2,12 @@
|
|||
using IRaCIS.Core.Domain.Share;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using IRaCIS.Core.Application.Interfaces;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using Panda.DynamicWebApi.Attributes;
|
||||
using IRaCIS.Core.Infra.EFCore.Common;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
|
||||
using Microsoft.Extensions.Logging;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using MassTransit;
|
||||
using System.Linq;
|
||||
|
@ -30,6 +29,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
private readonly IRepository<TumorAssessment_IRECIST1Point1> _tumorAssessmentRepository;
|
||||
private readonly IGeneralCalculateService _generalCalculateService;
|
||||
private readonly IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswerRepository;
|
||||
private readonly ILogger<IRECIST1Point1CalculateService> _logger;
|
||||
|
||||
|
||||
|
||||
public IRECIST1Point1CalculateService(
|
||||
IRepository<ReadingTableQuestionAnswer> readingTableQuestionAnswerRepository,
|
||||
|
@ -42,6 +44,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
IRepository<SubjectVisit> subjectVisitRepository,
|
||||
IRepository<TumorAssessment_IRECIST1Point1> tumorAssessmentRepository,
|
||||
IGeneralCalculateService generalCalculateService,
|
||||
ILogger<IRECIST1Point1CalculateService> logger,
|
||||
IRepository<ReadingTaskQuestionAnswer> readingTaskQuestionAnswerRepository
|
||||
)
|
||||
{
|
||||
|
@ -56,6 +59,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
this._tumorAssessmentRepository = tumorAssessmentRepository;
|
||||
this._generalCalculateService = generalCalculateService;
|
||||
this._readingTaskQuestionAnswerRepository = readingTaskQuestionAnswerRepository;
|
||||
this._logger = logger;
|
||||
}
|
||||
|
||||
#region 临时对象 单个请求的生命周期 避免重复查询数据库
|
||||
|
@ -392,7 +396,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
[HttpPost]
|
||||
public async Task TestCalculate(Guid visitTaskId, QuestionType type)
|
||||
{
|
||||
//_logger.LogError("测试计算");
|
||||
ReadingCalculateDto readingData = await _generalCalculateService.GetReadingCalculateDto(visitTaskId);
|
||||
// await _generalCalculateService.LogRecord(readingData, "其他既往新病灶", LesionType.OtherPreviousNewLesion);
|
||||
|
||||
await ReadingCalculate(readingData,new List<QuestionType>() { type});
|
||||
}
|
||||
|
||||
|
@ -2022,6 +2029,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
/// {
|
||||
/// 疗效为 NE
|
||||
/// }
|
||||
/// else
|
||||
///{
|
||||
/// //错误级别日志:项目、标准、受试者、阅片人、任务。输出新靶病灶数据:
|
||||
///}
|
||||
/// </remarks>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
|
@ -2122,6 +2133,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
// 疗效为 NE
|
||||
result = NewTargetLesionAssessment.NE;
|
||||
}
|
||||
else
|
||||
{
|
||||
//错误级别日志:项目、标准、受试者、阅片人、任务。输出新靶病灶数据:
|
||||
await _generalCalculateService.LogRecord(inDto, "新靶病灶", LesionType.NewTargetLesion);
|
||||
|
||||
}
|
||||
|
||||
return result==null?string.Empty: result.Value.GetEnumInt();
|
||||
}
|
||||
|
@ -2152,6 +2169,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
/// {
|
||||
/// 疗效为 NE
|
||||
/// }
|
||||
/// else
|
||||
/// {
|
||||
/// //错误级别日志:项目、标准、受试者、阅片人、任务。当前新非靶病灶的病灶数据输出:
|
||||
/// }
|
||||
/// </remarks>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
|
@ -2218,6 +2239,11 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
{
|
||||
// 疗效为 NE
|
||||
result = NewNoTargetLesionAssessment.NE;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 错误级别日志:项目、标准、受试者、阅片人、任务。当前新非靶病灶的病灶数据输出:
|
||||
await _generalCalculateService.LogRecord(inDto, "新非靶病灶", LesionType.NewNonTargetLesion);
|
||||
}
|
||||
|
||||
return result.GetEnumInt();
|
||||
|
@ -2233,7 +2259,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
/// {
|
||||
/// 疗效为 ND
|
||||
/// }
|
||||
/// else if (任一病灶从非“存在”状态改为“存在”状态)
|
||||
/// else if (存在状态为“明确”的其它既往新病灶)
|
||||
/// {
|
||||
/// 疗效为 iUPD
|
||||
/// }
|
||||
|
@ -2245,6 +2271,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
/// {
|
||||
/// 疗效为 疑似
|
||||
/// }
|
||||
/// else
|
||||
/// {
|
||||
/// //错误级别日志:项目、标准、受试者、阅片人、任务。输出其它既往新病灶数据:
|
||||
/// }
|
||||
/// </remarks>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
|
@ -2254,23 +2284,16 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
|
||||
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()
|
||||
{
|
||||
// 不存在其他既往新病灶
|
||||
// 不存在其他既往新病灶记录
|
||||
NotExistsOtherNewTargetLesion = tableQuestion.Count() == 0,
|
||||
|
||||
// 所有状态为消失
|
||||
// 所有其他既往新病灶状态都为消失
|
||||
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)),
|
||||
|
@ -2288,8 +2311,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
// 疗效为 ND
|
||||
result = OtherPreviousNewLesionAssessment.ND;
|
||||
}
|
||||
// else if (任一病灶从非“存在”状态改为“存在”状态)
|
||||
else if (data.LastTaskNoExists)
|
||||
// else if (存在状态为“明确”的其它既往新病灶)
|
||||
else if (data.ExistsClear)
|
||||
{
|
||||
// 疗效为 iUPD
|
||||
result = OtherPreviousNewLesionAssessment.iUPD;
|
||||
|
@ -2306,6 +2329,11 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
// 疗效为 疑似
|
||||
result = OtherPreviousNewLesionAssessment.Equivocal;
|
||||
}
|
||||
else
|
||||
{
|
||||
//错误级别日志:项目、标准、受试者、阅片人、任务。输出其它既往新病灶数据:
|
||||
await _generalCalculateService.LogRecord(inDto, "其它既往新病灶", LesionType.OtherPreviousNewLesion);
|
||||
}
|
||||
|
||||
return result.GetEnumInt();
|
||||
|
||||
|
@ -2419,6 +2447,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
/// {
|
||||
/// 疗效为 疑似
|
||||
/// }
|
||||
/// else
|
||||
/// {
|
||||
/// //错误级别日志:项目、标准、受试者、阅片人、任务。输出新病灶数据:
|
||||
/// }
|
||||
/// </remarks>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
|
@ -2533,7 +2565,34 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
// 疗效为 疑似
|
||||
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();
|
||||
}
|
||||
|
@ -2671,6 +2730,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
/// {
|
||||
/// 疗效为 NE
|
||||
/// }
|
||||
/// else
|
||||
/// {
|
||||
/// //错误级别日志:项目、标准、受试者、阅片人、任务。输出靶病灶、非靶病灶、新病灶的评估结果:
|
||||
/// }
|
||||
/// </remarks>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
|
@ -2895,6 +2958,30 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
// 疗效为 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();
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
@ -31,5 +32,14 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// <param name="beforeConvertedTaskId"></param>
|
||||
/// <returns></returns>
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue