This commit is contained in:
2023-04-04 17:24:31 +08:00
7 changed files with 234 additions and 11 deletions
@@ -402,7 +402,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
{
public Guid VisitTaskId { get; set; }
public Guid QuestionId { get; set; }
public Guid QuestionId { get; set; } = default(Guid);
public Guid RowId { get; set; }
@@ -1395,6 +1395,8 @@ namespace IRaCIS.Application.Services
return ResponseOutput.Ok(true);
}
inDto.QuestionId = deleteRowInfo.QuestionId;
if (await _readingTableAnswerRowInfoRepository.AnyAsync(x => x.SplitRowId == deleteRowInfo.Id && x.MergeRowId == deleteRowInfo.Id))
{
throw new BusinessValidationFailedException(_localizer["ReadingImage_DeleteError"]);
@@ -2044,6 +2046,7 @@ namespace IRaCIS.Application.Services
return ResponseOutput.Ok(true);
}
/// <summary>
/// 验证访视提交
@@ -2055,6 +2058,16 @@ namespace IRaCIS.Application.Services
{
await VerifyTaskIsSign(inDto.VisitTaskId);
await VerifyDefaultQuestionBeAnswer(inDto);
// 转化后的任务不应该有新病灶
var isConvertedTask = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x=>x.IsConvertedTask).FirstNotNullAsync();
if (await _readingTableAnswerRowInfoRepository.AnyAsync(x => x.ReadingQuestionTrial.LesionType == LesionType.NewLesions && x.VisitTaskId == inDto.VisitTaskId))
{
throw new BusinessValidationFailedException(_localizer["ReadingImage_NotNewFocus"]);
}
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
var isBaseline = await _subjectVisitRepository.Where(x => x.Id == taskInfo.SourceSubjectVisitId).Select(x => x.IsBaseLine).FirstOrDefaultAsync();
var readingQuestionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskInfo.TrialReadingCriterionId
@@ -50,6 +50,92 @@ namespace IRaCIS.Core.Application.ViewModel
public class IRECISTTargetLesionDto
{
/// <summary>
/// 基线未选择任何靶病灶
/// </summary>
public bool ExistsTargetLesion { get; set; }
/// <summary>
/// 上一访视评估为iCPD
/// </summary>
public bool LastTaskIsICPD { get; set; }
/// <summary>
/// 满足RECISTPD
/// </summary>
public bool MeetRECISTPD { get; set; }
}
/// <summary>
/// 新靶病灶评估Dto
/// </summary>
public class IRECISTNewTargetLesionDto
{
/// <summary>
/// 存在新靶病灶
/// </summary>
public bool ExistsNewTargetLesion { get; set; }
/// <summary>
/// 所有状态为消失
/// </summary>
public bool AllVanish { get; set; }
/// <summary>
/// 上一访视新靶病灶评估为“iUPD”
/// </summary>
public bool LastTaskIsiUPD { get; set; }
/// <summary>
/// SOD增加5mm以上
/// </summary>
public bool ISODAdd5mm { get; set; }
/// <summary>
/// 有"存在"状态的新靶病灶
/// </summary>
public bool HaveExixtsState { get; set; }
/// <summary>
/// 至少有一个新靶病无法评估
/// </summary>
public bool ExixtsUnevaluableState { get; set; }
}
public class IRECISTNewNoTargetLesionDto
{
/// <summary>
/// 存在新非靶病灶
/// </summary>
public bool ExistsNewNoTargetLesion { get; set; }
/// <summary>
/// 所有状态为消失
/// </summary>
public bool AllVanish { get; set; }
/// <summary>
/// 上一访视新靶病灶评估为“iUPD”
/// </summary>
public bool LastTaskIsiUPD { get; set; }
/// <summary>
/// 任一新非靶病灶状态为“增大”
/// </summary>
public bool ExixtsEnlargementState { get; set; }
/// <summary>
/// 有"存在"状态的病灶
/// </summary>
public bool HaveExixtsState { get; set; }
/// <summary>
/// 至少有一个病灶无法评估
/// </summary>
public bool ExixtsUnevaluableState { get; set; }
}
}
@@ -1574,6 +1574,41 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
#endregion
public async Task<string> GetNewTargetLesionEvaluate(ReadingCalculateDto inDto)
{
var tableQuestion = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.NewTargetLesion).SelectMany(x => x.TableRowInfoList).ToList();
if (inDto.IsBaseLine)
{
return TargetAssessment.NA.GetEnumInt();
}
IRECISTNewTargetLesionDto resultData = new IRECISTNewTargetLesionDto()
{
// 是否存在新靶病灶
ExistsNewTargetLesion = tableQuestion.Count() > 0,
// 所有状态为消失
AllVanish = false,
// 上一访视新靶病灶评估为“iUPD”
LastTaskIsiUPD = true,
//SOD增加5mm以上
ISODAdd5mm = true,
//有"存在"状态的新靶病灶
HaveExixtsState = true,
// 至少有一个新靶病无法评估
ExixtsUnevaluableState = true,
};
return string.Empty;
}
#region
/// <summary>
/// 获取靶病灶评估