85 lines
3.2 KiB
C#
85 lines
3.2 KiB
C#
|
|
using IRaCIS.Core.Domain.Models;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using IRaCIS.Core.Application.Interfaces;
|
|
using IRaCIS.Core.Application.ViewModel;
|
|
using IRaCIS.Core.Infra.EFCore.Common;
|
|
using MassTransit;
|
|
using IRaCIS.Core.Infrastructure;
|
|
using IRaCIS.Core.Application.Service.Reading.Dto;
|
|
using IRaCIS.Core.Domain.Share;
|
|
|
|
namespace IRaCIS.Core.Application.Service
|
|
{
|
|
/// <summary>
|
|
/// 阅片医学审核
|
|
/// </summary>
|
|
[ ApiExplorerSettings(GroupName = "Reading")]
|
|
public class ReadingMedicalReviewService : BaseService
|
|
{
|
|
|
|
private readonly IRepository<ReadingMedicineTrialQuestion> _readingMedicineTrialQuestionRepository;
|
|
private readonly IRepository<Trial> _trialRepository;
|
|
private readonly IRepository<VisitTask> _visitTaskRepository;
|
|
private readonly IRepository<ReadingMedicineSystemQuestion> _readingMedicineSystemQuestionRepository;
|
|
|
|
public ReadingMedicalReviewService(
|
|
IRepository<ReadingMedicineTrialQuestion> readingMedicineTrialQuestionRepository,
|
|
IRepository<Trial> trialRepository,
|
|
IRepository<VisitTask> visitTaskRepository,
|
|
IRepository<ReadingMedicineSystemQuestion> readingMedicineSystemQuestionRepository
|
|
)
|
|
{
|
|
this._readingMedicineTrialQuestionRepository = readingMedicineTrialQuestionRepository;
|
|
this._trialRepository = trialRepository;
|
|
this._visitTaskRepository = visitTaskRepository;
|
|
this._readingMedicineSystemQuestionRepository = readingMedicineSystemQuestionRepository;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取
|
|
/// </summary>
|
|
/// <param name="inDto"></param>
|
|
/// <returns></returns>
|
|
public async Task<GetMedicalReviewReadingTaskOutDto> GetMedicalReviewReadingTask(GetMedicalReviewReadingTaskInDto inDto)
|
|
{
|
|
var medicalReviewInfo = await _trialRepository.Where(x => x.Id == inDto.TrialId).Select(x => new GetMedicalReviewReadingTaskOutDto()
|
|
{
|
|
ReadingType=x.ReadingType,
|
|
IsReadingTaskViewInOrder=x.IsReadingTaskViewInOrder
|
|
}).FirstOrDefaultAsync();
|
|
|
|
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.TrialId).FirstOrDefaultAsync();
|
|
|
|
|
|
// 单审有序
|
|
if (medicalReviewInfo.IsReadingTaskViewInOrder)
|
|
{
|
|
medicalReviewInfo.TaskList = await _visitTaskRepository.Where(x => x.SouceReadModuleId == taskInfo.SouceReadModuleId && x.SourceSubjectVisitId == taskInfo.SourceSubjectVisitId
|
|
&& x.DoctorUserId == taskInfo.DoctorUserId && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.ReReadingApplyState != ReReadingApplyState.Agree
|
|
).OrderBy(x => x.VisitTaskNum).Select(x => new TaskInfo()
|
|
{
|
|
Id = x.Id,
|
|
ReadingCategory = x.ReadingCategory,
|
|
TaskBlindName = x.TaskBlindName,
|
|
TaskName = x.TaskName
|
|
}).ToListAsync();
|
|
if (medicalReviewInfo.ReadingType == ReadingMethod.Double)
|
|
{
|
|
//medicalReviewInfo.OtherDoctorTaskList=
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return medicalReviewInfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|