修改项目停止 不允许操作

Uat_Study
{872297557@qq.com} 2023-01-04 18:02:37 +08:00
parent e7ff7547a1
commit 2441a6ae3b
10 changed files with 87 additions and 64 deletions

View File

@ -406,6 +406,7 @@ namespace IRaCIS.Core.API.Controllers
/// </summary>
/// <returns></returns>
[HttpPost, Route("Inspection/TrialDocument/userConfirm")]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[UnitOfWork]
public async Task<IResponseOutput> UserConfirm(DataInspectionDto<UserConfirmCommand> opt)
{

View File

@ -384,7 +384,7 @@ namespace IRaCIS.Core.Application.Services
return ResponseOutput.Ok(result);
}
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.PM)]
public async Task<IResponseOutput> AddOrUpdateTrialDocument(AddOrEditTrialDocument addOrEditTrialDocument)
{
@ -454,6 +454,7 @@ namespace IRaCIS.Core.Application.Services
/// <returns></returns>
[HttpDelete("{trialId:guid}/{trialDocumentId:guid}")]
[Authorize(Policy = IRaCISPolicy.PM)]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> DeleteTrialDocument(Guid trialDocumentId, Guid trialId)
{
if (await _trialDocumentRepository.AsQueryable(true).Where(t => t.Id == trialDocumentId).AnyAsync(t => t.TrialDocConfirmedUserList.Any()))
@ -600,6 +601,7 @@ namespace IRaCIS.Core.Application.Services
/// <param name="isSystemDoc"></param>
/// <returns></returns>
[HttpPut("{documentId:guid}/{isSystemDoc:bool}")]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> UserAbandonDoc(Guid documentId, bool isSystemDoc)
{
if (isSystemDoc)

View File

@ -58,7 +58,7 @@ namespace IRaCIS.Core.Application.Image.QA
#region QC质疑 以及回复 关闭
[HttpGet("{trialId:guid}/{subjectVisitId:guid}/{currentQCType:int}")]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.IQC)]
public async Task<IResponseOutput> VerifyQCCanAddChallenge(Guid subjectVisitId, [FromRoute] CurrentQC currentQCType)
{
@ -81,7 +81,7 @@ namespace IRaCIS.Core.Application.Image.QA
/// <param name="currentQCType"></param>
/// <returns></returns>
[HttpPost("{trialId:guid}/{trialQCProcess:int}/{currentQCType:int}")]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.IQC)]
public async Task<IResponseOutput> AddOrUpdateQCChallenge(QCChallengeCommand qaQuestionCommand, Guid trialId, [FromRoute] TrialQCProcess trialQCProcess, [FromRoute] CurrentQC currentQCType)
{
@ -139,7 +139,7 @@ namespace IRaCIS.Core.Application.Image.QA
/// </summary>
/// <returns></returns>
[HttpPut]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[UnitOfWork]
[Authorize(Policy = IRaCISPolicy.IQC)]
public async Task<IResponseOutput> CloseQCChallenge(CloseQCChallengeInDto input)
@ -192,7 +192,7 @@ namespace IRaCIS.Core.Application.Image.QA
/// </summary>
/// <returns></returns>
[HttpDelete("{trialId:guid}/{subjectVisitId:guid}/{qcChallengeId:guid}")]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.IQC)]
public async Task<IResponseOutput> DeleteQCChallenge(Guid qcChallengeId)
{
@ -219,7 +219,7 @@ namespace IRaCIS.Core.Application.Image.QA
/// <param name="qaDialogCommand"></param>
/// <returns></returns>
[HttpPost("{trialId:guid}")]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.CRC_IQC)]
public async Task<IResponseOutput> AddQCChallengeReply(QADialogCommand qaDialogCommand)
{
@ -254,7 +254,7 @@ namespace IRaCIS.Core.Application.Image.QA
/// <param name="checkDialogCommand"></param>
/// <returns></returns>
[HttpPost("{trialId:guid}")]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.PM_APM_CRC)]
public async Task<IResponseOutput> AddCheckChallengeReply(CheckChallengeDialogCommand checkDialogCommand)
{
@ -293,7 +293,7 @@ namespace IRaCIS.Core.Application.Image.QA
/// </summary>
/// <returns></returns>
[HttpPut("{trialId:guid}")]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.PM_APM)]
public async Task<IResponseOutput> CloseCheckChallenge(CloseCheckChallengeDto input)
{
@ -327,7 +327,7 @@ namespace IRaCIS.Core.Application.Image.QA
/// </summary>
/// <returns></returns>
[HttpPut("{trialId:guid}")]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.PM_APM)]
[UnitOfWork]
public async Task<IResponseOutput> SetCheckPass(SetCheckPassDt data)
@ -372,7 +372,7 @@ namespace IRaCIS.Core.Application.Image.QA
/// <param name="subjectVisitId"></param>
/// <returns></returns>
[HttpPut("{trialId:guid}/{subjectVisitId:guid}")]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.CRC)]
public async Task<IResponseOutput> CRCRequstCheckBack(Guid subjectVisitId)
{
@ -411,8 +411,11 @@ namespace IRaCIS.Core.Application.Image.QA
}
[HttpPut("{trialId:guid}/{subjectVisitId:guid}")]
[Authorize(Policy = IRaCISPolicy.PM_APM)]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> RejectCheckBack(Guid subjectVisitId)
{
//if (_userInfo.UserTypeEnumInt != (int)UserTypeEnum.ProjectManager && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.APM)
@ -443,7 +446,7 @@ namespace IRaCIS.Core.Application.Image.QA
/// </summary>
/// <returns></returns>
[HttpPut("{trialId:guid}/{subjectVisitId:guid}")]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.PM_APM)]
[UnitOfWork]
public async Task<IResponseOutput> CheckBack(Guid subjectVisitId)
@ -520,7 +523,7 @@ namespace IRaCIS.Core.Application.Image.QA
/// 添加或者更新 QC核对问题列表 两个人不能同时操作,就算意外进去了,提交数据,也不会覆盖前一个人数据, 后台已经做好判断
/// </summary>
[HttpPost("{trialId:guid}/{subjectVisitId:guid}/{trialQCProcess:int}/{currentQCType:int}")]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.IQC)]
public async Task<IResponseOutput> AddOrUpdateQCQuestionAnswerList(QCQuestionAnswerCommand[] qcQuestionAnswerCommands, Guid trialId, Guid subjectVisitId, [FromRoute] TrialQCProcess trialQCProcess, [FromRoute] CurrentQC currentQCType)
{
@ -592,7 +595,7 @@ namespace IRaCIS.Core.Application.Image.QA
/// <param name="state"></param>
/// <returns></returns>
[HttpPut("{trialId:guid}/{subjectVisitId:guid}/{studyId:guid}/{seriesId:guid}/{state:int}")]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.IQC)]
public async Task<IResponseOutput> SetSeriesState(Guid subjectVisitId, Guid studyId, Guid seriesId, int state)
{
@ -659,7 +662,7 @@ namespace IRaCIS.Core.Application.Image.QA
/// </summary>
/// <returns></returns>
[HttpPost("{trialId:guid}")]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.CRC_IQC)]
public async Task<IResponseOutput> UpdateModality(UpdateModalityCommand updateModalityCommand)
{
@ -670,7 +673,7 @@ namespace IRaCIS.Core.Application.Image.QA
}
else
{
if(await _subjectVisitRepository.AnyAsync(t=>t.Id==updateModalityCommand.SubjectVisitId && t.SubmitState == SubmitStateEnum.Submitted))
if (await _subjectVisitRepository.AnyAsync(t => t.Id == updateModalityCommand.SubjectVisitId && t.SubmitState == SubmitStateEnum.Submitted))
{
throw new BusinessValidationFailedException("提交之后,不允许修改!");
}
@ -736,7 +739,7 @@ namespace IRaCIS.Core.Application.Image.QA
/// <param name="trialId"></param>
/// <returns></returns>SeriesCount
[HttpPost, Route("{trialId:guid}/{subjectVisitId:guid}")]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[UnitOfWork]
[Authorize(Policy = IRaCISPolicy.CRC_IQC)]
public async Task<IResponseOutput> DeleteStudyList(Guid[] ids, Guid subjectVisitId, Guid trialId)
@ -785,7 +788,7 @@ namespace IRaCIS.Core.Application.Image.QA
//删除 物理文件
var instancePathList = await _repository.Where<DicomInstance>(t => t.StudyId == id)
.Select(t => t.Path ).ToListAsync();
.Select(t => t.Path).ToListAsync();
instancePathList.ForEach(path =>
{
@ -851,6 +854,7 @@ namespace IRaCIS.Core.Application.Image.QA
/// <summary>替换当前领取人 </summary>
[HttpPut("{trialId:guid}/{subjectVisitId:guid}")]
[Authorize(Policy = IRaCISPolicy.IQC)]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> ReplaceQCTaskActionUser(Guid trialId, Guid subjectVisitId)
{
var dbSubjectVisit = (await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId)).IfNullThrowException();
@ -882,7 +886,7 @@ namespace IRaCIS.Core.Application.Image.QA
/// <param name="obtaionOrCancel">true 获取 false是取消领取</param>
/// <returns></returns>
[HttpPut("{trialId:guid}/{subjectVisitId:guid}/{obtaionOrCancel:bool}")]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.IQC)]
public async Task<IResponseOutput> ObtainOrCancelQCTask(Guid trialId, Guid subjectVisitId, bool obtaionOrCancel)
{
@ -1076,11 +1080,11 @@ namespace IRaCIS.Core.Application.Image.QA
}
}
if(dbSubjectVisitList.Any(t=>t.IsBaseLine && !t.IsHaveClinicalData))
if (dbSubjectVisitList.Any(t => t.IsBaseLine && !t.IsHaveClinicalData))
{
return ResponseOutput.NotOk($"基线没有临床数据,确认提交?", 0, ApiResponseCodeEnum.NeedTips);
}
@ -1095,7 +1099,7 @@ namespace IRaCIS.Core.Application.Image.QA
/// </summary>
/// <returns></returns>
[HttpPost]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.CRC)]
public async Task<IResponseOutput> CRCRequestToQC(CRCRequestToQCCommand cRCRequestToQCCommand)
{
@ -1104,7 +1108,7 @@ namespace IRaCIS.Core.Application.Image.QA
.FirstOrDefaultAsync(t => t.TrialId == cRCRequestToQCCommand.TrialId)).IfNullThrowException();
//找到符合配置的标准 确认的并且签名的、双重,有序,阅片期仲裁
var trialReadingCriterionIdList = _repository.Where<ReadingQuestionCriterionTrial>(t => t.TrialId == cRCRequestToQCCommand.TrialId && t.IsConfirm && t.ReadingInfoSignTime != null
var trialReadingCriterionIdList = _repository.Where<ReadingQuestionCriterionTrial>(t => t.TrialId == cRCRequestToQCCommand.TrialId && t.IsConfirm && t.ReadingInfoSignTime != null
//&& t.ReadingType == ReadingMethod.Double && t.ArbitrationRule == ArbitrationRule.Reading
&& t.IsReadingTaskViewInOrder && t.IsReadingPeriod).Select(t => t.Id).ToList();
@ -1151,7 +1155,7 @@ namespace IRaCIS.Core.Application.Image.QA
await _readingClinicalDataRepository.BatchUpdateNoTrackingAsync(x => x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC && x.ReadingId == dbSubjectVisit.Id, x => new ReadingClinicalData()
{
IsSign = true,
ReadingClinicalDataState=ReadingClinicalDataStatus.HaveSigned
ReadingClinicalDataState = ReadingClinicalDataStatus.HaveSigned
});
//var signSuccess = await _repository.UpdateFromQueryAsync<TrialSign>(t => t.Id == cRCRequestToQCCommand.SignId, u => new TrialSign() { IsCompleted = true });
@ -1264,7 +1268,7 @@ namespace IRaCIS.Core.Application.Image.QA
ReadingSetType = ReadingSetType.ImageReading,
SubjectVisitId = dbSubjectVisit.Id,
ModuleName = $"G-{dbSubjectVisit.VisitName}",
ModuleType = ModuleTypeEnum.Global ,
ModuleType = ModuleTypeEnum.Global,
IsUrgent = dbSubjectVisit.IsUrgent,
TrialId = dbSubjectVisit.TrialId,
SubjectId = dbSubjectVisit.SubjectId
@ -1298,7 +1302,7 @@ namespace IRaCIS.Core.Application.Image.QA
/// <param name="auditState"></param>
/// <returns></returns>
[HttpPost("{trialId:guid}/{subjectVisitId:guid}/{auditState:int}")]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.IQC)]
[UnitOfWork]
public async Task<IResponseOutput> QCPassedOrFailed(Guid trialId, Guid subjectVisitId, [FromRoute] AuditStateEnum auditState)
@ -1310,7 +1314,7 @@ namespace IRaCIS.Core.Application.Image.QA
}
if(auditState== AuditStateEnum.QCPassed)
if (auditState == AuditStateEnum.QCPassed)
{
//判断质疑是否都关闭了
if (await _repository.AnyAsync<QCChallenge>(t => t.SubjectVisitId == subjectVisitId && t.IsClosed == false))
@ -1319,7 +1323,7 @@ namespace IRaCIS.Core.Application.Image.QA
}
}
var trialConfig = await _trialRepository
.Select(t => new { TrialId = t.Id, t.QCProcessEnum, t.IsImageConsistencyVerification })
@ -1392,7 +1396,7 @@ namespace IRaCIS.Core.Application.Image.QA
return ResponseOutput.NotOk("项目配置影像质控为单审,当前访视影像质控任务不能从当前审核状态变更到 审核通过。");
}
}
else if (trialConfig.QCProcessEnum == TrialQCProcess.DoubleAudit)
@ -1526,7 +1530,7 @@ namespace IRaCIS.Core.Application.Image.QA
/// <param name="setOrCancel"></param>
/// <returns></returns>
[HttpPut("{trialId:guid}/{subjectVisitId:guid}/{setOrCancel:bool}")]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.IQC)]
public async Task<IResponseOutput> SetVisitUrgent(Guid trialId, Guid subjectVisitId, bool setOrCancel)
{
@ -1563,7 +1567,7 @@ namespace IRaCIS.Core.Application.Image.QA
/// <param name="qcChallengeId"></param>
/// <returns></returns>
[HttpPut("{trialId:guid}/{subjectVisitId:guid}/{qcChallengeId:guid}")]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.IQC)]
public async Task<IResponseOutput> SetNeedReupload(Guid trialId, Guid qcChallengeId)
{
@ -1660,7 +1664,7 @@ namespace IRaCIS.Core.Application.Image.QA
/// <returns></returns>
[HttpPost]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.CRC)]
public async Task<IResponseOutput> SetReuploadFinished(CRCReuploadFinishedCommand cRCReuploadFinishedCommand)
{
@ -1735,7 +1739,7 @@ namespace IRaCIS.Core.Application.Image.QA
[HttpPut("{trialId:guid}/{subjectVisitId:guid}/{qcChallengeId:guid}")]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.CRC)]
public async Task<IResponseOutput> CRCRequestReUpload(Guid qcChallengeId)
{
@ -1780,7 +1784,7 @@ namespace IRaCIS.Core.Application.Image.QA
/// <returns></returns>
[HttpPut("{trialId:guid}")]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> UpdateSubjectAndSVInfo(UploadSubjectAndVisitCommand command)
{
var dbSubjectVisit = (await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == command.SubjectVisitId)).IfNullThrowException();
@ -1818,6 +1822,7 @@ namespace IRaCIS.Core.Application.Image.QA
[HttpPost("{trialId:guid}")]
[Authorize(Policy = IRaCISPolicy.PM_APM)]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> ForwardSVDicomImage(Guid[] subjectVisitIdList)
{

View File

@ -7,6 +7,7 @@ using System.Linq.Dynamic.Core;
using IRaCIS.Core.Application.Service;
using IRaCIS.Core.Application.ViewModel;
using IRaCIS.Core.Infrastructure;
using IRaCIS.Core.Application.Filter;
namespace IRaCIS.Application.Services
{
@ -251,6 +252,7 @@ namespace IRaCIS.Application.Services
/// <param name="dto"></param>
/// <returns></returns>
[HttpPost]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> AddReadModule(ReadModuleAddDto dto)
{
@ -404,6 +406,7 @@ namespace IRaCIS.Application.Services
/// <param name="readModuleId"></param>
/// <returns></returns>
[HttpDelete("{readModuleId:guid}")]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> DeleteReadModule(Guid readModuleId)
{

View File

@ -5,6 +5,7 @@ using MassTransit;
using IRaCIS.Core.Application.Service;
using IRaCIS.Core.Application.ViewModel;
using IRaCIS.Core.Infrastructure;
using IRaCIS.Core.Application.Filter;
namespace IRaCIS.Application.Services
{
@ -65,6 +66,7 @@ namespace IRaCIS.Application.Services
/// <param name="addOrEditReadingPeriodSet"></param>
/// <returns></returns>
[HttpPost]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> AddOrUpdateReadingPeriodSet(ReadingPeriodSetAddOrEdit addOrEditReadingPeriodSet)
{
if (await _readingPeriodSetRepository.AnyAsync(x => x.Id != addOrEditReadingPeriodSet.Id && x.IsTakeEffect != ReadingPeriodStatus.Revocation
@ -126,6 +128,7 @@ namespace IRaCIS.Application.Services
/// <param name="readingPeriodSetId"></param>
/// <returns></returns>
[HttpDelete("{readingPeriodSetId:guid}")]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> DeleteReadingPeriodSet(Guid readingPeriodSetId)
{
await _readingPeriodSetRepository.UpdatePartialFromQueryAsync(t => t.Id == readingPeriodSetId, x => new ReadingPeriodSet()
@ -149,6 +152,7 @@ namespace IRaCIS.Application.Services
/// <param name="indto"></param>
/// <returns></returns>
[HttpPut]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> SetReadingPeriodSetEffect(SetReadingPeriodSetEffect indto)
{
var readingPeriodSet = await _readingPeriodSetRepository.Where(x => x.Id == indto.Id).FirstNotNullAsync();
@ -369,6 +373,7 @@ namespace IRaCIS.Application.Services
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> GenerateReadingTask(ReadingToGenerateInDto inDto)
{
List<ReadingPeriodPlan> plans = new List<ReadingPeriodPlan>();

View File

@ -34,7 +34,7 @@ namespace IRaCIS.Core.Application.Contracts
return await trialSiteEquipmentSurveyQueryable.ToListAsync();
}
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[HttpPost("{trialId:guid}")]
public async Task<IResponseOutput> AddOrUpdateTrialSiteEquipmentSurvey(TrialSiteEquipmentSurveyAddOrEdit addOrEditTrialSiteEquipmentSurvey)
{
@ -54,7 +54,7 @@ namespace IRaCIS.Core.Application.Contracts
}
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[HttpDelete("{trialSiteEquipmentSurveyId:guid}/{trialId:guid}")]
public async Task<IResponseOutput> DeleteTrialSiteEquipmentSurvey(Guid trialSiteEquipmentSurveyId)
{

View File

@ -87,6 +87,7 @@ namespace IRaCIS.Core.Application.Contracts
/// <exception cref="BusinessValidationFailedException"></exception>
[HttpPost]
[AllowAnonymous]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> VerifySendCode(LoginDto userInfo, [FromServices] ITokenService _tokenService)
{
@ -643,7 +644,6 @@ namespace IRaCIS.Core.Application.Contracts
/// </summary>
/// <param name="siteSurvyeSubmit"></param>
/// <returns></returns>
// [TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[HttpPost]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[UnitOfWork]
@ -763,8 +763,10 @@ namespace IRaCIS.Core.Application.Contracts
await _trialSiteUserSurveyRepository.SaveChangesAsync();
}
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> SendSiteSurveyUserJoinEmail(TrialSiteUserSurveyJoinCommand joinCommand)
{
var trialSiteSurvey = await _trialSiteSurveyRepository.FirstAsync(t => t.Id == joinCommand.TrialSiteSurveyId);

View File

@ -14,10 +14,10 @@ namespace IRaCIS.Application.Services
private readonly IRepository<Subject> _subjectRepository;
private readonly IRepository<SubjectVisit> _subjectVisitRepository;
public SubjectService(IRepository<Subject> subjectRepository,IRepository<SubjectVisit> subjectVisitRepository)
public SubjectService(IRepository<Subject> subjectRepository, IRepository<SubjectVisit> subjectVisitRepository)
{
_subjectRepository = subjectRepository;
_subjectVisitRepository = subjectVisitRepository;
_subjectVisitRepository = subjectVisitRepository;
}
/// <summary>
@ -27,7 +27,7 @@ namespace IRaCIS.Application.Services
/// <returns></returns>
[TrialAudit(AuditType.SubjectAudit, AuditOptType.AddOrUpdateSubject)]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.PM_APM_CRC_QC)]
public async Task<IResponseOutput<string>> AddOrUpdateSubject([FromBody] SubjectCommand subjectCommand)
{
@ -44,23 +44,23 @@ namespace IRaCIS.Application.Services
};
Subject? mapedSubject = null;
if (subjectCommand.Id == null) //insert
{
mapedSubject= await _subjectRepository.InsertFromDTOAsync(subjectCommand, false, verifyExp1);
mapedSubject = await _subjectRepository.InsertFromDTOAsync(subjectCommand, false, verifyExp1);
}
else //update
{
mapedSubject = await _subjectRepository.UpdateFromDTOAsync(subjectCommand, false,false, verifyExp1/*, verifyExp2*/);
mapedSubject = await _subjectRepository.UpdateFromDTOAsync(subjectCommand, false, false, verifyExp1/*, verifyExp2*/);
}
@ -74,15 +74,16 @@ namespace IRaCIS.Application.Services
[HttpPut]
[UnitOfWork]
[Authorize(Policy = IRaCISPolicy.PM_APM_CRC_QC)]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> UpdateSubjectStatus(SubjectStatusChangeCommand subjectStatusChangeCommand)
{
await _subjectRepository.UpdateFromDTOAsync(subjectStatusChangeCommand, true);
await _subjectRepository.UpdateFromDTOAsync(subjectStatusChangeCommand, true);
return ResponseOutput.Ok();
}
[HttpDelete("{trialId:guid}/{id:guid}")]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[UnitOfWork]
[Authorize(Policy = IRaCISPolicy.PM_APM_CRC)]
public async Task<IResponseOutput> DeleteSubject(Guid id)
@ -102,7 +103,7 @@ namespace IRaCIS.Application.Services
IsDeleted = true,
});
var isSuccess = await _subjectRepository.SaveChangesAsync();
var isSuccess = await _subjectRepository.SaveChangesAsync();
return ResponseOutput.Result(isSuccess);
}

View File

@ -54,7 +54,7 @@ namespace IRaCIS.Core.Application.Services
}
[HttpPost]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[UnitOfWork]
[Authorize(Policy = IRaCISPolicy.CRC)]
public async Task<IResponseOutput<string>> AddOrUpdateSV(SubjectVisitCommand svCommand)
@ -159,7 +159,7 @@ namespace IRaCIS.Core.Application.Services
[HttpPut("{trialId:guid}/{subjectVisitId:guid}/{isUrgent:bool}")]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.PM_IQC)]
public async Task<IResponseOutput> SetSubjectVisitUrgent(Guid subjectVisitId, bool isUrgent)
{
@ -171,7 +171,7 @@ namespace IRaCIS.Core.Application.Services
[HttpDelete, Route("{trialId:guid}/{id:guid}")]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.CRC)]
public async Task<IResponseOutput> DeleteSV(Guid id)
{
@ -284,7 +284,7 @@ namespace IRaCIS.Core.Application.Services
{
var result = new List<VisitStudyDTO>();
var thisRowinfo = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == indto.VisitTaskId && x.StudyId != null).OrderBy(x=>x.ReadingQuestionTrial.ShowOrder).ThenBy(x=>x.RowIndex).Select(x=>new
var thisRowinfo = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == indto.VisitTaskId && x.StudyId != null).OrderBy(x => x.ReadingQuestionTrial.ShowOrder).ThenBy(x => x.RowIndex).Select(x => new
{
x.ReadingQuestionTrial.ShowOrder,
x.RowIndex,
@ -299,7 +299,7 @@ namespace IRaCIS.Core.Application.Services
if (taskInfo.ReadingTaskState == ReadingTaskState.HaveSigned)
{
var thisStudyIds = thisRowinfo.OrderBy(x=>x.ShowOrder).ThenBy(x=>x.RowIndex).Select(x => x.StudyId).Distinct().ToList();
var thisStudyIds = thisRowinfo.OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).Select(x => x.StudyId).Distinct().ToList();
var thisSeriesIdIds = thisRowinfo.Where(x => x.SeriesId != null).OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).Select(x => x.SeriesId).Distinct().ToList();
if (thisRowinfo.Count > 0)
{
@ -324,16 +324,18 @@ namespace IRaCIS.Core.Application.Services
if (item != null)
{
item.SeriesInstanceUid = string.Empty;
item.InstanceList = thisRowinfo.Where(y => y.InstanceId != null).OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).Select(y => y.InstanceId.Value).Distinct().ToList();
var tempInstanceList = await _repository.Where<DicomInstance>(t => item.InstanceList.Contains(t.Id)).OrderBy(t => t.InstanceNumber)
.Select(t => new TempInstance {
Id=t.Id,
Path=t.Path,
NumberOfFrames=t.NumberOfFrames,
InstanceNumber = t.InstanceNumber }).ToListAsync();
.Select(t => new TempInstance
{
Id = t.Id,
Path = t.Path,
NumberOfFrames = t.NumberOfFrames,
InstanceNumber = t.InstanceNumber
}).ToListAsync();
tempInstanceList.ForEach(x =>
@ -422,7 +424,7 @@ namespace IRaCIS.Core.Application.Services
.SelectMany(u =>
{
if (u.NumberOfFrames >1)
if (u.NumberOfFrames > 1)
{
var pathList = new List<string>();
@ -517,7 +519,7 @@ namespace IRaCIS.Core.Application.Services
/// <param name="subjectVisitId"></param>
/// <returns></returns>
[HttpPut("{trialId:guid}/{subjectVisitId:guid}")]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[Obsolete]
public async Task<IResponseOutput> SetSVExecuted(Guid subjectVisitId)
{

View File

@ -55,7 +55,7 @@ namespace IRaCIS.Application.Services
/// </summary>
[HttpPost("{trialId}")]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[Authorize(Policy = IRaCISPolicy.PM_APM)]
public async Task<IResponseOutput> UploadReviewerAckSOW(Guid trialId,
ReviewerAckDTO attachmentViewModel)
@ -104,6 +104,7 @@ namespace IRaCIS.Application.Services
/// <param name="inDto"></param>
/// <returns></returns>
[Authorize(Policy = IRaCISPolicy.PM_APM)]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> SetEnrollReadingCategory(SetEnrollReadingCategoryInDto inDto)
{
@ -156,6 +157,7 @@ namespace IRaCIS.Application.Services
/// <param name="inCommand"></param>
/// <returns></returns>
[Authorize(Policy = IRaCISPolicy.PM_APM)]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> UpdateTrialReviewerState(SetEnrollEnableCommand inCommand)
{
await _taskAllocationRuleRepository.UpdatePartialFromQueryAsync(t => t.TrialId == inCommand.TrialId && t.EnrollId == inCommand.EnrollId, u => new TaskAllocationRule() { IsEnable = inCommand.IsEnable },true);