Uat_Study
			
			
		
		
							parent
							
								
									ea48fcac64
								
							
						
					
					
						commit
						5360c577af
					
				| 
						 | 
				
			
			@ -39,7 +39,10 @@
 | 
			
		|||
 | 
			
		||||
  //-------------------------------------------------------------------------------------Reading-----------------------------------------------------------------
 | 
			
		||||
  //ClinicalDataSetService
 | 
			
		||||
  "ClinicalDataSet_Apply": "",
 | 
			
		||||
  "ClinicalDataSet_DupTypeFail": "The same type of clinical data exists. The operation failed.",
 | 
			
		||||
  //ClinicalQuestionService
 | 
			
		||||
  "ClinicalQuestion_Repeat": "",
 | 
			
		||||
  //ReadingClinicalDataService
 | 
			
		||||
  "ReadingClinicalData_DupTypeFail": "The same type of clinical data exists. The operation failed.",
 | 
			
		||||
  "ReadingClinicalData_Unchecked": "The current clinical data status is not verified and signing is not allowed!",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -39,7 +39,10 @@
 | 
			
		|||
 | 
			
		||||
  // ------------------------------------------------------------Reading--------------------------------------------------------------------
 | 
			
		||||
  //ClinicalDataSetService
 | 
			
		||||
  "ClinicalDataSet_Apply": "当前临床数据需要配置一个检查日期才能应用",
 | 
			
		||||
  "ClinicalDataSet_DupTypeFail": "存在同类型的临床数据,操作失败",
 | 
			
		||||
  //ClinicalQuestionService
 | 
			
		||||
  "ClinicalQuestion_Repeat": "存在相同的问题名称!",
 | 
			
		||||
  //ReadingClinicalDataService
 | 
			
		||||
  "ReadingClinicalData_DupTypeFail": "存在同类型的临床数据,操作失败",
 | 
			
		||||
  "ReadingClinicalData_Unchecked": "当前临床数据状态不是已核查状态,不允许签名!",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,6 +3,8 @@ using IRaCIS.Core.Application.Service.Reading.Dto;
 | 
			
		|||
using MassTransit;
 | 
			
		||||
using IRaCIS.Core.Domain.Models;
 | 
			
		||||
using IRaCIS.Core.Application.Interfaces;
 | 
			
		||||
using IRaCIS.Core.Domain.Share;
 | 
			
		||||
using IRaCIS.Core.Infrastructure;
 | 
			
		||||
 | 
			
		||||
