From 00fe76f3265ab8d53b9fe724087d4a676c500ea4 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Wed, 13 Jul 2022 14:27:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/InspectionController.cs | 18 ++++++ .../IRaCIS.Core.Application.xml | 4 +- .../TrialSiteUser/DTO/TrialConfigDTO.cs | 41 ++++++++++--- .../Interface/ITrialConfigService.cs | 1 + .../TrialSiteUser/TrialConfigService.cs | 59 +++++++++++++++++-- IRaCIS.Core.Domain/Trial/Trial.cs | 7 ++- 6 files changed, 113 insertions(+), 17 deletions(-) diff --git a/IRaCIS.Core.API/Controllers/InspectionController.cs b/IRaCIS.Core.API/Controllers/InspectionController.cs index 71f478687..8a9b73d79 100644 --- a/IRaCIS.Core.API/Controllers/InspectionController.cs +++ b/IRaCIS.Core.API/Controllers/InspectionController.cs @@ -107,6 +107,24 @@ namespace IRaCIS.Core.API.Controllers + + /// + /// 项目阅片信息签名 + /// + /// + /// + [HttpPost, Route("Inspection/configTrialBasicInfo/TrialReadingInfoSignInDto")] + [UnitOfWork] + public async Task TrialReadingInfoSignInDto(DataInspectionDto opt) + { + + var singid = await _inspectionService.RecordSing(opt.SignInfo); + var result = await _trialConfigService.TrialReadingInfoSign(opt.Data); + await _inspectionService.CompletedSign(singid, result); + return result; + } + + /// /// 医学审核完成 /// diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 9f5051e4e..3378c23e6 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -3829,7 +3829,7 @@ 任务组织级别 - + 影像是否有标注 @@ -4014,7 +4014,7 @@ 任务组织级别 - + 影像是否有标注 diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialConfigDTO.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialConfigDTO.cs index ad80c2943..28ab879ca 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialConfigDTO.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialConfigDTO.cs @@ -305,7 +305,7 @@ namespace IRaCIS.Core.Application.Contracts /// /// 影像是否有标注 /// - public bool IsImageLabled { get; set; } + public bool IsImageIabeled { get; set; } /// /// IR阅片是否显示受试者信息 @@ -320,20 +320,23 @@ namespace IRaCIS.Core.Application.Contracts //读片任务显示是否顺序 public bool IsReadingTaskViewInOrder { get; set; } = true; - /// - /// 修约小数点 - /// - public int? DigitPlaces { get; set; } = 2; + /// /// 仲裁规则/对象 /// public int ArbitrationRule { get; set; } = 2; + /// + /// 修约小数点 + /// + public int? DigitPlaces { get; set; } + + public FormType? FormType { get; set; } /// /// 项目标准Id /// - public List TrialCriterionId { get; set; } + public Guid? TrialCriterionId { get; set; } ///// ///// 全局阅片 @@ -531,12 +534,36 @@ namespace IRaCIS.Core.Application.Contracts public string CriterionName { get; set; } } + + public class TrialReadingInfoSignInDto + { + [NotDefault] + public Guid TrialId { get; set; } + } + + public class GetTrialReadingInfoInDto { [NotDefault] public Guid TrialId { get; set; } } + public class SetTrialReadingCriterionInDto + { + public Guid ReadingQuestionCriterionTrialId { get; set; } + + /// + /// 表单类型 + /// + + public FormType FormType { get; set; } + + + /// + /// 修约小数点 + /// + public int? DigitPlaces { get; set; } + } public class SetTrialReadingInfoInDto { @@ -563,7 +590,7 @@ namespace IRaCIS.Core.Application.Contracts /// /// 影像是否有标注 /// - public bool IsImageLabled { get; set; } + public bool IsImageIabeled { get; set; } //读片任务显示是否顺序 public bool IsReadingTaskViewInOrder { get; set; } = true; diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/Interface/ITrialConfigService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/Interface/ITrialConfigService.cs index 91735d1d5..75ec6836c 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/Interface/ITrialConfigService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/Interface/ITrialConfigService.cs @@ -6,6 +6,7 @@ namespace IRaCIS.Application.Interfaces { public interface ITrialConfigService { + Task TrialReadingInfoSign(TrialReadingInfoSignInDto inDto); Task UpdateTrialState(Guid trialId, string trialStatusStr, string? reason); Task AbandonTrial(Guid trialId, bool isAbandon); Task GetTrialConfigInfo(Guid trialId); diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs index 5ddc58eb4..06d81d1d0 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs @@ -8,6 +8,7 @@ using EasyCaching.Core; using IRaCIS.Core.Infrastructure; using Microsoft.AspNetCore.Authorization; using IRaCIS.Core.Application.Auth; +using Panda.DynamicWebApi.Attributes; namespace IRaCIS.Core.Application { @@ -44,6 +45,25 @@ namespace IRaCIS.Core.Application this._provider = provider; } + + /// + /// 阅片信息签名 + /// + /// + /// + [NonDynamicMethod] + public async Task TrialReadingInfoSign(TrialReadingInfoSignInDto inDto) + { + await _trialRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.TrialId, x => new Trial() + { + ReadingInfoSignTime = DateTime.Now + }); + + var result = await _trialRepository.SaveChangesAsync(); + + return ResponseOutput.Ok(result); + } + /// /// 获取项目阅片信息 /// @@ -53,9 +73,18 @@ namespace IRaCIS.Core.Application public async Task GetTrialReadingInfo(GetTrialReadingInfoInDto inDto) { GetTrialReadingInfoOutDto trialInfo= await _trialRepository.Where(x=>x.Id==inDto.TrialId).ProjectTo(_mapper.ConfigurationProvider).FirstNotNullAsync(); - + trialInfo.DigitPlaces = null; trialInfo.ReadingCriterionPageList = await _readingCriterionPageRepository.Where(x => x.TrialId == inDto.TrialId).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); - trialInfo.TrialCriterionId = await _readingQuestionCriterionTrialRepository.Where(x => x.TrialId == inDto.TrialId && x.IsConfirm).Select(x => x.Id).ToListAsync(); + + var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.TrialId == inDto.TrialId && x.IsConfirm).FirstOrDefaultAsync(); + + if (trialCriterion != null) + { + trialInfo.DigitPlaces= trialCriterion.DigitPlaces; + trialInfo.TrialCriterionId = trialCriterion.Id; + trialInfo.FormType = trialCriterion.FormType; + }; + trialInfo.TrialJudgeQuestionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrial.IsConfirm && x.IsJudgeQuestion && x.TrialId == inDto.TrialId) .Select(x => new TrialJudgeQuestion() { @@ -69,12 +98,30 @@ namespace IRaCIS.Core.Application trialInfo.TrialQuestionList= await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrial.IsConfirm&&x.TrialId==inDto.TrialId) .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); - - - return trialInfo; } + + /// + /// 设置项目阅片标准 + /// + /// + public async Task SetTrialReadingCriterion(SetTrialReadingCriterionInDto inDto) + { + await _readingQuestionCriterionTrialRepository.UpdatePartialFromQueryAsync(inDto.ReadingQuestionCriterionTrialId, x => new ReadingQuestionCriterionTrial() + { + + FormType = inDto.FormType, + DigitPlaces = inDto.DigitPlaces, + + }); + + var result = await _trialRepository.SaveChangesAsync(); + + + return ResponseOutput.Ok(result); + } + /// /// 设置项目阅片信息 /// @@ -88,7 +135,7 @@ namespace IRaCIS.Core.Application //DigitPlaces=inDto.DigitPlaces, IsReadingTaskViewInOrder=inDto.IsReadingTaskViewInOrder, ReadingTaskViewEnum = inDto.ReadingTaskViewEnum, - IsImageLabled = inDto.IsImageLabled, + IsImageIabeled = inDto.IsImageIabeled, IsReadingShowSubjectInfo = inDto.IsReadingShowSubjectInfo, IsReadingShowPreviousResults = inDto.IsReadingShowPreviousResults, ImagePlatform=inDto.ImagePlatform, diff --git a/IRaCIS.Core.Domain/Trial/Trial.cs b/IRaCIS.Core.Domain/Trial/Trial.cs index ddeea8398..2e3ef8e61 100644 --- a/IRaCIS.Core.Domain/Trial/Trial.cs +++ b/IRaCIS.Core.Domain/Trial/Trial.cs @@ -372,10 +372,13 @@ namespace IRaCIS.Core.Domain.Models /// /// ͼǷбע /// - public bool IsImageLabled { get; set; } + public bool IsImageIabeled { get; set; } - + /// + /// ƬϢǩʱ + /// + public DateTime? ReadingInfoSignTime { get; set; } //public Guid? ReviewTypeId { get; set; } = Guid.Empty;