修改一版
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Application.ViewModel
|
||||
{
|
||||
public class AddTaskLesionAnswerFromLastTaskInDto
|
||||
{
|
||||
public Guid VisitTaskId { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class AddTaskLesionAnswerFromLastTaskOutDto
|
||||
{
|
||||
public bool IsBaseLine { get; set; }
|
||||
}
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
public interface ICriterionCalculateService
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 自动计算 并修改值
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
Task CalculateTask(CalculateTaskInDto inDto);
|
||||
|
||||
/// <summary>
|
||||
/// 验证访视提交
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
Task VerifyVisitTaskQuestions(VerifyVisitTaskQuestionsInDto inDto);
|
||||
|
||||
/// <summary>
|
||||
/// 将上一次的访视病灶添加到这一次
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
Task<AddTaskLesionAnswerFromLastTaskOutDto> AddTaskLesionAnswerFromLastTask(AddTaskLesionAnswerFromLastTaskInDto inDto);
|
||||
|
||||
/// <summary>
|
||||
/// 获取报告验证的信息(这里每个标准可能不一样 返回用object)
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
Task<object> GetReportVerify(GetReportVerifyInDto inDto);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
public interface IReadingCalculateService
|
||||
{
|
||||
/// <summary>
|
||||
/// 自动计算 并修改值
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
Task CalculateTask(CalculateTaskInDto inDto);
|
||||
|
||||
/// <summary>
|
||||
/// 验证访视提交
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
Task VerifyVisitTaskQuestions(VerifyVisitTaskQuestionsInDto inDto);
|
||||
|
||||
/// <summary>
|
||||
/// 将上一次的访视病灶添加到这一次
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
Task<AddTaskLesionAnswerFromLastTaskOutDto> AddTaskLesionAnswerFromLastTask(AddTaskLesionAnswerFromLastTaskInDto inDto);
|
||||
|
||||
/// <summary>
|
||||
/// 获取报告验证的信息(这里每个标准可能不一样 返回用object)
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
Task<object> GetReportVerify(GetReportVerifyInDto inDto);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,144 @@
|
||||
using IRaCIS.Core.Application.Interfaces;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
{
|
||||
[ApiExplorerSettings(GroupName = "Image")]
|
||||
public class ReadingCalculateService: BaseService, IReadingCalculateService
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 标准和服务对应
|
||||
/// </summary>
|
||||
Dictionary<CriterionType, Type> CalculateServiceDic = new Dictionary<CriterionType, Type>()
|
||||
{
|
||||
{CriterionType.RECIST1Pointt1,typeof(RECIST1Point1CalculateService) } //RECIST1.1
|
||||
};
|
||||
|
||||
private readonly IEnumerable<ICriterionCalculateService> CriterionServices;
|
||||
|
||||
private readonly IEnumerable<ICriterionCalculateService> _criterionServices;
|
||||
private readonly IRepository<VisitTask> _visitTaskRepository;
|
||||
private readonly IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository;
|
||||
private ICriterionCalculateService _useCriterion;
|
||||
|
||||
|
||||
public ReadingCalculateService(IEnumerable<ICriterionCalculateService> criterionServices,
|
||||
IRepository<VisitTask> visitTaskRepository,
|
||||
IRepository<ReadingQuestionCriterionTrial> readingQuestionCriterionTrialRepository
|
||||
|
||||
)
|
||||
{
|
||||
|
||||
_criterionServices = criterionServices;
|
||||
this._visitTaskRepository = visitTaskRepository;
|
||||
this._readingQuestionCriterionTrialRepository = readingQuestionCriterionTrialRepository;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取Service
|
||||
/// </summary>
|
||||
/// <param name="visitTaskId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ICriterionCalculateService> GetService(Guid visitTaskId)
|
||||
{
|
||||
if (_useCriterion == null)
|
||||
{
|
||||
var criterionId = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Select(x => x.TrialReadingCriterionId).FirstNotNullAsync();
|
||||
|
||||
var criterionType = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == criterionId).Select(x => x.CriterionType).FirstOrDefaultAsync();
|
||||
|
||||
if (criterionType == null)
|
||||
{
|
||||
throw new BusinessValidationFailedException($"当前标准计算未开发好");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
CriterionType thisCriterionType = criterionType.Value;
|
||||
Type thisServiceType = CalculateServiceDic[thisCriterionType];
|
||||
_useCriterion = CriterionServices.FirstOrDefault(x => x.GetType().Name == nameof(thisServiceType) + "Proxy");
|
||||
|
||||
if (criterionType == null)
|
||||
{
|
||||
throw new BusinessValidationFailedException($"当前标准计算未开发好");
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
throw new BusinessValidationFailedException($"当前标准计算未开发好");
|
||||
}
|
||||
|
||||
return _useCriterion;
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return _useCriterion;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 自动计算 并修改值
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task CalculateTask(CalculateTaskInDto inDto)
|
||||
{
|
||||
var service = await this.GetService(inDto.VisitTaskId);
|
||||
await service.CalculateTask(inDto);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 验证访视提交
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task VerifyVisitTaskQuestions(VerifyVisitTaskQuestionsInDto inDto)
|
||||
{
|
||||
var service = await this.GetService(inDto.VisitTaskId);
|
||||
await service.VerifyVisitTaskQuestions(inDto);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将上一次的访视病灶添加到这一次
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<AddTaskLesionAnswerFromLastTaskOutDto> AddTaskLesionAnswerFromLastTask(AddTaskLesionAnswerFromLastTaskInDto inDto)
|
||||
{
|
||||
var service = await this.GetService(inDto.VisitTaskId);
|
||||
return await service.AddTaskLesionAnswerFromLastTask(inDto);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取报告验证的信息(这里每个标准可能不一样 返回用object)
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<object> GetReportVerify(GetReportVerifyInDto inDto)
|
||||
{
|
||||
var service = await this.GetService(inDto.VisitTaskId);
|
||||
return await service.GetReportVerify(inDto);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user