Merge branch 'Test.IRC' of http://192.168.3.69:3000/XCKJ/irc-netcore-api into Test.IRC
commit
2c6ef0dffe
|
@ -9,6 +9,39 @@ using System.Collections.Generic;
|
||||||
namespace IRaCIS.Core.Application.Service.Reading.Dto
|
namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
{
|
{
|
||||||
|
|
||||||
|
public class GetPPDInfoInDto
|
||||||
|
{
|
||||||
|
public Guid VisitTaskId { get; set; }
|
||||||
|
|
||||||
|
public Guid QuestionId { get; set; }
|
||||||
|
|
||||||
|
public decimal RowIndex { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GetPPDInfoOutDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 最低的PPD
|
||||||
|
/// </summary>
|
||||||
|
public decimal? NadirPPD { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 最低PPD的访视
|
||||||
|
/// </summary>
|
||||||
|
public string? LowPPDVisit { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 该病灶PPD值最小的访视的长径
|
||||||
|
/// </summary>
|
||||||
|
public decimal? LowPPDLDi { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 该病灶PPD值最小的访视的短径
|
||||||
|
/// </summary>
|
||||||
|
public decimal? LowPPDSDi { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public class CalculateTaskInDto
|
public class CalculateTaskInDto
|
||||||
{
|
{
|
||||||
public Guid VisitTaskId { get; set; }
|
public Guid VisitTaskId { get; set; }
|
||||||
|
|
|
@ -113,7 +113,7 @@ namespace IRaCIS.Application.Services
|
||||||
foreach (var item in inDto.QuestionList)
|
foreach (var item in inDto.QuestionList)
|
||||||
{
|
{
|
||||||
|
|
||||||
await _readingGlobalTaskInfoRepository.BatchDeleteNoTrackingAsync(x => x.GlobalTaskId == inDto.GlobalTaskId && x.TaskId == visitTaskId && x.GlobalAnswerType == item.GlobalAnswerType && x.QuestionId == item.QuestionId);
|
await _readingGlobalTaskInfoRepository.BatchDeleteNoTrackingAsync(x => x.GlobalTaskId == inDto.GlobalTaskId && x.TaskId == item.VisitTaskId && x.GlobalAnswerType == item.GlobalAnswerType && x.QuestionId == item.QuestionId);
|
||||||
|
|
||||||
await _readingTaskQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == item.VisitTaskId && x.ReadingQuestionTrialId == item.QuestionId
|
await _readingTaskQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == item.VisitTaskId && x.ReadingQuestionTrialId == item.QuestionId
|
||||||
&& x.Answer != item.Answer && item.Answer != string.Empty && item.Answer != null
|
&& x.Answer != item.Answer && item.Answer != string.Empty && item.Answer != null
|
||||||
|
@ -124,6 +124,7 @@ namespace IRaCIS.Application.Services
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var createtime = DateTime.Now;
|
||||||
await _readingGlobalTaskInfoRepository.AddRangeAsync(inDto.QuestionList.Select(x => new ReadingGlobalTaskInfo()
|
await _readingGlobalTaskInfoRepository.AddRangeAsync(inDto.QuestionList.Select(x => new ReadingGlobalTaskInfo()
|
||||||
{
|
{
|
||||||
Answer = x.Answer,
|
Answer = x.Answer,
|
||||||
|
@ -133,6 +134,7 @@ namespace IRaCIS.Application.Services
|
||||||
GlobalAnswerType = x.GlobalAnswerType,
|
GlobalAnswerType = x.GlobalAnswerType,
|
||||||
TaskId = x.VisitTaskId,
|
TaskId = x.VisitTaskId,
|
||||||
TrialId = inDto.TrialId,
|
TrialId = inDto.TrialId,
|
||||||
|
CreateTime= createtime,
|
||||||
}).ToList());
|
}).ToList());
|
||||||
|
|
||||||
await _visitTaskRepository.UpdatePartialFromQueryAsync(t => t.Id == inDto.GlobalTaskId, u => new VisitTask() { ReadingTaskState = ReadingTaskState.Reading });
|
await _visitTaskRepository.UpdatePartialFromQueryAsync(t => t.Id == inDto.GlobalTaskId, u => new VisitTask() { ReadingTaskState = ReadingTaskState.Reading });
|
||||||
|
|
|
@ -11,6 +11,7 @@ using Microsoft.Extensions.Caching.Memory;
|
||||||
|
|
||||||
using IRaCIS.Core.Infrastructure;
|
using IRaCIS.Core.Infrastructure;
|
||||||
using MassTransit;
|
using MassTransit;
|
||||||
|
using System.Reflection.Metadata.Ecma335;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
{
|
{
|
||||||
|
@ -351,7 +352,61 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
await ReadingCalculate(readingData,new List<QuestionType>() { type});
|
await ReadingCalculate(readingData,new List<QuestionType>() { type});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取最低PDD信息
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<GetPPDInfoOutDto> GetLowPPDInfo(GetPPDInfoInDto inDto)
|
||||||
|
{
|
||||||
|
GetPPDInfoOutDto result = new GetPPDInfoOutDto();
|
||||||
|
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).ProjectTo<VisitTaskDto>(_mapper.ConfigurationProvider).FirstNotNullAsync();
|
||||||
|
var visitTaskIds = await _visitTaskRepository.Where(x => x.ReadingCategory == ReadingCategory.Visit &&
|
||||||
|
x.TrialReadingCriterionId == taskinfo.TrialReadingCriterionId &&
|
||||||
|
x.IsAnalysisCreate == taskinfo.IsAnalysisCreate &&
|
||||||
|
x.DoctorUserId == taskinfo.DoctorUserId &&
|
||||||
|
x.IsSelfAnalysis == taskinfo.IsSelfAnalysis &&
|
||||||
|
x.SubjectId == taskinfo.SubjectId && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.ArmEnum == taskinfo.ArmEnum
|
||||||
|
&& x.VisitTaskNum < taskinfo.VisitTaskNum && x.TaskState == TaskState.Effect
|
||||||
|
).OrderByDescending(x => x.VisitTaskNum).Select(x => x.Id).ToListAsync();
|
||||||
|
|
||||||
|
var answerList = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)
|
||||||
|
&& x.QuestionId == inDto.QuestionId
|
||||||
|
&& x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.PPD && x.RowIndex == inDto.RowIndex)
|
||||||
|
.Select(x => new
|
||||||
|
{
|
||||||
|
x.Answer,
|
||||||
|
x.VisitTaskId,
|
||||||
|
}).ToListAsync();
|
||||||
|
|
||||||
|
var lowPddTaskid = answerList.Select(x => new
|
||||||
|
{
|
||||||
|
Answer = x.Answer.IsNullOrEmptyReturn0(),
|
||||||
|
x.VisitTaskId
|
||||||
|
}).OrderBy(x => x.Answer).Select(x => x.VisitTaskId).FirstOrDefault();
|
||||||
|
|
||||||
|
if (lowPddTaskid != null&& lowPddTaskid!=default(Guid))
|
||||||
|
{
|
||||||
|
|
||||||
|
var lowPPDAnswerList = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)
|
||||||
|
&& x.QuestionId == inDto.QuestionId
|
||||||
|
&& x.RowIndex == inDto.RowIndex).Include(x => x.ReadingTableQuestionTrial)
|
||||||
|
.Select(x => new
|
||||||
|
{
|
||||||
|
x.Answer,
|
||||||
|
x.ReadingTableQuestionTrial.QuestionMark,
|
||||||
|
}).ToListAsync();
|
||||||
|
|
||||||
|
result.LowPPDSDi = lowPPDAnswerList.Where(x => x.QuestionMark == QuestionMark.PPD).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
|
||||||
|
result.LowPPDLDi = lowPPDAnswerList.Where(x => x.QuestionMark == QuestionMark.MajorAxis).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
|
||||||
|
result.LowPPDSDi = lowPPDAnswerList.Where(x => x.QuestionMark == QuestionMark.ShortAxis).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0();
|
||||||
|
result.LowPPDVisit = await _visitTaskRepository.Where(x => x.Id == lowPddTaskid).Select(x => x.TaskBlindName).FirstOrDefaultAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 计算任务
|
/// 计算任务
|
||||||
|
|
|
@ -1533,10 +1533,66 @@ namespace IRaCIS.Core.Domain.Share
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Part = 8,
|
Part = 8,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 首次标记访视
|
||||||
|
/// </summary>
|
||||||
|
FirstMarkingVisit = 9,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 部位描述
|
||||||
|
/// </summary>
|
||||||
|
BodyPartDescription = 10,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 病灶数量
|
/// 病灶数量
|
||||||
/// </summary>
|
/// </summary>
|
||||||
LesionNumber =11,
|
LesionNumber =11,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// PPD
|
||||||
|
/// </summary>
|
||||||
|
PPD = 12,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 最低点PPD
|
||||||
|
/// </summary>
|
||||||
|
NadirPPD = 13,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// PPD最低点所在访视
|
||||||
|
/// </summary>
|
||||||
|
LowPPDVisit = 14,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// PPD最低点LDi
|
||||||
|
/// </summary>
|
||||||
|
LowPPDLDi = 15,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// PPD最低点SDi
|
||||||
|
/// </summary>
|
||||||
|
LowPPDSDi = 16,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 相比最低点PPD增加百分比
|
||||||
|
/// </summary>
|
||||||
|
LowPPDAddPercent = 17,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 相比PPD最低点LDi增加值
|
||||||
|
/// </summary>
|
||||||
|
LowPPDLDiAdded = 18,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 相比PPD最低点SDi增加值
|
||||||
|
/// </summary>
|
||||||
|
LowPPDSDiAdded = 19,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SUVmax
|
||||||
|
/// </summary>
|
||||||
|
SUVmax = 20
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in New Issue