代码修改
							parent
							
								
									4f8f4fe9b8
								
							
						
					
					
						commit
						2260303876
					
				| 
						 | 
				
			
			@ -9,6 +9,16 @@ using System.Collections.Generic;
 | 
			
		|||
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 CalculateTaskInDto
 | 
			
		||||
    {
 | 
			
		||||
        public Guid VisitTaskId { get; set; }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,6 +11,7 @@ using Microsoft.Extensions.Caching.Memory;
 | 
			
		|||
 | 
			
		||||
using IRaCIS.Core.Infrastructure;
 | 
			
		||||
using MassTransit;
 | 
			
		||||
using System.Reflection.Metadata.Ecma335;
 | 
			
		||||
 | 
			
		||||
namespace IRaCIS.Core.Application.Service.ReadingCalculate
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			@ -351,7 +352,61 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
 | 
			
		|||
            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>
 | 
			
		||||
        /// 计算任务
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1533,10 +1533,66 @@ namespace IRaCIS.Core.Domain.Share
 | 
			
		|||
        /// </summary>
 | 
			
		||||
        Part = 8,
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 首次标记访视
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        FirstMarkingVisit = 9,
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 部位描述
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        BodyPartDescription = 10,
 | 
			
		||||
 | 
			
		||||
        /// <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>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue