Merge branch 'master' of http://192.168.1.2:8033/IRaCIS_Core_Api
						commit
						c3ad6ae8cb
					
				| 
						 | 
				
			
			@ -37,6 +37,8 @@ namespace IRaCIS.Core.Application.Service
 | 
			
		|||
 | 
			
		||||
		private readonly IRepository<ClinicalForm> _clinicalFormRepository;
 | 
			
		||||
		private readonly IRepository<Subject> _subjectRepository;
 | 
			
		||||
		private readonly IRepository<ReadModuleCriterionFrom> _readModuleCriterionFromRepository;
 | 
			
		||||
		private readonly IRepository<ReadModule> _readModuleRepository;
 | 
			
		||||
		private readonly IRepository<ClinicalQuestionAnswer> _clinicalQuestionAnswerRepository;
 | 
			
		||||
 | 
			
		||||
        private readonly IRepository<ClinicalTableAnswer> _clinicalTableAnswerRepository;
 | 
			
		||||
| 
						 | 
				
			
			@ -55,6 +57,8 @@ namespace IRaCIS.Core.Application.Service
 | 
			
		|||
			IRepository<ReadingClinicalData> readingClinicalDataRepository,
 | 
			
		||||
		IRepository<ClinicalForm> clinicalFormRepository,
 | 
			
		||||
		IRepository<Subject> subjectRepository,
 | 
			
		||||
			IRepository<ReadModuleCriterionFrom> readModuleCriterionFromRepository,
 | 
			
		||||
			IRepository<ReadModule> readModuleRepository,
 | 
			
		||||
		IRepository<SubjectVisit> subjectVisitRepository,
 | 
			
		||||
			IRepository<ClinicalTableAnswer> clinicalTableAnswerRepository,
 | 
			
		||||
             IRepository<ClinicalQuestionAnswer> clinicalQuestionAnswerRepository,
 | 
			
		||||
| 
						 | 
				
			
			@ -76,6 +80,8 @@ namespace IRaCIS.Core.Application.Service
 | 
			
		|||
		
 | 
			
		||||
			_clinicalFormRepository = clinicalFormRepository;
 | 
			
		||||
			this._subjectRepository = subjectRepository;
 | 
			
		||||
			this._readModuleCriterionFromRepository = readModuleCriterionFromRepository;
 | 
			
		||||
			this._readModuleRepository = readModuleRepository;
 | 
			
		||||
			_clinicalTableAnswerRepository = clinicalTableAnswerRepository;
 | 
			
		||||
            _iClinicalQuestionService = iClinicalQuestionService;
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -393,5 +399,65 @@ namespace IRaCIS.Core.Application.Service
 | 
			
		|||
            return ResponseOutput.Ok(true);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 获取CRC确认列表
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        /// <param name="inDto"></param>
 | 
			
		||||
        /// <returns></returns>
 | 
			
		||||
        [HttpPost]
 | 
			
		||||
        public async Task<List<GetCRCConfirmListOutDto>> GetCRCConfirmList(GetCRCConfirmListInDto inDto)
 | 
			
		||||
        {
 | 
			
		||||
 | 
			
		||||
            List<GetCRCConfirmListOutDto> result = await _readModuleRepository.Where(x => x.TrialId == inDto.TrialId)
 | 
			
		||||
                .Select(x => new GetCRCConfirmListOutDto()
 | 
			
		||||
                {
 | 
			
		||||
                    IsCRCConfirm = x.IsCRCConfirm,
 | 
			
		||||
                    LatestScanDate = x.SubjectVisit.LatestScanDate,
 | 
			
		||||
                    ReadingSetType = x.ReadingSetType,
 | 
			
		||||
                    IsPMConfirm = x.IsPMConfirm,
 | 
			
		||||
                    ReadModuleId=x.Id,
 | 
			
		||||
 | 
			
		||||
                }).OrderBy(x => x.LatestScanDate).ToListAsync();
 | 
			
		||||
 | 
			
		||||
            var formList = await _clinicalFormRepository.Where(x => x.TrialId == inDto.TrialId)
 | 
			
		||||
                .Where(x=> x.ClinicalDataTrialSet.UploadRole==UploadRole.CRC)
 | 
			
		||||
                .Where(x=> x.ClinicalDataTrialSet.ClinicalDataLevel==ClinicalLevel.ImageRead|| x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.OncologyRead)
 | 
			
		||||
                .Select(x =>new CRCConfirmFormList
 | 
			
		||||
			{ 
 | 
			
		||||
            CkeckDate=x.CheckDate,
 | 
			
		||||
			ClinicalDataLevel= x.ClinicalDataTrialSet.ClinicalDataLevel,
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
			}).ToListAsync();
 | 
			
		||||
 | 
			
		||||
            var confirmList = await _readModuleCriterionFromRepository.Where(x => x.TrialId == inDto.TrialId).ToListAsync();
 | 
			
		||||
 | 
			
		||||
            result.ForEach(x =>
 | 
			
		||||
            {
 | 
			
		||||
                if (x.IsCRCConfirm)
 | 
			
		||||
                {
 | 
			
		||||
                    x.FormCount = confirmList.Where(y => y.ReadModuleId == x.ReadModuleId).Count();
 | 
			
		||||
 | 
			
		||||
                }
 | 
			
		||||
                else
 | 
			
		||||
                {
 | 
			
		||||
                    if (x.ReadingSetType == ReadingSetType.ImageReading)
 | 
			
		||||
                    {
 | 
			
		||||
                        x.FormCount = formList.Where(y => y.ClinicalDataLevel == ClinicalLevel.ImageRead&&y.CkeckDate<=x.LatestScanDate).Count();
 | 
			
		||||
 | 
			
		||||
                    }
 | 
			
		||||
                    else
 | 
			
		||||
                    {
 | 
			
		||||
						x.FormCount = formList.Where(y => y.ClinicalDataLevel == ClinicalLevel.OncologyRead&&y.CkeckDate <= x.LatestScanDate).Count();
 | 
			
		||||
					}
 | 
			
		||||
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
            });
 | 
			
		||||
            return result;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -471,6 +471,10 @@ namespace IRaCIS.Core.Application.Service
 | 
			
		|||
                    if (question.GroupId != null)
 | 
			
		||||
                    {
 | 
			
		||||
                        question.GroupId = questionRelation[question.GroupId ?? default(Guid)];
 | 
			
		||||
                    }
 | 
			
		||||
					if (question.RelevanceId != null)
 | 
			
		||||
					{
 | 
			
		||||
						question.RelevanceId = questionRelation[question.RelevanceId ?? default(Guid)];
 | 
			
		||||
					}
 | 
			
		||||
					addTrialDataList.Add(question);
 | 
			
		||||
                };
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,5 @@
 | 
			
		|||
using System;
 | 
			
		||||
using IRaCIS.Core.Domain.Share;
 | 
			
		||||
using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using System.Text;
 | 
			
		||||
| 
						 | 
				
			
			@ -93,6 +94,40 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
 | 
			
		|||
        public string Answer { get; set; } = string.Empty;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public class GetCRCConfirmListInDto
 | 
			
		||||
    {
 | 
			
		||||
		public Guid TrialId { get; set; }
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
    public class CRCConfirmFormList
 | 
			
		||||
    {
 | 
			
		||||
		public DateTime? CkeckDate { get; set; }
 | 
			
		||||
 | 
			
		||||
		/// <summary>
 | 
			
		||||
		/// 临床级别
 | 
			
		||||
		/// </summary>
 | 
			
		||||
		public ClinicalLevel ClinicalDataLevel { get; set; }
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	public class GetCRCConfirmListOutDto
 | 
			
		||||
    {
 | 
			
		||||
		public Guid ReadModuleId { get; set; }
 | 
			
		||||
 | 
			
		||||
		public bool IsPMConfirm { get; set; }
 | 
			
		||||
 | 
			
		||||
		public ReadingSetType ReadingSetType { get; set; }
 | 
			
		||||
 | 
			
		||||
		public bool IsCRCConfirm { get; set; } = false;
 | 
			
		||||
 | 
			
		||||
		/// <summary>
 | 
			
		||||
		/// 最晚拍片日期
 | 
			
		||||
		/// </summary>
 | 
			
		||||
		public DateTime? LatestScanDate { get; set; }
 | 
			
		||||
 | 
			
		||||
        public int FormCount { get; set; }
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public class SubmitClinicalFormInDto
 | 
			
		||||
    {
 | 
			
		||||
        /// <summary>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -131,7 +131,17 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
 | 
			
		|||
		/// <summary>
 | 
			
		||||
		/// 是否必填
 | 
			
		||||
		/// </summary>
 | 
			
		||||
        public bool IsRequired { get; set; } = false;
 | 
			
		||||
		public IsRequired IsRequired { get; set; }
 | 
			
		||||
 | 
			
		||||
		/// <summary>
 | 
			
		||||
		/// 关联Value
 | 
			
		||||
		/// </summary>
 | 
			
		||||
		public string RelevanceValue { get; set; } = string.Empty;
 | 
			
		||||
 | 
			
		||||
		/// <summary>
 | 
			
		||||
		/// 关联ID
 | 
			
		||||
		/// </summary>
 | 
			
		||||
		public Guid? RelevanceId { get; set; }
 | 
			
		||||
 | 
			
		||||
		/// <summary>
 | 
			
		||||
		/// 父问题Id
 | 
			
		||||
| 
						 | 
				
			
			@ -300,7 +310,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
 | 
			
		|||
		/// <summary>
 | 
			
		||||
		/// 是否必填
 | 
			
		||||
		/// </summary>
 | 
			
		||||
        public bool IsRequired { get; set; }
 | 
			
		||||
		public IsRequired IsRequired { get; set; }
 | 
			
		||||
 | 
			
		||||
		/// <summary>
 | 
			
		||||
		/// 创建时间
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -75,7 +75,17 @@ namespace IRaCIS.Core.Domain.Models
 | 
			
		|||
		/// <summary>
 | 
			
		||||
		/// 是否必填
 | 
			
		||||
		/// </summary>
 | 
			
		||||
        public bool IsRequired { get; set; } = false;
 | 
			
		||||
		public IsRequired IsRequired { get; set; }
 | 
			
		||||
 | 
			
		||||
		/// <summary>
 | 
			
		||||
		/// 关联Value
 | 
			
		||||
		/// </summary>
 | 
			
		||||
		public string RelevanceValue { get; set; } = string.Empty;
 | 
			
		||||
 | 
			
		||||
		/// <summary>
 | 
			
		||||
		/// 关联ID
 | 
			
		||||
		/// </summary>
 | 
			
		||||
		public Guid? RelevanceId { get; set; }
 | 
			
		||||
 | 
			
		||||
		/// <summary>
 | 
			
		||||
		/// 创建时间
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -68,7 +68,7 @@ namespace IRaCIS.Core.Domain.Models
 | 
			
		|||
		/// <summary>
 | 
			
		||||
		/// 是否必填
 | 
			
		||||
		/// </summary>
 | 
			
		||||
		public bool IsRequired { get; set; }
 | 
			
		||||
		public IsRequired IsRequired { get; set; }
 | 
			
		||||
 | 
			
		||||
		/// <summary>
 | 
			
		||||
		/// 创建时间
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -75,7 +75,17 @@ namespace IRaCIS.Core.Domain.Models
 | 
			
		|||
        /// <summary>
 | 
			
		||||
        /// 是否必填
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public bool IsRequired { get; set; } = false;
 | 
			
		||||
        public IsRequired IsRequired { get; set; }
 | 
			
		||||
 | 
			
		||||
		/// <summary>
 | 
			
		||||
		/// 关联Value
 | 
			
		||||
		/// </summary>
 | 
			
		||||
		public string RelevanceValue { get; set; } = string.Empty;
 | 
			
		||||
 | 
			
		||||
		/// <summary>
 | 
			
		||||
		/// 关联ID
 | 
			
		||||
		/// </summary>
 | 
			
		||||
		public Guid? RelevanceId { get; set; }
 | 
			
		||||
 | 
			
		||||
		/// <summary>
 | 
			
		||||
		/// 系统临床问题Id
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -68,7 +68,7 @@ namespace IRaCIS.Core.Domain.Models
 | 
			
		|||
		/// <summary>
 | 
			
		||||
		/// 是否必填
 | 
			
		||||
		/// </summary>
 | 
			
		||||
		public bool IsRequired { get; set; }
 | 
			
		||||
		public IsRequired IsRequired { get; set; }
 | 
			
		||||
 | 
			
		||||
		/// <summary>
 | 
			
		||||
		/// 创建时间
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -54,6 +54,11 @@ namespace IRaCIS.Core.Domain.Models
 | 
			
		|||
        /// </summary>
 | 
			
		||||
        public Guid? ReadingId { get; set; }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		[JsonIgnore]
 | 
			
		||||
		[ForeignKey("ClinicalDataTrialSetId")]
 | 
			
		||||
		public ClinicalDataTrialSet ClinicalDataTrialSet { get; set; }
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}	 
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,52 @@
 | 
			
		|||
 | 
			
		||||
//--------------------------------------------------------------------
 | 
			
		||||
//     此代码由T4模板自动生成  byzhouhang 20210918
 | 
			
		||||
//	   生成时间 2023-06-29 16:36:05 
 | 
			
		||||
//     对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
 | 
			
		||||
using System;
 | 
			
		||||
using IRaCIS.Core.Domain.Share;
 | 
			
		||||
using System.ComponentModel.DataAnnotations;
 | 
			
		||||
using System.ComponentModel.DataAnnotations.Schema;
 | 
			
		||||
namespace IRaCIS.Core.Domain.Models
 | 
			
		||||
{
 | 
			
		||||
	 ///<summary>
 | 
			
		||||
	 ///ReadModuleCriterionFrom
 | 
			
		||||
	 ///</summary>
 | 
			
		||||
	 [Table("ReadModuleCriterionFrom")]	
 | 
			
		||||
	 public class ReadModuleCriterionFrom : Entity, IAuditAdd
 | 
			
		||||
	 {
 | 
			
		||||
	
 | 
			
		||||
		/// <summary>
 | 
			
		||||
        /// 阅片期Id
 | 
			
		||||
        /// </summary>
 | 
			
		||||
		public Guid ReadModuleId { get; set; }
 | 
			
		||||
	
 | 
			
		||||
		/// <summary>
 | 
			
		||||
        /// 受试者Id
 | 
			
		||||
        /// </summary>
 | 
			
		||||
		public Guid SubjectId { get; set; }
 | 
			
		||||
	
 | 
			
		||||
		/// <summary>
 | 
			
		||||
        /// 项目Id
 | 
			
		||||
        /// </summary>
 | 
			
		||||
		public Guid TrialId { get; set; }
 | 
			
		||||
	
 | 
			
		||||
		/// <summary>
 | 
			
		||||
        /// 表单Id
 | 
			
		||||
        /// </summary>
 | 
			
		||||
		public Guid ClinicalFormId { get; set; }
 | 
			
		||||
	
 | 
			
		||||
		/// <summary>
 | 
			
		||||
        /// 创建人
 | 
			
		||||
        /// </summary>
 | 
			
		||||
		public Guid CreateUserId { get; set; }
 | 
			
		||||
	
 | 
			
		||||
		/// <summary>
 | 
			
		||||
        /// 创建时间
 | 
			
		||||
        /// </summary>
 | 
			
		||||
		public DateTime CreateTime { get; set; }
 | 
			
		||||
	 
 | 
			
		||||
	 }
 | 
			
		||||
 | 
			
		||||
	  
 | 
			
		||||
}	 
 | 
			
		||||
| 
						 | 
				
			
			@ -76,9 +76,9 @@ namespace IRaCIS.Core.Domain.Models
 | 
			
		|||
		public DateTime UpdateTime { get; set; }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		public bool IsCRCConfirm { get; set; } = false;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		public bool IsPMConfirm { get; set; } = false;
 | 
			
		||||
		public bool IsDeleted { get; set; }
 | 
			
		||||
 | 
			
		||||
		public DateTime? DeletedTime { get; set; }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -418,7 +418,7 @@ namespace IRaCIS.Core.Infra.EFCore
 | 
			
		|||
 | 
			
		||||
        public virtual DbSet<ClinicalTableAnswer> ClinicalTableAnswer { get; set; }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		public virtual DbSet<ReadModuleCriterionFrom> ReadModuleCriterionFrom { get; set; }
 | 
			
		||||
		public virtual DbSet<ClinicalForm> ClinicalForm { get; set; }
 | 
			
		||||
        #endregion
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,7 +4,7 @@
 | 
			
		|||
        public static readonly string ConnectionString = "Server=123.56.94.154,1433\\MSSQLSERVER;Database=IRaCIS_New_Tet;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true";
 | 
			
		||||
        public static readonly string DbDatabase = "IRaCIS_New_Tet";
 | 
			
		||||
        //表名称用字符串,拼接
 | 
			
		||||
        public static readonly string TableName = "ClinicalForm";
 | 
			
		||||
        public static readonly string TableName = "ReadModuleCriterionFrom";
 | 
			
		||||
        //具体文件里面  例如service 可以配置是否分页
 | 
			
		||||
	}
 | 
			
		||||
#>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue