增加Global Using
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-09-20 10:19:08 +08:00
parent 115017197b
commit fc30cb39ee
408 changed files with 11031 additions and 12556 deletions
@@ -4,7 +4,6 @@
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
//--------------------------------------------------------------------
using Microsoft.AspNetCore.Mvc;
using IRaCIS.Core.Application.Service;
namespace IRaCIS.Core.Application.Contracts
{
@@ -20,7 +19,7 @@ namespace IRaCIS.Core.Application.Contracts
IRepository<SubjectVisit> _subjectVisitRepository,
QCCommon _qCCommon) : BaseService, IClinicalDataService
{
/// <summary>
@@ -62,10 +61,10 @@ namespace IRaCIS.Core.Application.Contracts
[HttpDelete("{trialId:guid}/{subjectVisitId:guid}/{previousHistoryId:guid}")]
public async Task<IResponseOutput> DeletePreviousHistory(Guid previousHistoryId,Guid subjectVisitId)
public async Task<IResponseOutput> DeletePreviousHistory(Guid previousHistoryId, Guid subjectVisitId)
{
await _qCCommon.VerifyIsCRCSubmmitAsync(_subjectVisitRepository, _userInfo, subjectVisitId);
await _previousHistoryRepository.DeleteFromQueryAsync(t => t.Id == previousHistoryId,true);
await _previousHistoryRepository.DeleteFromQueryAsync(t => t.Id == previousHistoryId, true);
return ResponseOutput.Ok();
}
@@ -93,7 +92,7 @@ namespace IRaCIS.Core.Application.Contracts
{
await _qCCommon.VerifyIsCRCSubmmitAsync(_subjectVisitRepository, _userInfo, subjectVisitId);
await _previousOtherRepository.DeleteFromQueryAsync(t => t.Id == previousOtherId,true);
await _previousOtherRepository.DeleteFromQueryAsync(t => t.Id == previousOtherId, true);
return ResponseOutput.Ok();
}
@@ -119,7 +118,7 @@ namespace IRaCIS.Core.Application.Contracts
public async Task<IResponseOutput> DeletePreviousSurgery(Guid previousSurgeryId, Guid subjectVisitId)
{
await _qCCommon.VerifyIsCRCSubmmitAsync(_subjectVisitRepository, _userInfo, subjectVisitId);
var success = await _previousSurgeryRepository.DeleteFromQueryAsync(t => t.Id == previousSurgeryId,true);
var success = await _previousSurgeryRepository.DeleteFromQueryAsync(t => t.Id == previousSurgeryId, true);
return ResponseOutput.Ok();
}
@@ -146,7 +145,7 @@ namespace IRaCIS.Core.Application.Contracts
{
await _qCCommon.VerifyIsCRCSubmmitAsync(_subjectVisitRepository, _userInfo, subjectVisitId);
await _previousPdfRepository.DeleteFromQueryAsync(t => t.Id == previousPDFId,true);
await _previousPdfRepository.DeleteFromQueryAsync(t => t.Id == previousPDFId, true);
return ResponseOutput.Ok();
}
@@ -3,9 +3,6 @@
// 生成时间 2021-12-06 10:56:50
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
//--------------------------------------------------------------------
using IRaCIS.Core.Application.Service.Inspection.DTO;
using Microsoft.AspNetCore.Http;
namespace IRaCIS.Core.Application.Contracts
{
/// <summary> NoneDicomStudyFileView 列表视图模型 </summary>
@@ -3,16 +3,14 @@
// 生成时间 2021-12-06 10:56:50
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
//--------------------------------------------------------------------
using System;
using System.Collections.Generic;
namespace IRaCIS.Core.Application.Contracts
{
/// <summary> NoneDicomStudyView 列表视图模型 </summary>
public class NoneDicomStudyView:NoneDicomStudyAddOrEdit
public class NoneDicomStudyView : NoneDicomStudyAddOrEdit
{
public DateTime UpdateTime { get; set; }
public string CodeView { get; set; }
public int FileCount { get; set; }
public List<NoneDicomStudyFileView> NoneDicomStudyFileList { get; set; } = new List<NoneDicomStudyFileView>();
@@ -20,7 +18,7 @@ namespace IRaCIS.Core.Application.Contracts
}
public class TaskDicomStudyView: NoneDicomStudyView
public class TaskDicomStudyView : NoneDicomStudyView
{
}
@@ -43,14 +41,14 @@ namespace IRaCIS.Core.Application.Contracts
public class NoneDicomStudyAddOrEdit
{
public Guid? Id { get; set; }
public Guid TrialId { get; set; }
public Guid SubjectId { get; set; }
public Guid SubjectVisitId { get; set; }
public string BodyPart { get; set; } = string.Empty;
public string Modality { get; set; } = string.Empty;
public DateTime ImageDate { get; set; }
public DateTime ImageDate { get; set; }
public string Description { get; set; } = string.Empty;
public int Code { get; set; }
@@ -68,7 +66,7 @@ namespace IRaCIS.Core.Application.Contracts
public class NoneDicomStudyAddReturnDto
{
public Guid Id{ get; set; }
public Guid Id { get; set; }
public string StudyCode { get; set; } = string.Empty;
}
@@ -3,8 +3,6 @@
// 生成时间 2021-11-22 11:27:53
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
//--------------------------------------------------------------------
using System;
using System.Collections.Generic;
namespace IRaCIS.Core.Application.Contracts
{
/// <summary> PreviousOtherView 列表视图模型 </summary>
@@ -41,13 +39,13 @@ namespace IRaCIS.Core.Application.Contracts
public class PreviousOtherAddOrEdit
{
public Guid? Id { get; set; }
public DateTime? StartTime { get; set; }
public DateTime? EndTime { get; set; }
public bool IsPD { get; set; }
public Guid? SubjectVisitId { get; set; }
public bool IsSubjectLevel { get; set; } = true;
public string Path { get; set; }=String.Empty;
public string Path { get; set; } = String.Empty;
public string FileName { get; set; } = String.Empty;
public string TreatmentType { get; set; } = String.Empty;
@@ -38,7 +38,7 @@ namespace IRaCIS.Core.Application.Contracts
public class PreviousSurgeryAddOrEdit
{
public Guid? Id { get; set; }
public DateTime? OperationTime { get; set; }
public Guid? SubjectVisitId { get; set; }
public bool IsSubjectLevel { get; set; } = true;
@@ -97,7 +97,7 @@ namespace IRaCIS.Core.Application.Contracts
public Guid? SubjectId { get; set; }
}
///<summary> PreviousPDFAddOrEdit 列表查询参数模型</summary>
public class PreviousPDFAddOrEdit
@@ -1,5 +1,4 @@
using IRaCIS.Application.Contracts;
using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Domain.Share;
using Newtonsoft.Json;
namespace IRaCIS.Core.Application.Contracts.DTO
@@ -169,7 +168,7 @@ namespace IRaCIS.Core.Application.Contracts.DTO
}
public class GetConsistencyCheckFileInDto:PageInput
public class GetConsistencyCheckFileInDto : PageInput
{
public Guid TrialId { get; set; }
@@ -241,9 +240,9 @@ namespace IRaCIS.Core.Application.Contracts.DTO
}
public class ChallengeAndDialog: QCChallengeWithUser
public class ChallengeAndDialog : QCChallengeWithUser
{
public List<QCChanllengeDialogDTO> DialogList { get; set; } = new List<QCChanllengeDialogDTO>();
}
@@ -254,8 +253,8 @@ namespace IRaCIS.Core.Application.Contracts.DTO
public class TrialVisitQADTO
{
public bool ExistsManual { get; set; }
public bool IsHaveStudyClinicalData { get; set; }
public SubjectClinicalDataDto SubjectClinicalData { get; set; } = new SubjectClinicalDataDto();
public bool IsHaveStudyClinicalData { get; set; }
public SubjectClinicalDataDto SubjectClinicalData { get; set; } = new SubjectClinicalDataDto();
public List<NoneDicomStudyView> NoneDicomStudyList { get; set; } = new List<NoneDicomStudyView>();
@@ -391,7 +390,7 @@ namespace IRaCIS.Core.Application.Contracts.DTO
public bool IsCompleteClinicalData { get; set; }
}
}
public class QASeriesInfoDto
{
@@ -475,12 +474,13 @@ namespace IRaCIS.Core.Application.Contracts.DTO
public List<ParamInfoDto> ParamInfoList
{
get {
get
{
try
{
return JsonConvert.DeserializeObject<List<ParamInfoDto>>(ParamInfo);
return JsonConvert.DeserializeObject<List<ParamInfoDto>>(ParamInfo);
}
catch (Exception )
catch (Exception)
{
return new List<ParamInfoDto>();
@@ -1,15 +1,11 @@
using IRaCIS.Core.API._ServiceExtensions.NewtonsoftJson;
using IRaCIS.Core.Application.Contracts.DTO;
using IRaCIS.Core.Application.Helper;
using IRaCIS.Core.Application.ViewModel;
using IRaCIS.Core.Domain.Share;
using MiniExcelLibs.Attributes;
using Newtonsoft.Json;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Web;
using static MassTransit.ValidationResultExtensions;
namespace IRaCIS.Core.Application.Contracts
{
@@ -4,8 +4,6 @@
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
//--------------------------------------------------------------------
using IRaCIS.Core.Domain.Share;
using System;
using System.Collections.Generic;
namespace IRaCIS.Core.Application.Contracts
{
@@ -22,11 +20,11 @@ namespace IRaCIS.Core.Application.Contracts
public Guid Id { get; set; }
public string QuestionName { get; set; } = String.Empty;
/// <summary>
/// 语言类型
/// </summary>
public LanguageType LanguageType { get; set; } = LanguageType.Chinese;
public bool IsRequired { get; set; }
/// <summary>
/// 语言类型
/// </summary>
public LanguageType LanguageType { get; set; } = LanguageType.Chinese;
public bool IsRequired { get; set; }
public bool IsEnable { get; set; }
public string Type { get; set; } = String.Empty;
public string ParentTriggerValue { get; set; }
@@ -50,11 +48,11 @@ namespace IRaCIS.Core.Application.Contracts
public Guid Id { get; set; }
public string QuestionName { get; set; } = String.Empty;
/// <summary>
/// 语言类型
/// </summary>
public LanguageType LanguageType { get; set; } = LanguageType.Chinese;
public bool IsRequired { get; set; }
/// <summary>
/// 语言类型
/// </summary>
public LanguageType LanguageType { get; set; } = LanguageType.Chinese;
public bool IsRequired { get; set; }
public bool IsEnable { get; set; }
public string Type { get; set; } = String.Empty;
public string ParentTriggerValue { get; set; }
@@ -63,7 +61,7 @@ namespace IRaCIS.Core.Application.Contracts
public int ShowOrder { get; set; }
public string ParentQuestionName { get; set; } = String.Empty;
public int? ParentShowOrder { get; set; }
public Guid CreateUserId { get; set; }
@@ -73,18 +71,18 @@ namespace IRaCIS.Core.Application.Contracts
}
///<summary>QCQuestionQuery 列表查询参数模型</summary>
public class QCQuestionQuery:PageInput
public class QCQuestionQuery : PageInput
{
///<summary> QuestionName</summary>
public string QuestionName { get; set; } = String.Empty;
/// <summary>
/// 语言类型
/// </summary>
public LanguageType? LanguageType { get; set; }
/// <summary>
/// 语言类型
/// </summary>
public LanguageType? LanguageType { get; set; }
///<summary> TypeValue</summary>
public string Type { get; set; } = String.Empty;
///<summary> TypeValue</summary>
public string Type { get; set; } = String.Empty;
public bool? IsEnable { get; set; }
@@ -101,11 +99,11 @@ namespace IRaCIS.Core.Application.Contracts
public Guid? Id { get; set; }
public string QuestionName { get; set; } = String.Empty;
/// <summary>
/// 语言类型
/// </summary>
public LanguageType LanguageType { get; set; } = LanguageType.Chinese;
public bool IsRequired { get; set; }
/// <summary>
/// 语言类型
/// </summary>
public LanguageType LanguageType { get; set; } = LanguageType.Chinese;
public bool IsRequired { get; set; }
public bool IsEnable { get; set; }
public string Type { get; set; } = String.Empty;
@@ -15,11 +15,11 @@ namespace IRaCIS.Core.Application.Contracts
public Guid TrialId { get; set; }
public string QuestionName { get; set; } = string.Empty;
/// <summary>
/// 语言类型
/// </summary>
public LanguageType LanguageType { get; set; } = LanguageType.Chinese;
public bool IsRequired { get; set; }
/// <summary>
/// 语言类型
/// </summary>
public LanguageType LanguageType { get; set; } = LanguageType.Chinese;
public bool IsRequired { get; set; }
public bool IsEnable { get; set; }
public string Type { get; set; } = string.Empty;
public string TypeValue { get; set; } = string.Empty;
@@ -52,7 +52,7 @@ namespace IRaCIS.Core.Application.Contracts
public Guid? Id { get; set; }
public string[] TypeArray { get; set; }=new string[0];
public string[] TypeArray { get; set; } = new string[0];
}
public class TrialQCQuestionSelect
@@ -60,12 +60,12 @@ namespace IRaCIS.Core.Application.Contracts
public Guid Id { get; set; }
public string QuestionName { get; set; } = string.Empty;
/// <summary>
/// 语言类型
/// </summary>
public LanguageType LanguageType { get; set; } = LanguageType.Chinese;
/// <summary>
/// 语言类型
/// </summary>
public LanguageType LanguageType { get; set; } = LanguageType.Chinese;
public Guid? ParentId { get; set; }
public Guid? ParentId { get; set; }
public int ShowOrder { get; set; }
public string TypeValue { get; set; }
@@ -84,13 +84,13 @@ namespace IRaCIS.Core.Application.Contracts
///<summary> QuestionName</summary>
public string QuestionName { get; set; } = string.Empty;
/// <summary>
/// 语言类型
/// </summary>
public LanguageType? LanguageType { get; set; }
/// <summary>
/// 语言类型
/// </summary>
public LanguageType? LanguageType { get; set; }
///<summary> TypeValue</summary>
public string Type { get; set; }=String.Empty;
///<summary> TypeValue</summary>
public string Type { get; set; } = String.Empty;
public bool? IsEnable { get; set; }
@@ -100,7 +100,7 @@ namespace IRaCIS.Core.Application.Contracts
}
///<summary> TrialQCQuestionAddOrEdit 列表查询参数模型</summary>
public class TrialQCQuestionAddOrEdit:TrialQCQuestionConfigureBatchAdd
public class TrialQCQuestionAddOrEdit : TrialQCQuestionConfigureBatchAdd
{
public Guid TrialId { get; set; }
@@ -115,15 +115,15 @@ namespace IRaCIS.Core.Application.Contracts
}
public class TrialQCQuestionConfigureBatchAdd
{
public Guid? Id { get; set; }
public string QuestionName { get; set; } = string.Empty;
/// <summary>
/// 语言类型
/// </summary>
public LanguageType LanguageType { get; set; } = LanguageType.Chinese;
public bool IsRequired { get; set; }
/// <summary>
/// 语言类型
/// </summary>
public LanguageType LanguageType { get; set; } = LanguageType.Chinese;
public bool IsRequired { get; set; }
public bool IsEnable { get; set; }
public string Type { get; set; } = string.Empty;
public Guid? ParentId { get; set; }
@@ -3,11 +3,6 @@
// 生成时间 2021-11-22 11:29:44
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
//--------------------------------------------------------------------
using IRaCIS.Core.Infrastructure.Extention;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace IRaCIS.Core.Application.Contracts
{
public interface IClinicalDataService
@@ -3,11 +3,6 @@
// 生成时间 2021-12-06 10:54:55
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
//--------------------------------------------------------------------
using IRaCIS.Core.Infra.EFCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace IRaCIS.Core.Application.Contracts
{
public interface INoneDicomStudyService
@@ -21,6 +16,6 @@ namespace IRaCIS.Core.Application.Contracts
//Task<IResponseOutput> UploadNoneDicomFile(IFormCollection formCollection, Guid subjectVisitId, Guid noneDicomStudyId);
}
}
@@ -20,10 +20,10 @@ namespace IRaCIS.Core.Application.Image.QA
Task<List<QCChallengeWithUser>> GetHistoryChallengeList(Guid subjectVisitId, [FromRoute] TrialQCProcess trialQCProcess, [FromRoute] CurrentQC currentQCType);
Task<List<QCChanllengeCreatorDto>> GetQCChallengeCreatorList(Guid trialId);
Task<List<ChallengeAndDialog>> GetQCChallengeDialogList(Guid qaChallengeId);
Task<List<ParticipantDTO>> GetQCParticipantList(Guid trialId);
Task<List<QCQuestionAnswerItemDto>> GetQCQuestionAnswerList(Guid subjectVisitId, Guid trialId, [FromRoute] TrialQCProcess trialQCProcess, [FromRoute] CurrentQC currentQCType);
Task<List<SubjectVisitSelectItem>> GetSubjectVisitSelectList(Guid subjectId);
Task<(List<QAStudyInfoDTO>, object)> GetSubjectVisitUploadedStudyList(Guid subjectVisitId);
Task<UploadViewInitDto> GetUploadInitInfo(Guid subjectVisitId);
@@ -2,14 +2,12 @@
using IRaCIS.Core.Application.Contracts.DTO;
using IRaCIS.Core.Application.Service.Inspection.DTO;
using IRaCIS.Core.Domain.Share;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace IRaCIS.Core.Application.Image.QA
{
public interface IQCOperationService
{
{
Task<IResponseOutput> CheckBack(Guid subjectVisitId);
Task<IResponseOutput> SetNeedReupload(Guid trialId, Guid qcChallengeId);
Task<IResponseOutput> QCPassedOrFailed(Guid trialId, Guid subjectVisitId, [FromRoute] AuditStateEnum auditState);
@@ -38,7 +36,7 @@ namespace IRaCIS.Core.Application.Image.QA
//Task<IResponseOutput> UploadVisitCheckExcel(IFormFile file, Guid trialId);
Task<IResponseOutput> VerifyCanQCPassedOrFailed(Guid subjectVisitId);
//Task<IResponseOutput> ForwardSVDicomImage(Guid[] subjectVisitIdList);
}
}
@@ -3,8 +3,6 @@
// 生成时间 2021-11-11 11:04:54
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
//--------------------------------------------------------------------
using IRaCIS.Core.Infrastructure.Extention;
namespace IRaCIS.Core.Application.Contracts
{
public interface IQCQuestionService
@@ -13,6 +11,6 @@ namespace IRaCIS.Core.Application.Contracts
Task<IResponseOutput> DeleteQCQuestionConfigure(Guid qCQuestionConfigureId);
Task<PageOutput<QCQuestionConfigureView>> GetQCQuestionConfigureList(QCQuestionQuery queryQCQuestionConfigure);
}
}
@@ -3,8 +3,6 @@
// 生成时间 2021-11-11 11:04:54
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
//--------------------------------------------------------------------
using IRaCIS.Core.Infrastructure.Extention;
namespace IRaCIS.Core.Application.Contracts
{
public interface ITrialQCQuestionConfigureService
@@ -1,11 +1,9 @@
using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Infrastructure;
using Microsoft.Extensions.Localization;
using System.Linq.Expressions;
namespace IRaCIS.Core.Application.Service
{
public class QCCommon: BaseService
public class QCCommon : BaseService
{
@@ -18,7 +16,7 @@ namespace IRaCIS.Core.Application.Service
/// <param name="subjectVisitId"></param>
/// <returns></returns>
/// <exception cref="BusinessValidationFailedException"></exception>
public async Task VerifyIsCRCSubmmitAsync(IRepository<SubjectVisit> _subjectVisitRepository, IUserInfo _userInfo, Guid? subjectVisitId = null)
public async Task VerifyIsCRCSubmmitAsync(IRepository<SubjectVisit> _subjectVisitRepository, IUserInfo _userInfo, Guid? subjectVisitId = null)
{
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator)
{
@@ -28,7 +26,7 @@ namespace IRaCIS.Core.Application.Service
if (await _subjectVisitRepository.AnyAsync(t => t.Id == subjectVisitId && t.SubmitState == SubmitStateEnum.Submitted &&
(!t.QCChallengeList.Any(u => u.ReuploadEnum == QCChanllengeReuploadEnum.QCAgreeUpload))))
{
//---CRC 已提交影像,不能进行操作。
//---CRC 已提交影像,不能进行操作。
throw new BusinessValidationFailedException(_localizer["QCCommon_CannotOperate"]);
}
}
@@ -45,7 +43,7 @@ namespace IRaCIS.Core.Application.Service
}
public async Task VerifyIsCanQCAsync(IRepository<SubjectVisit> _subjectVisitRepository, IUserInfo _userInfo, SubjectVisit? subjectVisit = null, Guid? subjectVisitId = null)
public async Task VerifyIsCanQCAsync(IRepository<SubjectVisit> _subjectVisitRepository, IUserInfo _userInfo, SubjectVisit? subjectVisit = null, Guid? subjectVisitId = null)
{
if (subjectVisitId != null)
{
@@ -60,7 +58,7 @@ namespace IRaCIS.Core.Application.Service
public async Task VerifyStudyImageDataAsync(IRepository<SubjectVisit> _subjectVisitRepository, Guid subjectId, Guid subjectVisitId, DateTime imageDate)
public async Task VerifyStudyImageDataAsync(IRepository<SubjectVisit> _subjectVisitRepository, Guid subjectId, Guid subjectVisitId, DateTime imageDate)
{
var visitList = await _subjectVisitRepository.Where(t => t.SubjectId == subjectId).Select(t => new { t.VisitNum, t.EarliestScanDate, t.LatestScanDate, t.Id }).ToListAsync();
@@ -1,15 +1,10 @@
using IRaCIS.Core.Application.Contracts;
using Microsoft.AspNetCore.Mvc;
using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Application.Contracts.DTO;
using IRaCIS.Core.Application.Service;
using Microsoft.AspNetCore.Authorization;
using IRaCIS.Application.Interfaces;
using IRaCIS.Application.Contracts;
using IRaCIS.Core.Application.ViewModel;
using IRaCIS.Core.Application.Service.Reading.Dto;
using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Infrastructure;
using MassTransit.Initializers;
using Microsoft.AspNetCore.Mvc;
namespace IRaCIS.Core.Application.Image.QA
{
@@ -29,7 +24,7 @@ namespace IRaCIS.Core.Application.Image.QA
IRepository<QCChallenge> _qcChallengeRepository,
IReadingImageTaskService _IReadingImageTaskService) : BaseService, IQCListService
{
@@ -42,7 +37,7 @@ namespace IRaCIS.Core.Application.Image.QA
/// <param name="inQuery"></param>
/// <returns></returns>
[HttpPost]
public async Task<IResponseOutput< PageOutput<QCCRCVisitViewModel>>> GetCRCVisitList(CRCVisitSearchDTO inQuery)
public async Task<IResponseOutput<PageOutput<QCCRCVisitViewModel>>> GetCRCVisitList(CRCVisitSearchDTO inQuery)
{
var svExpression = QCCommon.GetSubjectVisitFilter(inQuery.VisitPlanArray);
@@ -65,10 +60,10 @@ namespace IRaCIS.Core.Application.Image.QA
var defalutSortArray = new string[] { nameof(QCCRCVisitViewModel.IsUrgent) + " desc", nameof(QCCRCVisitViewModel.SubjectCode), nameof(QCCRCVisitViewModel.VisitNum) };
var pageList = await query.ToPagedListAsync(inQuery, defalutSortArray);
var config = await _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
config.IsHaveSubjectClinicalData = await _clinicalDataTrialSet.AnyAsync(x => x.TrialId == inQuery.TrialId && x.IsConfirm && (x.ClinicalDataLevel == ClinicalLevel.Subject ) && x.UploadRole == UploadRole.CRC);
var config = await _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
config.IsHaveSubjectClinicalData = await _clinicalDataTrialSet.AnyAsync(x => x.TrialId == inQuery.TrialId && x.IsConfirm && (x.ClinicalDataLevel == ClinicalLevel.Subject) && x.UploadRole == UploadRole.CRC);
config.IsHaveVisitClinicalData = await _clinicalDataTrialSet.AnyAsync(x => x.TrialId == inQuery.TrialId && x.IsConfirm && (x.ClinicalDataLevel == ClinicalLevel.SubjectVisit) && x.UploadRole == UploadRole.CRC);
return ResponseOutput.Ok (pageList, config);
return ResponseOutput.Ok(pageList, config);
}
@@ -81,7 +76,7 @@ namespace IRaCIS.Core.Application.Image.QA
[HttpPost]
public async Task<QCCRCChallengeViewModel> GetNextCRCChallenge(GetNextCRCChallengeInDto inDto)
{
var list =await GetCRCChallengeList(new ChallengeQuery()
var list = await GetCRCChallengeList(new ChallengeQuery()
{
TrialId = inDto.TrialId,
PageIndex = 1,
@@ -91,41 +86,41 @@ namespace IRaCIS.Core.Application.Image.QA
var pageList = list.Data.CurrentPageData.ToList();
var data = pageList.Where(x=>x.Id==inDto.QCChallengeId||x.IsClosed==false).ToList();
var data = pageList.Where(x => x.Id == inDto.QCChallengeId || x.IsClosed == false).ToList();
if (data.Count > 0)
{
if (data.Count > 0)
{
var index = data.ToList().FindIndex(x => x.Id == inDto.QCChallengeId);
var index = data.ToList().FindIndex(x => x.Id == inDto.QCChallengeId);
var result = new QCCRCChallengeViewModel() { };
var result = new QCCRCChallengeViewModel() { };
if (index + 1 == data.Count()) // 最后一个
{
throw new BusinessValidationFailedException(_localizer["QCList_CRCFinishChallenge"]);
}
else if (index == -1 || data.Count == 1) // 第一个或者只有一个
{
if (data[0].Id == inDto.QCChallengeId)
{
throw new BusinessValidationFailedException(_localizer["QCList_CRCFinishChallenge"]);
}
result = data[0];
}
else
{
result = data.Skip(index + 1).Take(1).First();
if (index + 1 == data.Count()) // 最后一个
{
throw new BusinessValidationFailedException(_localizer["QCList_CRCFinishChallenge"]);
}
else if (index == -1 || data.Count == 1) // 第一个或者只有一个
{
if (data[0].Id == inDto.QCChallengeId)
{
throw new BusinessValidationFailedException(_localizer["QCList_CRCFinishChallenge"]);
}
result = data[0];
}
else
{
result = data.Skip(index + 1).Take(1).First();
}
return result;
}
return result;
}
else
{
throw new BusinessValidationFailedException(_localizer["QCList_CRCFinishChallenge"]);
}
}
else
{
throw new BusinessValidationFailedException(_localizer["QCList_CRCFinishChallenge"]);
}
}
}
@@ -157,10 +152,10 @@ namespace IRaCIS.Core.Application.Image.QA
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.SubjectVisit.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
.ProjectTo<QCCRCChallengeViewModel>(_mapper.ConfigurationProvider);
var pageList = await query.ToPagedListAsync(inQuery, new string[] { nameof(QCCRCChallengeViewModel.IsUrgent)+ " desc", nameof(QCCRCChallengeViewModel.CreateTime)});
var pageList = await query.ToPagedListAsync(inQuery, new string[] { nameof(QCCRCChallengeViewModel.IsUrgent) + " desc", nameof(QCCRCChallengeViewModel.CreateTime) });
var config = await _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
return ResponseOutput.Ok (pageList, config);
var config = await _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
return ResponseOutput.Ok(pageList, config);
}
@@ -197,7 +192,7 @@ namespace IRaCIS.Core.Application.Image.QA
var pageList = await query.ToPagedListAsync(inQuery, new string[] { nameof(QCCRCChallengeViewModel.IsUrgent) + " desc", nameof(QCCRCChallengeViewModel.CreateTime) });
var config = await _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
var config = await _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
return (pageList, config);
}
@@ -208,19 +203,19 @@ namespace IRaCIS.Core.Application.Image.QA
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<QCVisitViewModel?> GetNextQCInfo(GetNextQCInfoInDto inDto)
{
var result = await GetQCVisitList(new QCVisitSearchDTO()
{
TrialId = inDto.TrialId,
CurrentActionUserId = _userInfo.Id,
VisitId = inDto.VisitId,
PageIndex = 1,
PageSize = 1,
});
public async Task<QCVisitViewModel?> GetNextQCInfo(GetNextQCInfoInDto inDto)
{
var result = await GetQCVisitList(new QCVisitSearchDTO()
{
TrialId = inDto.TrialId,
CurrentActionUserId = _userInfo.Id,
VisitId = inDto.VisitId,
PageIndex = 1,
PageSize = 1,
});
return result.Data.CurrentPageData.Count > 0 ? result.Data.CurrentPageData[0] : null;
}
return result.Data.CurrentPageData.Count > 0 ? result.Data.CurrentPageData[0] : null;
}
/// <summary>
/// QC 访视列表
@@ -233,8 +228,8 @@ namespace IRaCIS.Core.Application.Image.QA
var svExpression = QCCommon.GetSubjectVisitFilter(inQuery.VisitPlanArray);
var query = _subjectVisitRepository.Where(x => x.TrialId == inQuery.TrialId)
.WhereIf(inQuery.VisitId != null, t => t.Id == inQuery.VisitId)
.WhereIf(inQuery.CurrentActionUserId != null, t => t.CurrentActionUserId == inQuery.CurrentActionUserId)
.WhereIf(inQuery.VisitId != null, t => t.Id == inQuery.VisitId)
.WhereIf(inQuery.CurrentActionUserId != null, t => t.CurrentActionUserId == inQuery.CurrentActionUserId)
.WhereIf(inQuery.ChallengeState != null, t => t.ChallengeState == inQuery.ChallengeState)
.WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId)
.WhereIf(inQuery.SubjectId != null, t => t.Subject.Id == inQuery.SubjectId)
@@ -250,8 +245,8 @@ namespace IRaCIS.Core.Application.Image.QA
|| t.QCChallengeDialogList.Any(t => t.CreateUserId == inQuery.HandleUserId))
.WhereIf(inQuery.IsUrgent != null, t => t.IsUrgent == inQuery.IsUrgent)
.Where(t => t.SubmitState != SubmitStateEnum.None)
.WhereIf(inQuery.BeginAuditTime != null, t => t.Trial.QCProcessEnum==TrialQCProcess.SingleAudit? t.PreliminaryAuditTime>= inQuery.BeginAuditTime:
(t.Trial.QCProcessEnum == TrialQCProcess.DoubleAudit?t.ReviewAuditTime>= inQuery.BeginAuditTime:true))
.WhereIf(inQuery.BeginAuditTime != null, t => t.Trial.QCProcessEnum == TrialQCProcess.SingleAudit ? t.PreliminaryAuditTime >= inQuery.BeginAuditTime :
(t.Trial.QCProcessEnum == TrialQCProcess.DoubleAudit ? t.ReviewAuditTime >= inQuery.BeginAuditTime : true))
.WhereIf(inQuery.EndAuditTime != null, t => t.Trial.QCProcessEnum == TrialQCProcess.SingleAudit ? t.PreliminaryAuditTime <= inQuery.EndAuditTime :
(t.Trial.QCProcessEnum == TrialQCProcess.DoubleAudit ? t.ReviewAuditTime <= inQuery.EndAuditTime : true))
@@ -267,9 +262,9 @@ namespace IRaCIS.Core.Application.Image.QA
var config = await _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
var config = await _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
return ResponseOutput.Ok (pageList, config);
return ResponseOutput.Ok(pageList, config);
}
@@ -299,7 +294,7 @@ namespace IRaCIS.Core.Application.Image.QA
.ProjectTo<QCCheckWithModalityView>(_mapper.ConfigurationProvider);
var pageList = await query.ToPagedListAsync(inQuery);
var config = await _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
var config = await _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
return (pageList, config);
}
@@ -371,11 +366,11 @@ namespace IRaCIS.Core.Application.Image.QA
return new TrialVisitQADTO
{
QCQuestionAnswerList = qacheckList,
QCQuestionAnswerList = qacheckList,
IsHaveStudyClinicalData = await _clinicalDataTrialSetRepository.AnyAsync(x => x.IsConfirm && x.TrialId == sv.TrialId && x.ClinicalDataLevel == ClinicalLevel.Study),
StudyList = temp.StudyList,
ExistsManual= (await _IReadingImageTaskService.GetManualList(new GetManualListInDto() { TrialId = sv.TrialId })).Count() > 0,
IsHaveStudyClinicalData = await _clinicalDataTrialSetRepository.AnyAsync(x => x.IsConfirm && x.TrialId == sv.TrialId && x.ClinicalDataLevel == ClinicalLevel.Study),
StudyList = temp.StudyList,
ExistsManual = (await _IReadingImageTaskService.GetManualList(new GetManualListInDto() { TrialId = sv.TrialId })).Count() > 0,
SeriesList = temp.SeriesList,
RelationInfo = await GetVisitQCSubjectInfo(subjectVisitId),
NoneDicomStudyList = await _noneDicomStudyRepository.Where(t => t.SubjectVisitId == subjectVisitId).ProjectTo<NoneDicomStudyView>(_mapper.ConfigurationProvider).ToListAsync(),
@@ -521,20 +516,20 @@ namespace IRaCIS.Core.Application.Image.QA
/// <param name="subjectVisitId"></param>
/// <returns></returns>
[HttpGet("{subjectVisitId:guid}")]
public async Task<(List<QAStudyInfoDTO>,object)> GetSubjectVisitUploadedStudyList(Guid subjectVisitId)
public async Task<(List<QAStudyInfoDTO>, object)> GetSubjectVisitUploadedStudyList(Guid subjectVisitId)
{
var visit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).FirstNotNullAsync();
var list= await _dicomStudyRepository.Where(s => s.SubjectVisitId == subjectVisitId).IgnoreQueryFilters().ProjectTo<QAStudyInfoDTO>(_mapper.ConfigurationProvider).OrderBy(t=>t.StudyCode).ToListAsync();
var list = await _dicomStudyRepository.Where(s => s.SubjectVisitId == subjectVisitId).IgnoreQueryFilters().ProjectTo<QAStudyInfoDTO>(_mapper.ConfigurationProvider).OrderBy(t => t.StudyCode).ToListAsync();
var config = await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).Select(t=>t.Trial).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
var config = await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).Select(t => t.Trial).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
config.IsHaveStudyClinicalData = await _clinicalDataTrialSetRepository.AnyAsync(x => x.IsConfirm && x.TrialId == visit.TrialId && x.ClinicalDataLevel == ClinicalLevel.Study);
config.IsPacsConnectConfiged= await _subjectVisitRepository.Where(t=>t.Id==subjectVisitId).AnyAsync(t=>t.Trial.IsPACSConnect && t.Subject.TrialSite.TrialSiteDicomAEList.Any());
config.IsPacsConnectConfiged = await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).AnyAsync(t => t.Trial.IsPACSConnect && t.Subject.TrialSite.TrialSiteDicomAEList.Any());
return (list, config);
return (list, config);
}
@@ -640,9 +635,9 @@ namespace IRaCIS.Core.Application.Image.QA
//var maxNum = await _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TaskState == TaskState.Effect && t.SignTime != null && t.TrialReadingCriterion.IsReadingTaskViewInOrder == ReadingOrder.InOrder).MaxAsync(x => (decimal?)x.VisitTaskNum)??0;
var maxNum=await _subjectVisitRepository.Where(t=>t.SubjectId == subjectId && t.SubmitState==SubmitStateEnum.Submitted).MaxAsync(x => (decimal?)x.VisitNum) ?? 0;
var maxNum = await _subjectVisitRepository.Where(t => t.SubjectId == subjectId && t.SubmitState == SubmitStateEnum.Submitted).MaxAsync(x => (decimal?)x.VisitNum) ?? 0;
return await _subjectVisitRepository.Where(t => t.SubjectId == subjectId&&t.VisitNum>= maxNum).OrderBy(T => T.VisitNum).ProjectTo<SubjectVisitSelectItem>(_mapper.ConfigurationProvider).ToListAsync();
return await _subjectVisitRepository.Where(t => t.SubjectId == subjectId && t.VisitNum >= maxNum).OrderBy(T => T.VisitNum).ProjectTo<SubjectVisitSelectItem>(_mapper.ConfigurationProvider).ToListAsync();
}
@@ -1,21 +1,15 @@
using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Application.Contracts.DTO;
using IRaCIS.Core.Application.Filter;
using IRaCIS.Core.Domain.Share;
using Microsoft.AspNetCore.Mvc;
using System.Data;
using Microsoft.AspNetCore.Authorization;
using Newtonsoft.Json;
using IRaCIS.Core.Infrastructure;
using IRaCIS.Core.Application.Service.Inspection.DTO;
using System.ComponentModel.DataAnnotations;
using IRaCIS.Core.Application.Auth;
using IRaCIS.Core.Application.Helper;
using IRaCIS.Core.Application.ViewModel;
using IRaCIS.Core.Domain.Models;
using IRaCIS.Core.Application.Service;
using IRaCIS.Core.Application.Service.Inspection.DTO;
using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Infrastructure;
using Medallion.Threading;
using DocumentFormat.OpenXml.Office2010.Excel;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using System.ComponentModel.DataAnnotations;
using System.Data;
namespace IRaCIS.Core.Application.Image.QA
{
@@ -43,7 +37,7 @@ namespace IRaCIS.Core.Application.Image.QA
IDistributedLockProvider _distributedLockProvider, IReadingClinicalDataService _readingClinicalDataService) : BaseService, IQCOperationService
{
#region QC质疑
@@ -680,7 +674,7 @@ namespace IRaCIS.Core.Application.Image.QA
}
else
{
if (await _subjectVisitRepository.AnyAsync(t => t.Id == updateModalityCommand.SubjectVisitId && t.SubmitState == SubmitStateEnum.Submitted && !t.QCChallengeList.Any(c=>c.ReuploadEnum==QCChanllengeReuploadEnum.QCAgreeUpload)) )
if (await _subjectVisitRepository.AnyAsync(t => t.Id == updateModalityCommand.SubjectVisitId && t.SubmitState == SubmitStateEnum.Submitted && !t.QCChallengeList.Any(c => c.ReuploadEnum == QCChanllengeReuploadEnum.QCAgreeUpload)))
{
//---提交之后,不允许修改!
throw new BusinessValidationFailedException(_localizer["QCOperation_NoModifyAfterSubmit"]);
@@ -776,9 +770,9 @@ namespace IRaCIS.Core.Application.Image.QA
var succeess2 = await _dicomInstanceRepository.BatchDeleteNoTrackingAsync(t => t.StudyId == id);
var success3 = await _dicomSeriesrepository.BatchDeleteNoTrackingAsync(t => t.StudyId == id);
await _scpStudyRepository.BatchUpdateNoTrackingAsync(t => t.Id == id,u=>new SCPStudy() { SubjectVisitId=null});
await _scpStudyRepository.BatchUpdateNoTrackingAsync(t => t.Id == id, u => new SCPStudy() { SubjectVisitId = null });
//var success3 = await _dicomSeriesrepository.DeleteFromQueryAsync(t => t.StudyId == id, true);
//var success4 = await _repository.BatchDeleteAsync<StudyMonitor>(t => t.StudyId == id);
@@ -802,19 +796,19 @@ namespace IRaCIS.Core.Application.Image.QA
}
var subjectId=waitDeleteStudyList.Select(t=>t.SubjectId).FirstOrDefault();
var subjectId = waitDeleteStudyList.Select(t => t.SubjectId).FirstOrDefault();
var patientList = _scpPatientRepository.Where(t => t.SubjectId == subjectId).Select(t => t.Id).ToList();
foreach (var patientId in patientList)
{
if (_scpPatientRepository.Where(t=>t.Id== patientId).Any(t => t.SCPStudyList.Count() == t.SCPStudyList.Where(t => t.SubjectVisitId == null).Count()))
if (_scpPatientRepository.Where(t => t.Id == patientId).Any(t => t.SCPStudyList.Count() == t.SCPStudyList.Where(t => t.SubjectVisitId == null).Count()))
{
await _scpPatientRepository.BatchUpdateNoTrackingAsync(t => t.Id == patientId, u => new SCPPatient() { SubjectId = null });
}
}
await _subjectVisitRepository.SaveChangesAsync();
@@ -1308,7 +1302,7 @@ namespace IRaCIS.Core.Application.Image.QA
return ResponseOutput.NotOk(_localizer["QCOperation_MissingBaselineDate"]);
}
if (_subjectVisitRepository.Where(t => t.Id == dbSubjectVisit.Id).Any(t => (t.StudyList.Count(t => t.ModalityForEdit == "") > 0 ||t.NoneDicomStudyList.Count(t => t.Modality == "")>0) && t.Trial.TrialReadingCriterionList.Count(t => t.IsImageFilter == true) > 0))
if (_subjectVisitRepository.Where(t => t.Id == dbSubjectVisit.Id).Any(t => (t.StudyList.Count(t => t.ModalityForEdit == "") > 0 || t.NoneDicomStudyList.Count(t => t.Modality == "") > 0) && t.Trial.TrialReadingCriterionList.Count(t => t.IsImageFilter == true) > 0))
{
//有标准配置了影像筛选,该受试者有检查未设置检查类型,不允许提交
return ResponseOutput.NotOk(_localizer["QCOperation_MissingModality"]);
@@ -1790,7 +1784,7 @@ namespace IRaCIS.Core.Application.Image.QA
{
//获取项目配置
var trialConfig = await _trialRepository.Where(t => t.Id == trialId).Select(t => new { TrialId = t.Id, t.QCProcessEnum, t.IsImageConsistencyVerification })
var trialConfig = await _trialRepository.Where(t => t.Id == trialId).Select(t => new { TrialId = t.Id, t.QCProcessEnum, t.IsImageConsistencyVerification })
.FirstOrDefaultAsync().IfNullThrowException();
if (trialConfig.QCProcessEnum == TrialQCProcess.NotAudit)
@@ -2061,12 +2055,12 @@ namespace IRaCIS.Core.Application.Image.QA
return ResponseOutput.NotOk(_localizer["QCOperation_CannotModifyConfirmation"]);
}
// if (await _subjectVisitRepository.Where(t => t.Id == command.SubjectVisitId)
//.AnyAsync(t => t.IsEnrollmentConfirm != command.IsEnrollmentConfirm && t.RequestBackState == RequestBackStateEnum.PM_AgressBack))
// {
// //---该访视为回退访视,不允许修改PD确认状态
// return ResponseOutput.NotOk(_localizer["QCOperation_CannotModifyPDStatus"]);
// }
// if (await _subjectVisitRepository.Where(t => t.Id == command.SubjectVisitId)
//.AnyAsync(t => t.IsEnrollmentConfirm != command.IsEnrollmentConfirm && t.RequestBackState == RequestBackStateEnum.PM_AgressBack))
// {
// //---该访视为回退访视,不允许修改PD确认状态
// return ResponseOutput.NotOk(_localizer["QCOperation_CannotModifyPDStatus"]);
// }
dbSubjectVisit.IsEnrollmentConfirm = command.IsEnrollmentConfirm.Value;
}
@@ -4,10 +4,7 @@
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
//--------------------------------------------------------------------
using IRaCIS.Core.Application.Service.Reading.Dto;
using IRaCIS.Core.Infra.EFCore.Common;
using IRaCIS.Core.Infrastructure;
using IRaCIS.Core.Infrastructure.Extention;
using Microsoft.AspNetCore.Mvc;
namespace IRaCIS.Core.Application.Contracts
@@ -20,7 +17,7 @@ namespace IRaCIS.Core.Application.Contracts
IRepository<QCQuestion> _qcQuestionRepository,
IRepository<TrialQCQuestion> _trialQCQuestionRepository) : BaseService, IQCQuestionService
{
/// <summary>
@@ -37,12 +34,13 @@ namespace IRaCIS.Core.Application.Contracts
var initList = await _qcQuestionRepository
.WhereIf(trialQCQuestionFilterSelect.TypeArray.Count() > 0, t => trialQCQuestionFilterSelect.TypeArray.Contains(t.Type))
.WhereIf(trialQCQuestionFilterSelect.Id != null, t => t.Id != trialQCQuestionFilterSelect.Id && t.ParentId != trialQCQuestionFilterSelect.Id)
.OrderBy(t => t.ShowOrder).Select(x => new TrialQCQuestionSelect() {
.OrderBy(t => t.ShowOrder).Select(x => new TrialQCQuestionSelect()
{
ShowOrder = x.ShowOrder,
Id = x.Id,
ParentId = x.ParentId,
QuestionName = x.QuestionName,
LanguageType=x.LanguageType,
LanguageType = x.LanguageType,
TypeValue = x.TypeValue,
}).ToListAsync();
@@ -88,13 +86,13 @@ namespace IRaCIS.Core.Application.Contracts
{
var QCQuestionQueryable = _qcQuestionRepository
.WhereIf(queryQCQuestionConfigure.IsEnable != null,x=>x.IsEnable== queryQCQuestionConfigure.IsEnable)
.WhereIf(queryQCQuestionConfigure.IsEnable != null, x => x.IsEnable == queryQCQuestionConfigure.IsEnable)
.WhereIf(!string.IsNullOrWhiteSpace(queryQCQuestionConfigure.QuestionName), t => t.QuestionName.Contains(queryQCQuestionConfigure.QuestionName))
.WhereIf(!string.IsNullOrWhiteSpace(queryQCQuestionConfigure.Type), t => t.Type.Contains(queryQCQuestionConfigure.Type))
.WhereIf(queryQCQuestionConfigure.LanguageType!=null, t =>t.LanguageType== queryQCQuestionConfigure.LanguageType)
.WhereIf(queryQCQuestionConfigure.IsDefeaultViewParent==true,t=>t.ParentId==null)
.OrderByDescending(x=>x.LanguageType)
.ThenBy(t=>t.ShowOrder)
.WhereIf(queryQCQuestionConfigure.LanguageType != null, t => t.LanguageType == queryQCQuestionConfigure.LanguageType)
.WhereIf(queryQCQuestionConfigure.IsDefeaultViewParent == true, t => t.ParentId == null)
.OrderByDescending(x => x.LanguageType)
.ThenBy(t => t.ShowOrder)
.ProjectTo<QCQuestionConfigureView>(_mapper.ConfigurationProvider);
var defalutSortArray = new string[] { nameof(QCQuestionConfigureView.LanguageType) + " desc", nameof(QCQuestionConfigureView.ShowOrder) };
@@ -125,7 +123,7 @@ namespace IRaCIS.Core.Application.Contracts
//---当前任务存在子问题,删除失败
throw new BusinessValidationFailedException(_localizer["QCQuestion_HasChildQuestion"]);
}
await _qcQuestionRepository.DeleteFromQueryAsync(t => t.Id == qCQuestionConfigureId,true);
await _qcQuestionRepository.DeleteFromQueryAsync(t => t.Id == qCQuestionConfigureId, true);
return ResponseOutput.Ok();
}
@@ -143,27 +141,28 @@ namespace IRaCIS.Core.Application.Contracts
public async Task<List<QCQuestionView>> GetQuestionView(QCQuestionViewInDto inDto)
{
var question = new List<QCQuestionView>();
if (inDto.TrialId!= null)
if (inDto.TrialId != null)
{
question = await _trialQCQuestionRepository.Where(x => x.TrialId == inDto.TrialId&&x.IsEnable).OrderBy(x => x.ShowOrder).ProjectTo<QCQuestionView>
(_mapper.ConfigurationProvider, new
{
isEn_Us = _userInfo.IsEn_Us
question = await _trialQCQuestionRepository.Where(x => x.TrialId == inDto.TrialId && x.IsEnable).OrderBy(x => x.ShowOrder).ProjectTo<QCQuestionView>
(_mapper.ConfigurationProvider, new
{
isEn_Us = _userInfo.IsEn_Us
}).ToListAsync();
}).ToListAsync();
}
else
{
question=await _qcQuestionRepository.Where(x=>x.IsEnable).OrderBy(x => x.ShowOrder).ProjectTo<QCQuestionView>(_mapper.ConfigurationProvider, new
{
isEn_Us = _userInfo.IsEn_Us
question = await _qcQuestionRepository.Where(x => x.IsEnable).OrderBy(x => x.ShowOrder).ProjectTo<QCQuestionView>(_mapper.ConfigurationProvider, new
{
isEn_Us = _userInfo.IsEn_Us
}).ToListAsync();
}).ToListAsync();
}
var result = question.Where(x => x.ParentId == null).ToList();
result.ForEach(x => {
result.ForEach(x =>
{
GetQuestionChild(x, question);
});
@@ -178,13 +177,13 @@ namespace IRaCIS.Core.Application.Contracts
if (parent.Childrens.Count != 0)
{
parent.Childrens.ForEach(x =>
parent.Childrens.ForEach(x =>
{
GetQuestionChild(x, dataList);
});
}
}
@@ -4,13 +4,9 @@
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
//--------------------------------------------------------------------
using IRaCIS.Core.Application.Auth;
using IRaCIS.Core.Application.Filter;
using IRaCIS.Core.Application.ViewModel;
using IRaCIS.Core.Infra.EFCore;
using IRaCIS.Core.Infrastructure;
using MassTransit;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace IRaCIS.Core.Application.Contracts
@@ -26,7 +22,7 @@ namespace IRaCIS.Core.Application.Contracts
IRepository<TrialQCQuestionAnswer> _trialQCQuestionAnswerRepository,
IRepository<QCQuestion> _qCQuestionRepository) : BaseService, ITrialQCQuestionConfigureService
{
/// <summary>
/// 清空Qc问题
@@ -51,17 +47,17 @@ namespace IRaCIS.Core.Application.Contracts
.WhereIf(!string.IsNullOrWhiteSpace(queryTrialQCQuestionConfigure.Type), t => t.Type.Contains(queryTrialQCQuestionConfigure.Type))
.WhereIf(queryTrialQCQuestionConfigure.IsEnable != null, t => t.IsEnable == queryTrialQCQuestionConfigure.IsEnable)
.WhereIf(queryTrialQCQuestionConfigure.IsRequired != null, t => t.IsRequired == queryTrialQCQuestionConfigure.IsRequired)
.WhereIf(queryTrialQCQuestionConfigure.LanguageType != null, t => t.LanguageType == queryTrialQCQuestionConfigure.LanguageType)
.WhereIf(queryTrialQCQuestionConfigure.LanguageType != null, t => t.LanguageType == queryTrialQCQuestionConfigure.LanguageType)
.ProjectTo<TrialQCQuestionConfigureView>(_mapper.ConfigurationProvider);
.ProjectTo<TrialQCQuestionConfigureView>(_mapper.ConfigurationProvider);
var list = await trialQCQuestionQueryable.OrderByDescending(x=>x.LanguageType).ThenBy(t => t.ShowOrder).ToListAsync();
var list = await trialQCQuestionQueryable.OrderByDescending(x => x.LanguageType).ThenBy(t => t.ShowOrder).ToListAsync();
var isHaveQCQuestion = _trialQCQuestionRepository.Where(t => t.TrialId == queryTrialQCQuestionConfigure.TrialId).Any();
var signInfo = await _trialRepository.Where(t => t.Id == queryTrialQCQuestionConfigure.TrialId)
var signInfo = await _trialRepository.Where(t => t.Id == queryTrialQCQuestionConfigure.TrialId)
.Select(trial => new
{
trial.QCProcessEnum,
@@ -91,10 +87,10 @@ namespace IRaCIS.Core.Application.Contracts
.WhereIf(trialQCQuestionFilterSelect.TypeArray.Count() > 0, t => trialQCQuestionFilterSelect.TypeArray.Contains(t.Type))
.WhereIf(trialQCQuestionFilterSelect.Id != null, t => t.Id != trialQCQuestionFilterSelect.Id && t.ParentId != trialQCQuestionFilterSelect.Id)
.OrderBy(t => t.ShowOrder).ProjectTo<TrialQCQuestionSelect>(_mapper.ConfigurationProvider, new
{
isEn_Us = _userInfo.IsEn_Us
{
isEn_Us = _userInfo.IsEn_Us
}).ToListAsync();
}).ToListAsync();
//父亲的序号肯定要比自己小
if (trialQCQuestionFilterSelect.Id != null)
@@ -301,7 +297,7 @@ namespace IRaCIS.Core.Application.Contracts
if (addOrEditTrialQCQuestionConfigure.ParentId != null)
{
var parentShowOrder = await _trialQcQuestionRepository.Where(x => x.Id == addOrEditTrialQCQuestionConfigure.ParentId).Select(x => x.ShowOrder).FirstOrDefaultAsync();
if(parentShowOrder> addOrEditTrialQCQuestionConfigure.ShowOrder)
if (parentShowOrder > addOrEditTrialQCQuestionConfigure.ShowOrder)
{
//---父问题的显示序号要比子问题的显示序号小,请确认。
throw new BusinessValidationFailedException(_localizer["TrialConfig_InvalidParentQuestionId"]);
@@ -5,7 +5,6 @@ using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Application.Contracts.DTO;
using IRaCIS.Core.Application.MassTransit.Command;
using IRaCIS.Core.Domain.Share;
using static IRaCIS.Core.Application.Contracts.SubjectProgressDto;
namespace IRaCIS.Core.Application.Service
{
@@ -487,13 +486,13 @@ namespace IRaCIS.Core.Application.Service
CreateMap<PreviousHistory, PreviousHistoryView>()
.ForMember(d => d.CreateUser, u => u.MapFrom(s => s.CreateUser.FullName))
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path ));
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path));
CreateMap<PreviousOther, PreviousOtherView>()
.ForMember(d => d.CreateUser, u => u.MapFrom(s => s.CreateUser.FullName))
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path ));
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path));
CreateMap<PreviousSurgery, PreviousSurgeryView>()
.ForMember(d => d.CreateUser, u => u.MapFrom(s => s.CreateUser.FullName))
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path ));
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path));
@@ -597,13 +596,13 @@ namespace IRaCIS.Core.Application.Service
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path));
CreateMap<NoneDicomStudy, NoneDicomStudyView>()
.ForMember(d => d.NoneDicomStudyFileList, u => u.MapFrom(s => isFilterZip ? s.NoneDicomFileList.Where(t => !t.FileType.Contains(StaticData.FileType.Zip)) : s.NoneDicomFileList))
.ForMember(d => d.NoneDicomStudyFileList, u => u.MapFrom(s => isFilterZip ? s.NoneDicomFileList.Where(t => !t.FileType.Contains(StaticData.FileType.Zip)) : s.NoneDicomFileList))
.ForMember(d => d.CodeView, u => u.MapFrom(s => s.StudyCode));
Guid? visiTaskId = null;
CreateMap<NoneDicomStudy, TaskDicomStudyView>()
.ForMember(d => d.NoneDicomStudyFileList, u => u.MapFrom(s => isFilterZip ?
s.TaskNoneDicomFileList.Where(t=> visiTaskId != null?t.VisitTaskId==visiTaskId:true).Where(t => !t.FileType.Contains(StaticData.FileType.Zip))
.ForMember(d => d.NoneDicomStudyFileList, u => u.MapFrom(s => isFilterZip ?
s.TaskNoneDicomFileList.Where(t => visiTaskId != null ? t.VisitTaskId == visiTaskId : true).Where(t => !t.FileType.Contains(StaticData.FileType.Zip))
: s.TaskNoneDicomFileList.Where(t => visiTaskId != null ? t.VisitTaskId == visiTaskId : true)))
.ForMember(d => d.CodeView, u => u.MapFrom(s => s.StudyCode));