namespace IRaCIS.Application.Services
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			@ -20,7 +22,9 @@ namespace IRaCIS.Application.Services
 | 
			
		|||
        private readonly IRepository<PreviousPDF> _previousPDFRepository;
 | 
			
		||||
		private readonly IRepository<Dictionary> _dictionaryRepository;
 | 
			
		||||
		private readonly IRepository<Trial> _trialRepository;
 | 
			
		||||
       
 | 
			
		||||
        private readonly IRepository<TrialClinicalQuestion> _trialClinicalQuestionRepository;
 | 
			
		||||
 | 
			
		||||
        private readonly IRepository<SystemClinicalQuestion> _systemClinicalQuestionRepository;
 | 
			
		||||
 | 
			
		||||
        public ClinicalDataSetService(IRepository<SubjectVisit> subjectVisitRepository,
 | 
			
		||||
              IClinicalQuestionService iClinicalQuestionService,
 | 
			
		||||
| 
						 | 
				
			
			@ -28,14 +32,18 @@ namespace IRaCIS.Application.Services
 | 
			
		|||
            IRepository<ClinicalDataSystemSet> ClinicalDataSystemSetRepository,
 | 
			
		||||
            IRepository<PreviousPDF> previousPDFRepository,
 | 
			
		||||
			  IRepository<Dictionary> dictionaryRepository,
 | 
			
		||||
			IRepository<Trial> trialRepository
 | 
			
		||||
              IRepository<TrialClinicalQuestion> trialClinicalQuestionRepository,
 | 
			
		||||
  IRepository<SystemClinicalQuestion> systemClinicalQuestionRepository,
 | 
			
		||||
 | 
			
		||||
            IRepository<Trial> trialRepository
 | 
			
		||||
 | 
			
		||||
          
 | 
			
		||||
          )
 | 
			
		||||
        {
 | 
			
		||||
            _iClinicalQuestionService = iClinicalQuestionService;
 | 
			
		||||
            _subjectVisitRepository = subjectVisitRepository;
 | 
			
		||||
 | 
			
		||||
            _trialClinicalQuestionRepository = trialClinicalQuestionRepository;
 | 
			
		||||
            _systemClinicalQuestionRepository = systemClinicalQuestionRepository;
 | 
			
		||||
            _clinicalDataTrialSetRepository = ClinicalDataTrialSetRepository;
 | 
			
		||||
            _clinicalDataSystemSetRepository = ClinicalDataSystemSetRepository;
 | 
			
		||||
            this._previousPDFRepository = previousPDFRepository;
 | 
			
		||||
| 
						 | 
				
			
			@ -44,6 +52,58 @@ namespace IRaCIS.Application.Services
 | 
			
		|||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 应用系统临床数据
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        /// <param name="inDto"></param>
 | 
			
		||||
        /// <returns></returns>
 | 
			
		||||
        /// <exception cref="BusinessValidationFailedException"></exception>
 | 
			
		||||
        [HttpPost]
 | 
			
		||||
        public async Task<IResponseOutput> ApplySystemClinical(ApplySystemClinicalInDto inDto)
 | 
			
		||||
        {
 | 
			
		||||
            if (_systemClinicalQuestionRepository.Where(x => x.SystemClinicalId == inDto.SystemClinicalId && x.IsCheckDate).Count() != 1)
 | 
			
		||||
            {
 | 
			
		||||
                throw new BusinessValidationFailedException(_localizer["ClinicalDataSet_Apply"]);
 | 
			
		||||
              
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            await _clinicalDataSystemSetRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.SystemClinicalId, x => new ClinicalDataSystemSet()
 | 
			
		||||
            {
 | 
			
		||||
                IsApply = true
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            await _clinicalDataSystemSetRepository.SaveChangesAsync();
 | 
			
		||||
 | 
			
		||||
            return ResponseOutput.Ok(true);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 应用项目临床数据
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        /// <param name="inDto"></param>
 | 
			
		||||
        /// <returns></returns>
 | 
			
		||||
        /// <exception cref="BusinessValidationFailedException"></exception>
 | 
			
		||||
        [HttpPost]
 | 
			
		||||
        public async Task<IResponseOutput> ApplyTrialClinical(ApplyTrialClinicalInDto inDto)
 | 
			
		||||
        {
 | 
			
		||||
            if (_trialClinicalQuestionRepository.Where(x => x.TrialClinicalId == inDto.TrialClinicalId && x.IsCheckDate).Count() != 1)
 | 
			
		||||
            {
 | 
			
		||||
                throw new BusinessValidationFailedException(_localizer["ClinicalDataSet_Apply"]);
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            await _clinicalDataTrialSetRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.TrialClinicalId, x => new ClinicalDataTrialSet()
 | 
			
		||||
            {
 | 
			
		||||
                IsApply = true
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            await _clinicalDataTrialSetRepository.SaveChangesAsync();
 | 
			
		||||
 | 
			
		||||
            return ResponseOutput.Ok(true);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        #region 系统
 | 
			
		||||
        /// <summary>
 | 
			
		||||
| 
						 | 
				
			
			@ -54,7 +114,10 @@ namespace IRaCIS.Application.Services
 | 
			
		|||
        [HttpPost]
 | 
			
		||||
        public async Task<IResponseOutput> AddOrUpdateClinicalDataSystemSet(ClinicalDataSystemSetAddOrEdit indto)
 | 
			
		||||
        {
 | 
			
		||||
 | 
			
		||||
            if (indto.ClinicalUploadType == ClinicalUploadType.Table || indto.ClinicalUploadType == ClinicalUploadType.PDF)
 | 
			
		||||
            {
 | 
			
		||||
                indto.IsApply = true;
 | 
			
		||||
            }
 | 
			
		||||
            var dictionary = await _dictionaryRepository.Where(x => x.Parent.Code == "ClinicalDataType" && x.Code == indto.ClinicalDataSetEnum.ToString()).FirstNotNullAsync();
 | 
			
		||||
            indto.ClinicalDataSetName = dictionary.ValueCN;
 | 
			
		||||
            indto.ClinicalDataSetEnName = dictionary.Value;
 | 
			
		||||
| 
						 | 
				
			
			@ -130,6 +193,12 @@ namespace IRaCIS.Application.Services
 | 
			
		|||
        [HttpPost]
 | 
			
		||||
        public async Task<IResponseOutput> AddOrUpdateClinicalDataTrialSet(ClinicalDataTrialSetAddOrEdit indto)
 | 
			
		||||
        {
 | 
			
		||||
 | 
			
		||||
            if (indto.ClinicalUploadType == ClinicalUploadType.Table || indto.ClinicalUploadType == ClinicalUploadType.PDF)
 | 
			
		||||
            {
 | 
			
		||||
                indto.IsApply = true;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            var existsQuery = _clinicalDataTrialSetRepository
 | 
			
		||||
             .WhereIf(indto.Id != null, x => x.Id != indto.Id)
 | 
			
		||||
             .Where(x => (x.ClinicalDataSetName == indto.ClinicalDataSetName||x.ClinicalDataSetEnName==indto.ClinicalDataSetEnName) && x.TrialId == indto.TrialId);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -72,6 +72,11 @@ namespace IRaCIS.Core.Application.Service
 | 
			
		|||
        [HttpPost]
 | 
			
		||||
        public async Task<IResponseOutput> AddOrUpdateTrialClinicalQuestion(TrialClinicalQuestionDto inDto)
 | 
			
		||||
        {
 | 
			
		||||
            if (await _trialClinicalQuestionRepository.AnyAsync(x =>x.TrialClinicalId==inDto.TrialClinicalId && x.Id != inDto.Id && x.QuestionName == inDto.QuestionName))
 | 
			
		||||
            {
 | 
			
		||||
                return ResponseOutput.NotOk(_localizer["ClinicalQuestion_Repeat"]);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            var entity = await _trialClinicalQuestionRepository.InsertOrUpdateAsync(inDto, true);
 | 
			
		||||
            return ResponseOutput.Ok(entity.Id.ToString());
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -149,6 +154,11 @@ namespace IRaCIS.Core.Application.Service
 | 
			
		|||
        [HttpPost]
 | 
			
		||||
        public async Task<IResponseOutput> AddOrUpdateSystemClinicalQuestion(SystemClinicalQuestionDto inDto)
 | 
			
		||||
        {
 | 
			
		||||
 | 
			
		||||
            if (await _systemClinicalQuestionRepository.AnyAsync(x => x.SystemClinicalId == inDto.SystemClinicalId && x.Id != inDto.Id && x.QuestionName == inDto.QuestionName))
 | 
			
		||||
            {
 | 
			
		||||
                return ResponseOutput.NotOk(_localizer["ClinicalQuestion_Repeat"]);
 | 
			
		||||
            }
 | 
			
		||||
            var entity = await _systemClinicalQuestionRepository.InsertOrUpdateAsync(inDto, true);
 | 
			
		||||
            return ResponseOutput.Ok(entity.Id.ToString());
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -230,6 +240,10 @@ namespace IRaCIS.Core.Application.Service
 | 
			
		|||
        [HttpPost]
 | 
			
		||||
        public async Task<IResponseOutput> AddOrUpdateSystemClinicalTableQuestion(SystemClinicalTableQuestionDto inDto)
 | 
			
		||||
        {
 | 
			
		||||
            if (await _systemClinicalTableQuestionRepository.AnyAsync(x => x.QuestionId == inDto.QuestionId && x.Id != inDto.Id && x.QuestionName == inDto.QuestionName))
 | 
			
		||||
            {
 | 
			
		||||
                return ResponseOutput.NotOk(_localizer["ClinicalQuestion_Repeat"]);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            var entity = await _systemClinicalTableQuestionRepository.InsertOrUpdateAsync(inDto, true);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -281,7 +295,10 @@ namespace IRaCIS.Core.Application.Service
 | 
			
		|||
        [HttpPost]
 | 
			
		||||
        public async Task<IResponseOutput> AddOrUpdateTrialClinicalTableQuestion(TrialClinicalTableQuestionDto inDto)
 | 
			
		||||
        {
 | 
			
		||||
 | 
			
		||||
            if (await _trialClinicalTableQuestionRepository.AnyAsync(x => x.QuestionId == inDto.QuestionId && x.Id != inDto.Id && x.QuestionName == inDto.QuestionName))
 | 
			
		||||
            {
 | 
			
		||||
                return ResponseOutput.NotOk(_localizer["ClinicalQuestion_Repeat"]);
 | 
			
		||||
            }
 | 
			
		||||
            var entity = await _trialClinicalTableQuestionRepository.InsertOrUpdateAsync(inDto, true);
 | 
			
		||||
 | 
			
		||||
            return ResponseOutput.Ok(entity.Id.ToString());
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -13,6 +13,10 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
 | 
			
		|||
    {
 | 
			
		||||
        public Guid? Id { get; set; }
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 是否应用
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public bool IsApply { get; set; } = false;
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 名称
 | 
			
		||||
| 
						 | 
				
			
			@ -73,10 +77,23 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
 | 
			
		|||
        //public List<int> CriterionEnumList { get; set; }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public class ApplySystemClinicalInDto
 | 
			
		||||
    {
 | 
			
		||||
        public Guid SystemClinicalId { get; set; }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public class ApplyTrialClinicalInDto
 | 
			
		||||
    {
 | 
			
		||||
        public Guid TrialClinicalId { get; set; }
 | 
			
		||||
    }
 | 
			
		||||
    public class ClinicalDataSystemSetAddOrEdit
 | 
			
		||||
    {
 | 
			
		||||
        public Guid? Id { get; set; }
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 是否应用
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public bool IsApply { get; set; } = false;
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 枚举
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -88,6 +88,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
 | 
			
		|||
        /// 显示类型
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public ClinicalQuestionShow ClinicalQuestionShowEnum { get; set; } = ClinicalQuestionShow.Show;
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 是否是检查日期
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public bool IsCheckDate { get; set; }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /// <summary>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -102,6 +102,11 @@ namespace IRaCIS.Core.Domain.Models
 | 
			
		|||
        /// </summary>
 | 
			
		||||
        public ClinicalQuestionShow ClinicalQuestionShowEnum { get; set; } = ClinicalQuestionShow.Show;
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 是否是检查日期
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public bool IsCheckDate { get; set; }
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -107,6 +107,11 @@ namespace IRaCIS.Core.Domain.Models
 | 
			
		|||
        /// </summary>
 | 
			
		||||
        public ClinicalQuestionShow ClinicalQuestionShowEnum { get; set; } = ClinicalQuestionShow.Show;
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 是否是检查日期
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public bool IsCheckDate { get; set; }
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 自定义计算标记
 | 
			
		||||
        /// </summary>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue