|
|
|
@@ -34,7 +34,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|
|
|
|
IRepository<DicomInstance> _dicomInstanceRepository,
|
|
|
|
|
IRepository<TrialQCQuestionAnswer> _trialQCQuestionAnswerRepository,
|
|
|
|
|
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
|
|
|
|
IDistributedLockProvider _distributedLockProvider, IReadingClinicalDataService _readingClinicalDataService,
|
|
|
|
|
IDistributedLockProvider _distributedLockProvider, IReadingClinicalDataService _readingClinicalDataService,
|
|
|
|
|
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer, IWebHostEnvironment _hostEnvironment) : BaseService, IQCOperationService
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
@@ -43,7 +43,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|
|
|
|
#region QC质疑 以及回复 关闭
|
|
|
|
|
|
|
|
|
|
[HttpGet("{trialId:guid}/{subjectVisitId:guid}/{currentQCType:int}")]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
//[Authorize(Policy = IRaCISPolicy.IQC)]
|
|
|
|
|
public async Task<IResponseOutput> VerifyQCCanAddChallenge(Guid subjectVisitId, [FromRoute] CurrentQC currentQCType)
|
|
|
|
|
{
|
|
|
|
@@ -67,7 +67,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|
|
|
|
/// <param name="currentQCType"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost("{trialId:guid}/{trialQCProcess:int}/{currentQCType:int}")]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
//[Authorize(Policy = IRaCISPolicy.IQC)]
|
|
|
|
|
public async Task<IResponseOutput> AddOrUpdateQCChallenge(QCChallengeCommand qaQuestionCommand, Guid trialId, [FromRoute] TrialQCProcess trialQCProcess, [FromRoute] CurrentQC currentQCType)
|
|
|
|
|
{
|
|
|
|
@@ -126,7 +126,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPut]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
[UnitOfWork]
|
|
|
|
|
//[Authorize(Policy = IRaCISPolicy.IQC)]
|
|
|
|
|
public async Task<IResponseOutput> CloseQCChallenge(CloseQCChallengeInDto input)
|
|
|
|
@@ -181,7 +181,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpDelete("{trialId:guid}/{subjectVisitId:guid}/{qcChallengeId:guid}")]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
//[Authorize(Policy = IRaCISPolicy.IQC)]
|
|
|
|
|
public async Task<IResponseOutput> DeleteQCChallenge(Guid qcChallengeId)
|
|
|
|
|
{
|
|
|
|
@@ -209,7 +209,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|
|
|
|
/// <param name="qaDialogCommand"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost("{trialId:guid}")]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
// [Authorize(Policy = IRaCISPolicy.CRC_IQC)]
|
|
|
|
|
public async Task<IResponseOutput> AddQCChallengeReply(QADialogCommand qaDialogCommand)
|
|
|
|
|
{
|
|
|
|
@@ -244,7 +244,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|
|
|
|
/// <param name="checkDialogCommand"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost("{trialId:guid}")]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
//[Authorize(Policy = IRaCISPolicy.PM_APM_CRC)]
|
|
|
|
|
public async Task<IResponseOutput> AddCheckChallengeReply(CheckChallengeDialogCommand checkDialogCommand)
|
|
|
|
|
{
|
|
|
|
@@ -284,7 +284,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPut("{trialId:guid}")]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
//[Authorize(Policy = IRaCISPolicy.PM_APM)]
|
|
|
|
|
public async Task<IResponseOutput> CloseCheckChallenge(CloseCheckChallengeDto input)
|
|
|
|
|
{
|
|
|
|
@@ -320,7 +320,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPut("{trialId:guid}")]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
//[Authorize(Policy = IRaCISPolicy.PM_APM)]
|
|
|
|
|
[UnitOfWork]
|
|
|
|
|
public async Task<IResponseOutput> SetCheckPass(SetCheckPassDt data)
|
|
|
|
@@ -367,7 +367,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|
|
|
|
/// <param name="subjectVisitId"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPut("{trialId:guid}/{subjectVisitId:guid}")]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
//[Authorize(Policy = IRaCISPolicy.CRC)]
|
|
|
|
|
public async Task<IResponseOutput> CRCRequstCheckBack(Guid subjectVisitId)
|
|
|
|
|
{
|
|
|
|
@@ -413,7 +413,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|
|
|
|
|
|
|
|
|
[HttpPut("{trialId:guid}/{subjectVisitId:guid}")]
|
|
|
|
|
//[Authorize(Policy = IRaCISPolicy.PM_APM)]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
public async Task<IResponseOutput> RejectCheckBack(Guid subjectVisitId)
|
|
|
|
|
{
|
|
|
|
|
//if (_userInfo.UserTypeEnumInt != (int)UserTypeEnum.ProjectManager && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.APM)
|
|
|
|
@@ -446,7 +446,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPut("{trialId:guid}/{subjectVisitId:guid}")]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
//[Authorize(Policy = IRaCISPolicy.PM_APM)]
|
|
|
|
|
[UnitOfWork]
|
|
|
|
|
public async Task<IResponseOutput> CheckBack(Guid subjectVisitId)
|
|
|
|
@@ -525,7 +525,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|
|
|
|
/// 添加或者更新 QC核对问题列表 两个人不能同时操作,就算意外进去了,提交数据,也不会覆盖前一个人数据, 后台已经做好判断
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpPost("{trialId:guid}/{subjectVisitId:guid}/{trialQCProcess:int}/{currentQCType:int}")]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
//[Authorize(Policy = IRaCISPolicy.IQC)]
|
|
|
|
|
public async Task<IResponseOutput> AddOrUpdateQCQuestionAnswerList(QCQuestionAnswerCommand[] qcQuestionAnswerCommands, Guid trialId, Guid subjectVisitId, [FromRoute] TrialQCProcess trialQCProcess, [FromRoute] CurrentQC currentQCType)
|
|
|
|
|
{
|
|
|
|
@@ -597,7 +597,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|
|
|
|
/// <param name="state"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPut("{trialId:guid}/{subjectVisitId:guid}/{studyId:guid}/{seriesId:guid}/{state:int}")]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
//[Authorize(Policy = IRaCISPolicy.IQC)]
|
|
|
|
|
public async Task<IResponseOutput> SetSeriesState(Guid subjectVisitId, Guid studyId, Guid seriesId, int state)
|
|
|
|
|
{
|
|
|
|
@@ -659,12 +659,80 @@ namespace IRaCIS.Core.Application.Image.QA
|
|
|
|
|
return ResponseOutput.Ok(await _dicomStudyRepository.SaveChangesAsync());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 1、设置为不读片,2 设置为读片(取消 先前设置为不读片) 4 设置为删除(数据库记录软删除) 5 恢复为未删除
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="subjectVisitId"></param>
|
|
|
|
|
/// <param name="seriesId"></param>
|
|
|
|
|
/// <param name="instanceId"></param>
|
|
|
|
|
/// <param name="state"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPut("{trialId:guid}/{subjectVisitId:guid}/{seriesId:guid}/{instanceId:guid}/{state:int}")]
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
public async Task<IResponseOutput> SetInstanceState(Guid subjectVisitId, Guid seriesId, Guid instanceId, int state)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
await VerifyIsCanQCAsync(null, subjectVisitId);
|
|
|
|
|
|
|
|
|
|
var instance = (await _dicomInstanceRepository.Where(t => t.Id == instanceId, true).IgnoreQueryFilters().FirstOrDefaultAsync()).IfNullThrowException();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (state == 1)
|
|
|
|
|
{
|
|
|
|
|
instance.IsReading = false;
|
|
|
|
|
}
|
|
|
|
|
else if (state == 2)
|
|
|
|
|
{
|
|
|
|
|
instance.IsReading = true;
|
|
|
|
|
}
|
|
|
|
|
else if (state == 4)
|
|
|
|
|
{
|
|
|
|
|
instance.IsDeleted = true;
|
|
|
|
|
|
|
|
|
|
var series = (await _dicomSeriesRepository.Where(t => t.Id == seriesId, true).IgnoreQueryFilters().FirstOrDefaultAsync()).IfNullThrowException();
|
|
|
|
|
|
|
|
|
|
series.InstanceCount = series.InstanceCount - 1;
|
|
|
|
|
|
|
|
|
|
var study = (await _dicomStudyRepository.Where(t => t.Id == series.StudyId, true).IgnoreQueryFilters().FirstOrDefaultAsync()).IfNullThrowException();
|
|
|
|
|
|
|
|
|
|
study.InstanceCount = study.InstanceCount - 1;
|
|
|
|
|
|
|
|
|
|
////删除到最后一个instance
|
|
|
|
|
//if (series.InstanceCount == 0)
|
|
|
|
|
//{
|
|
|
|
|
// series.IsDeleted = true;
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if (state == 5)
|
|
|
|
|
{
|
|
|
|
|
instance.IsDeleted = false;
|
|
|
|
|
|
|
|
|
|
var series = (await _dicomSeriesRepository.Where(t => t.Id == seriesId, true).IgnoreQueryFilters().FirstOrDefaultAsync()).IfNullThrowException();
|
|
|
|
|
|
|
|
|
|
series.InstanceCount = series.InstanceCount + 1;
|
|
|
|
|
|
|
|
|
|
var study = (await _dicomStudyRepository.Where(t => t.Id == series.StudyId, true).IgnoreQueryFilters().FirstOrDefaultAsync()).IfNullThrowException();
|
|
|
|
|
|
|
|
|
|
study.InstanceCount = study.InstanceCount + 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ResponseOutput.Ok(await _dicomStudyRepository.SaveChangesAsync());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
///type 1 :study 2: series 3:非dicom QC修改检查部位和 拍片类型
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost("{trialId:guid}")]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
// [Authorize(Policy = IRaCISPolicy.CRC_IQC)]
|
|
|
|
|
public async Task<IResponseOutput> UpdateModality(UpdateModalityCommand updateModalityCommand)
|
|
|
|
|
{
|
|
|
|
@@ -744,7 +812,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|
|
|
|
/// <param name="trialId"></param>
|
|
|
|
|
/// <returns></returns>SeriesCount
|
|
|
|
|
[HttpPost, Route("{trialId:guid}/{subjectVisitId:guid}")]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
[UnitOfWork]
|
|
|
|
|
// [Authorize(Policy = IRaCISPolicy.CRC_IQC)]
|
|
|
|
|
public async Task<IResponseOutput> DeleteStudyList(Guid[] ids, Guid subjectVisitId, Guid trialId)
|
|
|
|
@@ -848,7 +916,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|
|
|
|
/// <summary>替换当前领取人 </summary>
|
|
|
|
|
[HttpPut("{trialId:guid}/{subjectVisitId:guid}")]
|
|
|
|
|
//[Authorize(Policy = IRaCISPolicy.IQC)]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
public async Task<IResponseOutput> ReplaceQCTaskActionUser(Guid trialId, Guid subjectVisitId)
|
|
|
|
|
{
|
|
|
|
|
var dbSubjectVisit = (await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId)).IfNullThrowException();
|
|
|
|
@@ -1010,7 +1078,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|
|
|
|
/// <param name="obtaionOrCancel">true 获取 false是取消领取</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPut("{trialId:guid}/{subjectVisitId:guid}/{obtaionOrCancel:bool}")]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
//[Authorize(Policy = IRaCISPolicy.IQC)]
|
|
|
|
|
public async Task<IResponseOutput> ObtainOrCancelQCTask(Guid trialId, Guid subjectVisitId, bool obtaionOrCancel)
|
|
|
|
|
{
|
|
|
|
@@ -1235,7 +1303,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
//[Authorize(Policy = IRaCISPolicy.CRC)]
|
|
|
|
|
public async Task<IResponseOutput> CRCRequestToQC(CRCRequestToQCCommand cRCRequestToQCCommand)
|
|
|
|
|
{
|
|
|
|
@@ -1523,7 +1591,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|
|
|
|
/// <param name="auditState"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost("{trialId:guid}/{subjectVisitId:guid}/{auditState:int}")]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
//[Authorize(Policy = IRaCISPolicy.IQC)]
|
|
|
|
|
[UnitOfWork]
|
|
|
|
|
public async Task<IResponseOutput> QCPassedOrFailed(Guid trialId, Guid subjectVisitId, [FromRoute] AuditStateEnum auditState)
|
|
|
|
@@ -1757,7 +1825,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|
|
|
|
/// <param name="setOrCancel"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPut("{trialId:guid}/{subjectVisitId:guid}/{setOrCancel:bool}")]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
//[Authorize(Policy = IRaCISPolicy.IQC)]
|
|
|
|
|
public async Task<IResponseOutput> SetVisitUrgent(Guid trialId, Guid subjectVisitId, bool setOrCancel)
|
|
|
|
|
{
|
|
|
|
@@ -1795,7 +1863,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|
|
|
|
/// <param name="qcChallengeId"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPut("{trialId:guid}/{subjectVisitId:guid}/{qcChallengeId:guid}")]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
//[Authorize(Policy = IRaCISPolicy.IQC)]
|
|
|
|
|
public async Task<IResponseOutput> SetNeedReupload(Guid trialId, Guid qcChallengeId)
|
|
|
|
|
{
|
|
|
|
@@ -1896,7 +1964,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
//[Authorize(Policy = IRaCISPolicy.CRC)]
|
|
|
|
|
public async Task<IResponseOutput> SetReuploadFinished(CRCReuploadFinishedCommand cRCReuploadFinishedCommand)
|
|
|
|
|
{
|
|
|
|
@@ -2009,7 +2077,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[HttpPut("{trialId:guid}/{subjectVisitId:guid}/{qcChallengeId:guid}")]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
//[Authorize(Policy = IRaCISPolicy.CRC)]
|
|
|
|
|
public async Task<IResponseOutput> CRCRequestReUpload(Guid qcChallengeId)
|
|
|
|
|
{
|
|
|
|
@@ -2056,7 +2124,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
|
|
[HttpPut("{trialId:guid}")]
|
|
|
|
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
|
|
|
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
|
|
|
|
public async Task<IResponseOutput> UpdateSubjectAndSVInfo(UploadSubjectAndVisitCommand command)
|
|
|
|
|
{
|
|
|
|
|
var dbSubjectVisit = (await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == command.SubjectVisitId)).IfNullThrowException();
|
|
|
|
|