修改一版

Uat_Study
he 2022-06-17 14:30:49 +08:00
parent 3f573d6c11
commit 665ca1b7ae
11 changed files with 227 additions and 59 deletions

View File

@ -9,6 +9,7 @@ using IRaCIS.Core.Application.Image.QA;
using IRaCIS.Core.Application.Interfaces;
using IRaCIS.Core.Application.Service.Inspection.DTO;
using IRaCIS.Core.Application.Service.Inspection.Interface;
using IRaCIS.Core.Application.Service.Reading.Dto;
using IRaCIS.Core.Domain.Models;
using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Infra.EFCore;
@ -29,6 +30,7 @@ namespace IRaCIS.Core.API.Controllers
private readonly IUserInfo _userInfo;
private readonly ITrialDocumentService _trialDocumentService;
private readonly IQCListService _qCListService;
private readonly IReadingImageTaskService _iReadingImageTaskService;
private readonly IHttpContextAccessor _httpContext;
private readonly ITrialConfigService _trialConfigService;
private readonly INoneDicomStudyService _noneDicomStudyService;
@ -38,6 +40,7 @@ namespace IRaCIS.Core.API.Controllers
private readonly IQCOperationService _qCOperationService;
private readonly IClinicalDataService _clinicalDataService;
private readonly IVisitPlanService _visitPlanService;
private readonly IInspectionService _inspectionService;
private readonly IRepository<DataInspection> _dataInspectionRepository;
@ -49,6 +52,7 @@ namespace IRaCIS.Core.API.Controllers
ITrialDocumentService trialDocumentService,
IRepository<DataInspection> dataInspectionRepository,
IQCListService _qCListService,
IReadingImageTaskService _iReadingImageTaskService,
IHttpContextAccessor httpContext,
IInspectionService sinspectionService,
ITrialConfigService _trialConfigService,
@ -67,6 +71,7 @@ namespace IRaCIS.Core.API.Controllers
this._inspectionService = sinspectionService;
this._trialDocumentService = trialDocumentService;
this._qCListService = _qCListService;
this._iReadingImageTaskService = _iReadingImageTaskService;
this._httpContext = httpContext;
this._trialConfigService = _trialConfigService;
this._noneDicomStudyService = noneDicomStudyService;
@ -95,8 +100,17 @@ namespace IRaCIS.Core.API.Controllers
#endregion
[HttpPost, Route("Inspection/ReadingImageTask/SubmitVisitTaskQuestionsInDto")]
[UnitOfWork]
public async Task<IResponseOutput> SubmitVisitTaskQuestions(DataInspectionDto<SubmitVisitTaskQuestionsInDto> opt)
{
var singid = await _inspectionService.RecordSing(opt.SignInfo);
var result = await _iReadingImageTaskService.SubmitVisitTaskQuestions(opt.Data);
await _inspectionService.CompletedSign(singid, result);
return result;
}
/// <summary>
/// 配置 基础逻辑信息并确认

View File

@ -4236,13 +4236,6 @@
IR影像阅片
</summary>
</member>
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.GetReadingImageFile(IRaCIS.Core.Application.Service.Reading.Dto.GetReadingImgInDto)">
<summary>
获取阅片非Dicom文件
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.GetTrialConfirmCriterionList(IRaCIS.Core.Application.Service.Reading.Dto.GetConfirmCriterionInDto)">
<summary>
获取项目已确认的标准
@ -4257,6 +4250,13 @@
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.FindChildQuestion(IRaCIS.Core.Application.Service.Reading.Dto.GetTrialReadingQuestionOutDto,System.Collections.Generic.List{IRaCIS.Core.Domain.Models.ReadingQuestionTrial})">
<summary>
找子问题
</summary>
<param name="trialReadingQuestion"></param>
<param name="questionlists"></param>
</member>
<member name="T:IRaCIS.Application.Services.ReadingPeriodSetService">
<summary>
阅片期配置
@ -4335,6 +4335,12 @@
</summary>
<returns></returns>
</member>
<member name="M:IRaCIS.Application.Services.ReadingQuestionService.SetSystemCriterionDisable(System.Guid,System.Nullable{System.Guid})">
<summary>
设置系统标准被禁用
</summary>
<returns></returns>
</member>
<member name="M:IRaCIS.Application.Services.ReadingQuestionService.SetSystemReadingQuestionCriterionIsCompleteConfig(IRaCIS.Core.Application.Service.Reading.Dto.SetSystemReadingQuestionCriterionIsIsCompleteConfig)">
<summary>
设置系统问题标准是否完成配置

View File

@ -3,6 +3,7 @@ using IRaCIS.Application.Contracts;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Application.Contracts;
namespace IRaCIS.Application.Services
{
@ -18,15 +19,21 @@ namespace IRaCIS.Application.Services
private readonly IRepository<TrialDictionary> _trialDictionaryRepository;
private readonly IRepository<Doctor> _doctorRepository;
private readonly IRepository<Trial> _trialRepository;
private readonly IReadingQuestionService _readingQuestionService;
public DictionaryService(IRepository<Dictionary> sysDicRepository, IRepository<DoctorDictionary> doctorDictionaryRepository, IRepository<TrialDictionary> trialDictionaryRepository,
IRepository<Doctor> doctorRepository, IRepository<Trial> trialRepository)
IRepository<Doctor> doctorRepository, IRepository<Trial> trialRepository,
IReadingQuestionService readingQuestionService
)
{
_dicRepository = sysDicRepository;
_doctorDictionaryRepository = doctorDictionaryRepository;
_trialDictionaryRepository = trialDictionaryRepository;
_doctorRepository = doctorRepository;
_trialRepository = trialRepository;
this._readingQuestionService = readingQuestionService;
}
/// <summary>
@ -101,8 +108,16 @@ namespace IRaCIS.Application.Services
VerifyMsg = $"已有{addOrEditBasic.Code}名称的字典",
IsVerify= addOrEditBasic.ParentId ==null
};
// 验证阅片标准是否可禁用
if (!addOrEditBasic.IsEnable&&addOrEditBasic.Id!=null)
{
var result = await _readingQuestionService.SetSystemCriterionDisable(addOrEditBasic.Id.Value,addOrEditBasic.ParentId);
if (!result.IsSuccess)
{
return result;
}
}
var entity = await _dicRepository.InsertOrUpdateAsync(addOrEditBasic, true, verifyExp1);
return ResponseOutput.Ok(entity.Id.ToString());
}
@ -187,7 +202,6 @@ namespace IRaCIS.Application.Services
return searchList.GroupBy(t => t.ParentCode).ToDictionary(g => g.Key, g => g.OrderBy(t => t.ShowOrder).ToList());
}
#region 稽查相关
/// <summary>

View File

