Uat_Study
parent
b5687431f0
commit
74b73e2e59
|
@ -1295,6 +1295,16 @@
|
|||
阅片计算Dto
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto.IsChangeOtherTask">
|
||||
<summary>
|
||||
是否修改其他任务
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto.IsOnlyChangeAllTask">
|
||||
<summary>
|
||||
是否只改其他任务
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.QuestionInfo.Answer">
|
||||
<summary>
|
||||
答案
|
||||
|
@ -3710,6 +3720,11 @@
|
|||
阅片计算
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:IRaCIS.Core.Application.Service.ReadingCalculateService.sODData">
|
||||
<summary>
|
||||
获取Sod的值
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculateService.CalculateTask(IRaCIS.Core.Application.Service.Reading.Dto.CalculateTaskInDto)">
|
||||
<summary>
|
||||
计算任务
|
||||
|
@ -3827,20 +3842,25 @@
|
|||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculateService.ChangeAllLowestIncrease(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto,System.Guid)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculateService.ChangeAllLowestIncrease(IRaCIS.Core.Application.Service.Reading.Dto.ChangeAllTaskDto)">
|
||||
<summary>
|
||||
修改与整个访视期间最低点相比增加的值(mm)
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<param name="questionId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculateService.ChangeAllLowPercent(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto,System.Guid)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculateService.ChangeAllLowPercent(IRaCIS.Core.Application.Service.Reading.Dto.ChangeAllTaskDto)">
|
||||
<summary>
|
||||
修改整个访视期间最低点相比增加的百分比
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<param name="questionId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculateService.ChangeAllLowVisitName(IRaCIS.Core.Application.Service.Reading.Dto.ChangeAllTaskDto)">
|
||||
<summary>
|
||||
修改最低方式点名称
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculateService.ChangeAllVisitTaskAnswer(System.Collections.Generic.List{System.Guid},System.Guid,System.String)">
|
||||
|
|
|
@ -90,7 +90,6 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
/// </summary>
|
||||
public class ReadingCalculateDto
|
||||
{
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
public Guid VisitTaskId { get; set; }
|
||||
|
@ -103,7 +102,15 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
|
||||
public bool IsChangeOtherTask { get; set; }
|
||||
/// <summary>
|
||||
/// 是否修改其他任务
|
||||
/// </summary>
|
||||
public bool IsChangeOtherTask { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 是否只改其他任务
|
||||
/// </summary>
|
||||
public bool IsOnlyChangeAllTask { get; set; } = false;
|
||||
|
||||
public List<QuestionInfo> QuestionInfo { get; set; } = new List<QuestionInfo>();
|
||||
|
||||
|
@ -191,7 +198,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
{
|
||||
public QuestionType QuestionType { get; set; }
|
||||
|
||||
public Func<ReadingCalculateDto, Task<dynamic>> GetSingleDataFun { get; set; }
|
||||
public Func<ReadingCalculateDto, Task<decimal>> GetDecimalFun { get; set; }
|
||||
|
||||
public Func<ReadingCalculateDto, Task<decimal?>> GetDecimalNullFun { get; set; }
|
||||
|
||||
public Func<ReadingCalculateDto, Task<string>> GetStringFun { get; set; }
|
||||
|
||||
public Func<ChangeAllTaskDto,Task> ChangeAllTaskFun { get; set; }
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ using IRaCIS.Core.Domain.Share;
|
|||
using IRaCIS.Core.Infra.EFCore.Common;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
|
@ -54,7 +55,12 @@ namespace IRaCIS.Core.Application.Service
|
|||
}
|
||||
|
||||
#region 临时对象 单个请求的生命周期 避免重复查询数据库
|
||||
|
||||
private List<VisitTaskAnswerInfo> visitTaskAnswerList;
|
||||
|
||||
/// <summary>
|
||||
/// 获取Sod的值
|
||||
/// </summary>
|
||||
private decimal? sODData;
|
||||
#endregion
|
||||
|
||||
|
@ -78,151 +84,112 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// <returns></returns>
|
||||
public async Task ReadingCalculate(ReadingCalculateDto inDto)
|
||||
{
|
||||
// 找到所有访视任务的Id
|
||||
|
||||
var visitTaskIds = await _visitTaskRepository.Where(x => !x.IsAnalysisCreate && x.ReadingCategory == ReadingCategory.Visit &&
|
||||
x.TaskState == TaskState.Effect && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.DoctorUserId == inDto.DoctorUserId).Select(x => x.Id).ToListAsync();
|
||||
|
||||
|
||||
|
||||
|
||||
#region 计算 这里顺序非常重要 后面计算的值要依赖前面计算的结果
|
||||
var needAddList = new List<ReadingTaskQuestionAnswer>();
|
||||
// 循环找要计算的值进行计算
|
||||
foreach (var item in inDto.QuestionInfo.Where(x => x.QuestionType != null))
|
||||
{
|
||||
|
||||
switch (item.QuestionType)
|
||||
|
||||
|
||||
List<ReadingCalculateData> calculateList = new List<ReadingCalculateData>()
|
||||
{
|
||||
//靶病灶径线之和(SOD)
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.SOD,GetDecimalNullFun=GetSODData},
|
||||
|
||||
//非淋巴结靶病灶长径之和
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.SumOfDiameter,GetDecimalNullFun=GetSumOfDiameter},
|
||||
|
||||
//与基线SOD相比变化量(mm)
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.SODChange,GetDecimalNullFun=GetSODChange},
|
||||
|
||||
//与基线访视相比SOD变化百分比
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.SODPercent,GetDecimalNullFun=GetSODPercent},
|
||||
|
||||
//与整个访视期间最低点相比增加的值(mm) 其他任务需要改
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.LowestIncrease,GetDecimalNullFun=GetLowestIncrease,ChangeAllTaskFun=ChangeAllLowestIncrease},
|
||||
|
||||
//与整个访视期间最低点相比增加的百分比 其他任务需要改
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.LowPercent,GetDecimalNullFun=GetLowPercent,ChangeAllTaskFun=ChangeAllLowPercent},
|
||||
|
||||
//整个访视期间最低点访视名称 其他任务需要改
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.LowVisit,GetStringFun=GetLowVisit,ChangeAllTaskFun=ChangeAllLowVisitName},
|
||||
|
||||
//是否存在非淋巴结靶病灶
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.IsLymphTarget,GetStringFun=GetIsLymphTarget},
|
||||
|
||||
//是否存在淋巴结靶病灶且该病灶比上一访视短径增加5MM以上
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.IsAddFive,GetStringFun=GetIsAddFive},
|
||||
|
||||
//被评估为NE的单个靶病灶
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.NETarget,GetStringFun=GetNETarget},
|
||||
|
||||
//靶病灶评估
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.TargetLesion,GetStringFun=GetTargetLesionEvaluate},
|
||||
|
||||
//非靶病灶评估
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.NoTargetLesion,GetStringFun=GetNoTargetLesionEvaluate},
|
||||
|
||||
//是否存在新病灶
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.NewLesions,GetStringFun=GetNewLesionEvaluate},
|
||||
|
||||
//整体肿瘤评估
|
||||
new ReadingCalculateData (){QuestionType=QuestionType.Tumor,GetStringFun=GetTumor},
|
||||
|
||||
};
|
||||
|
||||
|
||||
foreach (var calculate in calculateList)
|
||||
{
|
||||
var item=inDto.QuestionInfo.FirstOrDefault(x => x.QuestionType == calculate.QuestionType);
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
// 靶病灶径线之和(SOD)
|
||||
case QuestionType.SOD:
|
||||
needAddList.Add(new ReadingTaskQuestionAnswer()
|
||||
{
|
||||
Answer = (await GetSODData(inDto)).ToString(),
|
||||
ReadingQuestionTrialId = item.QuestionId,
|
||||
});
|
||||
break;
|
||||
//计算答案
|
||||
if(inDto.IsOnlyChangeAllTask==false)
|
||||
{
|
||||
|
||||
// 非淋巴结靶病灶长径之和
|
||||
case QuestionType.SumOfDiameter:
|
||||
needAddList.Add(new ReadingTaskQuestionAnswer()
|
||||
#region 计算答案
|
||||
if (calculate.GetDecimalFun != null)
|
||||
{
|
||||
Answer = (await GetSumOfDiameter(inDto)).ToString(),
|
||||
ReadingQuestionTrialId = item.QuestionId,
|
||||
});
|
||||
break;
|
||||
// 与基线SOD相比变化量(mm)
|
||||
case QuestionType.SODChange:
|
||||
needAddList.Add(new ReadingTaskQuestionAnswer()
|
||||
{
|
||||
Answer = (await GetSODChange(inDto)).ToString(),
|
||||
ReadingQuestionTrialId = item.QuestionId,
|
||||
});
|
||||
break;
|
||||
// 与基线访视相比SOD变化百分比
|
||||
case QuestionType.SODPercent:
|
||||
needAddList.Add(new ReadingTaskQuestionAnswer()
|
||||
{
|
||||
Answer = (await GetSODPercent(inDto)).ToString(),
|
||||
ReadingQuestionTrialId = item.QuestionId,
|
||||
});
|
||||
break;
|
||||
// 与整个访视期间最低点相比增加的值(mm) 其他任务需要改
|
||||
case QuestionType.LowestIncrease:
|
||||
item.Answer = (await calculate.GetDecimalFun(inDto)).ToString();
|
||||
|
||||
if (!inDto.IsChangeOtherTask)
|
||||
{
|
||||
needAddList.Add(new ReadingTaskQuestionAnswer()
|
||||
{
|
||||
Answer = (await GetLowestIncrease(inDto)).ToString(),
|
||||
ReadingQuestionTrialId = item.QuestionId,
|
||||
});
|
||||
}
|
||||
else
|
||||
else if (calculate.GetDecimalNullFun != null)
|
||||
{
|
||||
await ChangeAllLowestIncrease(new ChangeAllTaskDto()
|
||||
{
|
||||
calculateDto = inDto,
|
||||
QuestionId = item.QuestionId,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
// 与整个访视期间最低点相比增加的百分比 其他任务需要改
|
||||
case QuestionType.LowPercent:
|
||||
|
||||
if (!inDto.IsChangeOtherTask)
|
||||
{
|
||||
needAddList.Add(new ReadingTaskQuestionAnswer()
|
||||
var value = await calculate.GetDecimalNullFun(inDto);
|
||||
if (value == null)
|
||||
{
|
||||
Answer = (await GetLowPercent(inDto)).ToString(),
|
||||
ReadingQuestionTrialId = item.QuestionId,
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
await ChangeAllLowPercent(inDto, item.QuestionId);
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
// 整个访视期间最低点访视名称 其他任务需要改
|
||||
case QuestionType.LowVisit:
|
||||
var answer = (await GetLowVisit(inDto)).ToString();
|
||||
if (!inDto.IsChangeOtherTask)
|
||||
{
|
||||
needAddList.Add(new ReadingTaskQuestionAnswer()
|
||||
item.Answer = string.Empty;
|
||||
}
|
||||
else
|
||||
|
||||
{
|
||||
Answer = answer,
|
||||
ReadingQuestionTrialId = item.QuestionId,
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
if (inDto.IsChangeOtherTask)
|
||||
{
|
||||
await this.ChangeAllVisitTaskAnswer(visitTaskIds, item.QuestionId, answer);
|
||||
item.Answer = value.ToString();
|
||||
}
|
||||
}
|
||||
else if (calculate.GetStringFun != null)
|
||||
{
|
||||
item.Answer = await calculate.GetStringFun(inDto);
|
||||
}
|
||||
#endregion
|
||||
needAddList.Add(new ReadingTaskQuestionAnswer()
|
||||
{
|
||||
Answer = item.Answer,
|
||||
ReadingQuestionTrialId = item.QuestionId,
|
||||
});
|
||||
}
|
||||
|
||||
break;
|
||||
// 是否存在非淋巴结靶病灶
|
||||
case QuestionType.IsLymphTarget:
|
||||
needAddList.Add(new ReadingTaskQuestionAnswer()
|
||||
// 修改全局
|
||||
if (inDto.IsChangeOtherTask && calculate.ChangeAllTaskFun != null)
|
||||
{
|
||||
await calculate.ChangeAllTaskFun(new ChangeAllTaskDto()
|
||||
{
|
||||
Answer = await GetIsLymphTarget(inDto),
|
||||
ReadingQuestionTrialId = item.QuestionId,
|
||||
calculateDto = inDto,
|
||||
QuestionId = item.QuestionId,
|
||||
});
|
||||
break;
|
||||
// 是否存在淋巴结靶病灶且该病灶比上一访视短径增加5MM以上
|
||||
case QuestionType.IsAddFive:
|
||||
needAddList.Add(new ReadingTaskQuestionAnswer()
|
||||
{
|
||||
Answer = await GetIsAddFive(inDto),
|
||||
ReadingQuestionTrialId = item.QuestionId,
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
// 被评估为NE的单个靶病灶
|
||||
case QuestionType.NETarget:
|
||||
needAddList.Add(new ReadingTaskQuestionAnswer()
|
||||
{
|
||||
Answer = await GetNETarget(inDto),
|
||||
ReadingQuestionTrialId = item.QuestionId,
|
||||
});
|
||||
break;
|
||||
|
||||
// 整体肿瘤评估
|
||||
case QuestionType.Tumor:
|
||||
needAddList.Add(new ReadingTaskQuestionAnswer()
|
||||
{
|
||||
Answer = await GetTumor(inDto),
|
||||
ReadingQuestionTrialId = item.QuestionId,
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var questionIds = needAddList.Select(x => x.ReadingQuestionTrialId).ToList();
|
||||
|
||||
|
@ -252,13 +219,12 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// <returns></returns>
|
||||
public async Task<VerifyVisitTaskQuestionsOutDto> VerifyVisitTaskQuestions(VerifyVisitTaskQuestionsInDto inDto)
|
||||
{
|
||||
await this.CalculateTask(new CalculateTaskInDto()
|
||||
{
|
||||
VisitTaskId = inDto.VisitTaskId,
|
||||
IsChangeOtherTask = true
|
||||
});
|
||||
visitTaskAnswerList = null;
|
||||
|
||||
ReadingCalculateDto data = await GetReadingCalculateDto(inDto.VisitTaskId);
|
||||
data.IsChangeOtherTask = true;
|
||||
data.IsOnlyChangeAllTask = true;
|
||||
await ReadingCalculate(data);
|
||||
|
||||
VerifyVisitTaskQuestionsOutDto result = new VerifyVisitTaskQuestionsOutDto() {
|
||||
|
||||
IsVerified=true,
|
||||
|
@ -285,6 +251,10 @@ namespace IRaCIS.Core.Application.Service
|
|||
}
|
||||
}
|
||||
}
|
||||
if (!result.ErrorMessage.IsNullOrEmpty())
|
||||
{
|
||||
throw new BusinessValidationFailedException(result.ErrorMessage);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -362,7 +332,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// 非淋巴结的长径 和淋巴结的短径
|
||||
/// </remarks>
|
||||
/// <returns></returns>
|
||||
public async Task<decimal> GetSODData(ReadingCalculateDto inDto)
|
||||
public async Task<decimal?> GetSODData(ReadingCalculateDto inDto)
|
||||
{
|
||||
if (sODData != null)
|
||||
{
|
||||
|
@ -371,6 +341,11 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
var tableQuestion = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.TargetLesion).SelectMany(x => x.TableRowInfoList).ToList();
|
||||
|
||||
if (tableQuestion.Count() == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
decimal result = 0;
|
||||
|
||||
foreach (var item in tableQuestion)
|
||||
|
@ -403,10 +378,15 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<decimal> GetSumOfDiameter(ReadingCalculateDto inDto)
|
||||
public async Task<decimal?> GetSumOfDiameter(ReadingCalculateDto inDto)
|
||||
{
|
||||
var tableQuestion = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.TargetLesion).SelectMany(x => x.TableRowInfoList).ToList();
|
||||
|
||||
if (tableQuestion.Count() == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
decimal result = 0;
|
||||
|
||||
foreach (var item in tableQuestion)
|
||||
|
@ -429,9 +409,16 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<decimal> GetSODChange(ReadingCalculateDto inDto)
|
||||
public async Task<decimal?> GetSODChange(ReadingCalculateDto inDto)
|
||||
{
|
||||
return await GetSODData(inDto) - await GetBaseLineSOD(inDto);
|
||||
|
||||
var value = await GetSODData(inDto);
|
||||
|
||||
if (value == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return value.NullChange0() - await GetBaseLineSOD(inDto);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
@ -441,9 +428,15 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<decimal> GetSODPercent(ReadingCalculateDto inDto)
|
||||
public async Task<decimal?> GetSODPercent(ReadingCalculateDto inDto)
|
||||
{
|
||||
var thisSOD = await GetSODData(inDto);
|
||||
|
||||
if (thisSOD == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var baseLineSOD = await GetBaseLineSOD(inDto);
|
||||
|
||||
if (baseLineSOD == 0)
|
||||
|
@ -452,7 +445,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
}
|
||||
else
|
||||
{
|
||||
return decimal.Round(thisSOD * 100 / baseLineSOD, 2);
|
||||
return decimal.Round(thisSOD.NullChange0() * 100 / baseLineSOD, 2);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
@ -466,11 +459,16 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// 要更新之前的
|
||||
/// </remarks>
|
||||
/// <returns></returns>
|
||||
public async Task<decimal> GetLowestIncrease(ReadingCalculateDto inDto)
|
||||
public async Task<decimal?> GetLowestIncrease(ReadingCalculateDto inDto)
|
||||
{
|
||||
var value = await GetSODData(inDto);
|
||||
if (value == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
var decimalAnswerList = await GetVisitTaskAnswerList(inDto);
|
||||
var minSOD = decimalAnswerList.OrderBy(x => x.SOD).Select(x => x.SOD).FirstOrDefault();
|
||||
return await GetSODData(inDto) - minSOD;
|
||||
return value.NullChange0() - minSOD;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
@ -483,9 +481,13 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// 要更新之前的
|
||||
/// </remarks>
|
||||
/// <returns></returns>
|
||||
public async Task<decimal> GetLowPercent(ReadingCalculateDto inDto)
|
||||
public async Task<decimal?> GetLowPercent(ReadingCalculateDto inDto)
|
||||
{
|
||||
var thisSOD = await GetSODData(inDto);
|
||||
if (thisSOD == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
var decimalAnswerList = await GetVisitTaskAnswerList(inDto);
|
||||
var minSOD = decimalAnswerList.OrderBy(x => x.SOD).Select(x => x.SOD).FirstOrDefault();
|
||||
|
||||
|
@ -495,7 +497,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
}
|
||||
else
|
||||
{
|
||||
return decimal.Round((thisSOD- minSOD) * 100 / minSOD, 2);
|
||||
return decimal.Round((thisSOD.NullChange0()- minSOD) * 100 / minSOD, 2);
|
||||
}
|
||||
|
||||
|
||||
|
@ -618,7 +620,6 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// 修改与整个访视期间最低点相比增加的值(mm)
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <param name="questionId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task ChangeAllLowestIncrease(ChangeAllTaskDto inDto)
|
||||
{
|
||||
|
@ -642,11 +643,10 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// 修改整个访视期间最低点相比增加的百分比
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <param name="questionId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task ChangeAllLowPercent(ReadingCalculateDto inDto, Guid questionId)
|
||||
public async Task ChangeAllLowPercent(ChangeAllTaskDto inDto)
|
||||
{
|
||||
var visitTaskList = await GetVisitTaskAnswerList(inDto);
|
||||
var visitTaskList = await GetVisitTaskAnswerList(inDto.calculateDto);
|
||||
var lowSod = visitTaskList.Select(x => x.SOD).OrderBy(x => x).FirstOrDefault();
|
||||
foreach (var item in visitTaskList)
|
||||
{
|
||||
|
@ -660,7 +660,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
percent= decimal.Round((item.SOD - lowSod) * 100 / lowSod, 2);
|
||||
}
|
||||
|
||||
await _readingTaskQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == item.VisitTaskId && x.ReadingQuestionTrialId == questionId, x => new ReadingTaskQuestionAnswer()
|
||||
await _readingTaskQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == item.VisitTaskId && x.ReadingQuestionTrialId == inDto.QuestionId, x => new ReadingTaskQuestionAnswer()
|
||||
{
|
||||
Answer = percent.ToString()
|
||||
});
|
||||
|
@ -669,6 +669,26 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
#endregion
|
||||
|
||||
#region 修改最低方式点名称
|
||||
/// <summary>
|
||||
/// 修改最低方式点名称
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task ChangeAllLowVisitName(ChangeAllTaskDto inDto)
|
||||
{
|
||||
// 找到所有访视任务的Id
|
||||
|
||||
var visitTaskIds = await _visitTaskRepository.Where(x => !x.IsAnalysisCreate && x.ReadingCategory == ReadingCategory.Visit &&
|
||||
x.TaskState == TaskState.Effect && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.DoctorUserId == inDto.calculateDto.DoctorUserId).Select(x => x.Id).ToListAsync();
|
||||
|
||||
var answer = (await GetLowVisit(inDto.calculateDto)).ToString();
|
||||
await this.ChangeAllVisitTaskAnswer(visitTaskIds, inDto.QuestionId, answer);
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 通用方法
|
||||
|
@ -772,6 +792,11 @@ namespace IRaCIS.Core.Application.Service
|
|||
public async Task<string> GetTargetLesionEvaluate(ReadingCalculateDto inDto)
|
||||
{
|
||||
var tableQuestion = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.TargetLesion).SelectMany(x => x.TableRowInfoList).ToList();
|
||||
|
||||
if (tableQuestion.Count() == 0)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
TargetLesionCalculateDto resultData = new TargetLesionCalculateDto()
|
||||
{
|
||||
//非淋巴结靶病灶长径之和 decimal
|
||||
|
@ -911,8 +936,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
var tableQuestions = tableRows.SelectMany(x => x.TableQuestionList).ToList();
|
||||
|
||||
//任意单个病灶 / 病灶组评估为“显著增大”
|
||||
if (tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer == "显著增大"))
|
||||
//任意单个病灶 / 病灶组评估为“显著增大”
|
||||
if (tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer == "显著增大"))
|
||||
{
|
||||
return "PD";
|
||||
}
|
||||
|
@ -964,9 +989,10 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
var tableQuestions = tableRows.SelectMany(x => x.TableQuestionList).ToList();
|
||||
|
||||
|
||||
|
||||
// 当前访视存在至少一个明确新病灶
|
||||
if (tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer == "明确"))
|
||||
// 当前访视存在至少一个明确新病灶
|
||||
if (tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer == "明确"))
|
||||
{
|
||||
return "是";
|
||||
}
|
||||
|
|
|
@ -1851,9 +1851,21 @@ namespace IRaCIS.Application.Services
|
|||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<VerifyVisitTaskQuestionsOutDto> VerifyVisitTaskQuestions(VerifyVisitTaskQuestionsInDto inDto)
|
||||
public async Task<IResponseOutput> VerifyVisitTaskQuestions(VerifyVisitTaskQuestionsInDto inDto)
|
||||
{
|
||||
return await _readingCalculateService.VerifyVisitTaskQuestions(inDto);
|
||||
List<ReadingCalculateData> calculateList = new List<ReadingCalculateData>()
|
||||
{
|
||||
|
||||
new ReadingCalculateData (){
|
||||
QuestionType=QuestionType.SOD,
|
||||
|
||||
},
|
||||
|
||||
|
||||
};
|
||||
|
||||
await _readingCalculateService.VerifyVisitTaskQuestions(inDto);
|
||||
return ResponseOutput.Ok(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -38,6 +38,19 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
}
|
||||
}
|
||||
|
||||
public static decimal NullChange0(this decimal? value)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
return 0;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return value.Value;
|
||||
}
|
||||
}
|
||||
|
||||
public static decimal IsNullOrEmptyReturn0(this string value)
|
||||
{
|
||||
if (value == null || value == string.Empty)
|
||||
|
|
Loading…
Reference in New Issue