@ -18,7 +18,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public class GetReadingImgInDto
{
public Guid SubjectVisitId { get; set; }
public Guid VisitTaskId { get; set; }
}
public class GetConfirmCriterionInDto
@ -34,12 +34,12 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// </summary>
public class GetTrialConfirmCriterionListOutDto
{
public Guid CriterionId { get; set; }
public Guid ReadingQuestionCriterionTrialId { get; set; }
/// <summary>
/// 标准
/// </summary>
public string CriterionName { get; set; }
public string ReadingQuestionCriterionTrialName { get; set; }
}
@ -54,33 +54,42 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// </summary>
public class SubmitVisitTaskQuestionsInDto
{
public Guid TrialId { get; set; }
public Guid VisitTaskId { get; set; }
public Guid ReadingQuestionCriterionTrialId { get; set; }
public List<QuestionAnswer> AnswerList { get; set; } = new List<QuestionAnswer>();
}
public class QuestionAnswer
{
public Guid TrialQuestionId { get; set; }
public Guid ReadingQuestionTrialId { get; set; }
public string Answer { get; set; }
}
public class GetTrialReadingQuestionDto
{
public Guid Id { get; set; }
//public class GetTrialReadingQuestionDto
//{
// public Guid Id { get; set; }
public string GroupName { get; set; }
// public string GroupName { get; set; }
List<GetTrialReadingQuestionOutDto> Questions { get; set; }
}
// List<GetTrialReadingQuestionOutDto> Questions { get; set; }
//}
public class GetTrialReadingQuestionOutDto
{
public Guid ReadingQuestionTrialId { get; set; }
public Guid Id { get; set; }
/// <summary>
/// 项目标准Id
/// </summary>
public Guid ReadingQuestionCriterionTrialId { get; set; }
/// <summary>
/// 项目Id
@ -97,6 +106,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// </summary>
public string ParentTriggerValue { get; set; }
public string GroupName { get; set; }
/// <summary>
/// 问题名称
/// </summary>

View File

@ -0,0 +1,17 @@
//--------------------------------------------------------------------
// 此代码由T4模板自动生成 byzhouhang 20210918
// 生成时间 2021-12-23 13:20:59
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
//--------------------------------------------------------------------
using IRaCIS.Core.Application.Service.Reading.Dto;
using IRaCIS.Core.Domain.Share.Reading;
namespace IRaCIS.Core.Application.Contracts
{
public interface IReadingImageTaskService
{
Task<IResponseOutput> SubmitVisitTaskQuestions(SubmitVisitTaskQuestionsInDto inDto);
}
}

View File

@ -0,0 +1,19 @@
//--------------------------------------------------------------------
// 此代码由T4模板自动生成 byzhouhang 20210918
// 生成时间 2021-12-23 13:20:59
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
//--------------------------------------------------------------------
using IRaCIS.Core.Application.Service.Reading.Dto;
using IRaCIS.Core.Domain.Share.Reading;
namespace IRaCIS.Core.Application.Contracts
{
public interface IReadingQuestionService
{
Task<IResponseOutput> SetSystemCriterionDisable(Guid dictionaryId, Guid? parentId);
}
}

View File

@ -11,6 +11,8 @@ using MassTransit;
using IRaCIS.Core.Application.Service.Reading;
using IRaCIS.Core.Infra.EFCore.Common;
using Panda.DynamicWebApi.Attributes;
using AutoMapper;
using IRaCIS.Core.Application.Contracts;
namespace IRaCIS.Application.Services
{
@ -18,41 +20,49 @@ namespace IRaCIS.Application.Services
/// IR影像阅片
/// </summary>
[ApiExplorerSettings(GroupName = "Reading")]
public class ReadingImageTaskService : BaseService
public class ReadingImageTaskService : BaseService, IReadingImageTaskService
{
private readonly IMapper mapper;
private readonly IRepository<NoneDicomStudy> _noneDicomStudyRepository;
private readonly IRepository<VisitTask> _visitTaskRepository;
private readonly IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswerRepository;
private readonly IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository;
private readonly IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository;
public ReadingImageTaskService(
IMapper mapper,
IRepository<NoneDicomStudy> noneDicomStudyRepository,
IRepository<VisitTask> visitTaskRepository,
IRepository<ReadingTaskQuestionAnswer> readingTaskQuestionAnswerRepository,
IRepository<ReadingQuestionCriterionTrial> readingQuestionCriterionTrialRepository,
IRepository<ReadingQuestionTrial> readingQuestionTrialRepository
)
{
this.mapper = mapper;
this._noneDicomStudyRepository = noneDicomStudyRepository;
this._visitTaskRepository = visitTaskRepository;
this._readingTaskQuestionAnswerRepository = readingTaskQuestionAnswerRepository;
this._readingQuestionCriterionTrialRepository = readingQuestionCriterionTrialRepository;
this._readingQuestionTrialRepository = readingQuestionTrialRepository;
}
/// <summary>
/// 获取阅片非Dicom文件
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<List<GetReadingImgOutDto>> GetReadingImageFile(GetReadingImgInDto inDto)
{
List<GetReadingImgOutDto> imgList =await _noneDicomStudyRepository.Where(x => x.SubjectVisitId == inDto.SubjectVisitId)
.SelectMany(x => x.NoneDicomFileList).Select(x=> new GetReadingImgOutDto() {
FileName=x.FileName,
Path=x.Path
}).ToListAsync();
return imgList;
}
///// <summary>
///// 获取阅片非Dicom文件
///// </summary>
///// <param name="inDto"></param>
///// <returns></returns>
//[HttpPost]
//public async Task<List<GetReadingImgOutDto>> GetReadingImageFile(GetReadingImgInDto inDto)
//{
// var subjectVisitId=await _visitTaskRepository.Where(x=>x.Id==inDto.VisitTaskId).Select(x=>x.vi)
// List<GetReadingImgOutDto> imgList =await _noneDicomStudyRepository.Where(x => x.SubjectVisitId == inDto.SubjectVisitId)
// .SelectMany(x => x.NoneDicomFileList).Select(x=> new GetReadingImgOutDto() {
// FileName=x.FileName,
// Path=x.Path
// }).ToListAsync();
// return imgList;
//}
/// <summary>
/// 获取项目已确认的标准
@ -62,11 +72,11 @@ namespace IRaCIS.Application.Services
[HttpPost]
public async Task<List<GetTrialConfirmCriterionListOutDto>> GetTrialConfirmCriterionList(GetConfirmCriterionInDto inDto)
{
var result= await _readingQuestionCriterionTrialRepository.Where(x => x.TrialId == inDto.TrialId&&x.IsConfirm)
var result= await _readingQuestionCriterionTrialRepository.Where(x => x.TrialId == inDto.TrialId&&x.IsConfirm&&x.IsCompleteConfig)
.Select(x => new GetTrialConfirmCriterionListOutDto()
{
CriterionId = x.Id,
CriterionName = x.CriterionName
ReadingQuestionCriterionTrialId = x.Id,
ReadingQuestionCriterionTrialName = x.CriterionName
}).ToListAsync();
return result;
}
@ -79,27 +89,69 @@ namespace IRaCIS.Application.Services
[HttpPost]
public async Task<List<GetTrialReadingQuestionOutDto>> GetTrialReadingQuestion(GetTrialReadingQuestionInDto inDto)
{
var qusetionList = await _readingQuestionTrialRepository.Where(x => x.Id == inDto.CriterionId).ToListAsync();
//List<GetTrialReadingQuestionDto> groupNames
var qusetionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == inDto.CriterionId).ToListAsync();
var result = await _readingQuestionTrialRepository.Where(x => x.Id == inDto.CriterionId)
.ProjectTo<GetTrialReadingQuestionOutDto>(_mapper.ConfigurationProvider).ToListAsync();
return result;
List<GetTrialReadingQuestionOutDto> groupList = _mapper.Map<List<GetTrialReadingQuestionOutDto>>(qusetionList.Where(x => x.ParentId == null));
groupList.ForEach(x =>
{
FindChildQuestion(x, qusetionList);
});
return groupList;
}
///// <summary>
/////
///// </summary>
///// <param name="InDto"></param>
///// <returns></returns>
//public async Task<IResponseOutput> SubmitVisitTaskQuestions(SubmitVisitTaskQuestionsInDto InDto)
//{
/// <summary>
/// 找子问题
/// </summary>
/// <param name="trialReadingQuestion"></param>
/// <param name="questionlists"></param>
private void FindChildQuestion(GetTrialReadingQuestionOutDto trialReadingQuestion, List<ReadingQuestionTrial> questionlists)
{
trialReadingQuestion.Childrens = _mapper.Map<List<GetTrialReadingQuestionOutDto>>(questionlists.Where(x => x.ParentId == trialReadingQuestion.ReadingQuestionTrialId));
if (trialReadingQuestion.Childrens != null && trialReadingQuestion.Childrens.Count != 0)
{
trialReadingQuestion.Childrens.ForEach(x =>
{
FindChildQuestion(x, questionlists);
});
}
}
//}
/// <summary>
/// 提交问题
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[NonDynamicMethod]
public async Task<IResponseOutput> SubmitVisitTaskQuestions(SubmitVisitTaskQuestionsInDto inDto)
{
var subjectId =await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.SubjectId).FirstOrDefaultAsync();
List<ReadingTaskQuestionAnswer> readingTaskAnswerList = inDto.AnswerList.Select(x => new ReadingTaskQuestionAnswer()
{
Id = NewId.NextGuid(),
SubjectId = subjectId,
Answer = x.Answer,
ReadingQuestionCriterionTrialId = inDto.ReadingQuestionCriterionTrialId,
ReadingQuestionTrialId = x.ReadingQuestionTrialId,
VisitTaskId = inDto.VisitTaskId,
TrialId = inDto.TrialId
}).ToList();
await _readingTaskQuestionAnswerRepository.AddRangeAsync(readingTaskAnswerList);
await _visitTaskRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.VisitTaskId, x => new VisitTask()
{
ReadingTaskState = ReadingTaskState.HaveSigned
});
var result = await _visitTaskRepository.SaveChangesAsync();
return ResponseOutput.Ok(result);
}
}

View File

@ -11,6 +11,7 @@ using MassTransit;
using IRaCIS.Core.Application.Service.Reading;
using IRaCIS.Core.Infra.EFCore.Common;
using Panda.DynamicWebApi.Attributes;
using IRaCIS.Core.Application.Contracts;
namespace IRaCIS.Application.Services
{
@ -18,7 +19,7 @@ namespace IRaCIS.Application.Services
/// 阅片问题.标准
/// </summary>
[ApiExplorerSettings(GroupName = "Reading")]
public class ReadingQuestionService : BaseService
public class ReadingQuestionService : BaseService, IReadingQuestionService
{
private readonly IRepository<SubjectVisit> _subjectVisitRepository;
@ -82,6 +83,31 @@ namespace IRaCIS.Application.Services
inDto.Asc);
}
/// <summary>
/// 设置系统标准被禁用
/// </summary>
/// <returns></returns>
[NonDynamicMethod]
public async Task<IResponseOutput> SetSystemCriterionDisable(Guid dictionaryId, Guid? parentId)
{
// 判断是否是阅片
if (await _dictionaryRepository.AnyAsync(x => x.Id == parentId && x.Code == "ReadingStandard"))
{
// 判断当前阅片是否在项目里面存在
var systemCriterion = await _readingQuestionCriterionSystemRepository.FirstOrDefaultAsync(x => x.CriterionId == dictionaryId);
if (systemCriterion != null)
{
var trialCriterionIds = await _readingQuestionCriterionTrialRepository.Where(x => x.ReadingQuestionCriterionSystemId == systemCriterion.Id).Select(x=>x.ReadingQuestionCriterionSystemId).ToListAsync();
await _readingQuestionCriterionTrialRepository.BatchDeleteNoTrackingAsync(x => x.ReadingQuestionCriterionSystemId == systemCriterion.Id);
await _readingQuestionTrialRepository.BatchDeleteNoTrackingAsync(x => trialCriterionIds.Contains(x.ReadingQuestionCriterionTrialId));
return ResponseOutput.Ok();
}
}
return ResponseOutput.Ok();
}
///// <summary>
///// 设置系统问题标准是否生效
///// </summary>
@ -212,6 +238,9 @@ namespace IRaCIS.Application.Services
return ResponseOutput.Ok(entity.Id.ToString());
}
/// <summary>
/// 获取系统问题
/// </summary>

View File

@ -73,7 +73,8 @@ namespace IRaCIS.Core.Application.Service
#endregion
#region IR阅片
CreateMap<ReadingQuestionTrial, GetTrialReadingQuestionOutDto>();
CreateMap<ReadingQuestionTrial, GetTrialReadingQuestionOutDto>()
.ForMember(x=>x.ReadingQuestionTrialId, y=>y.MapFrom(z=>z.Id));
#endregion

View File

@ -15,7 +15,7 @@ namespace IRaCIS.Core.Domain.Models
public class ReadingQuestionTrial : Entity, IAuditAdd
{
/// <summary>
/// 系统标准Id
/// 项目标准Id
/// </summary>
public Guid ReadingQuestionCriterionTrialId { get; set; }

View File

@ -20,6 +20,11 @@ namespace IRaCIS.Core.Domain.Models
/// </summary>
public Guid ReadingQuestionTrialId { get; set; }
/// <summary>
/// 项目问题标准Id
/// </summary>
public Guid ReadingQuestionCriterionTrialId { get; set; }
/// <summary>
/// 项目ID
/// </summary>