调整验证接口
parent
c7236ebc95
commit
cade8350b7
|
@ -164,7 +164,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
throw new BusinessValidationFailedException("CRC申请重传的/QC同意重传的质疑,在CRC设置重传完成前不允许关闭质疑");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region 之前
|
||||
|
@ -840,7 +840,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
/// <returns></returns>
|
||||
[HttpPut("{trialId:guid}/{subjectVisitId:guid}/{id:guid}/{type:int}")]
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
public async Task<IResponseOutput> UpdateModality(Guid id, Guid subjectVisitId, int type, [FromQuery] string modality, [FromQuery] string bodyPart)
|
||||
public async Task<IResponseOutput> UpdateModality(Guid id, Guid subjectVisitId, int type, [FromQuery] string modality, [FromQuery] string bodyPart)
|
||||
{
|
||||
|
||||
var DicomSeriesdata = await _repository.GetQueryable<DicomSeries>().Where(x => x.StudyId == id).ToListAsync();
|
||||
|
@ -1116,7 +1116,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
|
||||
var dbSubjectVisit = (await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId)).IfNullThrowException();
|
||||
|
||||
|
||||
|
||||
var trialConfig = await _trialRepository
|
||||
.Select(t => new { TrialId = t.Id, t.QCProcessEnum, t.IsImageConsistencyVerification })
|
||||
.FirstOrDefaultAsync(t => t.TrialId == trialId)
|
||||
|
@ -1259,6 +1259,42 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
}
|
||||
|
||||
|
||||
|
||||
[HttpGet("{subjectVisitId:guid}")]
|
||||
public async Task<IResponseOutput> VerifyCRCRequestToQC(CRCRequestToQCCommand cRCRequestToQCCommand)
|
||||
{
|
||||
var dbSubjectVisitList = await _subjectVisitRepository.Where(t => cRCRequestToQCCommand.SubjectVisitIds.Contains(t.Id), true).ToListAsync();
|
||||
|
||||
//普通提交
|
||||
if (dbSubjectVisitList.Count() == 1)
|
||||
{
|
||||
var sv = dbSubjectVisitList[0];
|
||||
|
||||
var existObj = await _subjectVisitRepository.FirstOrDefaultAsync(t => t.SubmitState != SubmitStateEnum.Submitted && t.VisitNum < sv.VisitNum);
|
||||
|
||||
if (sv.PDState == PDStateEnum.PDProgress)
|
||||
{
|
||||
|
||||
if (existObj != null)
|
||||
{
|
||||
return ResponseOutput.NotOk($"系统检测发现该受试者当前访视之前的访视:{existObj.VisitName},未提交,疾病进展确认对阅片时限要求很高,请将上述访视提交或标记失访后,再提交当前访视!", ApiResponseCodeEnum.BusinessValidationFailed);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (existObj != null)
|
||||
{
|
||||
|
||||
return ResponseOutput.NotOk($"系统检测发现该受试者当前访视之前的访视:{existObj.VisitName},未提交。请尽快完成上述访视的影像上传和提交!", ApiResponseCodeEnum.NeedTips);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// CRC RequestToQC 批量提交
|
||||
/// </summary>
|
||||
|
@ -1267,11 +1303,10 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
public async Task<IResponseOutput> CRCRequestToQC(CRCRequestToQCCommand cRCRequestToQCCommand)
|
||||
{
|
||||
var trialConfig = await _trialRepository
|
||||
var trialConfig = (await _trialRepository
|
||||
.Select(t => new { TrialId = t.Id, t.QCProcessEnum, t.IsImageConsistencyVerification, t.IsUrgent, t.IsHaveFirstGiveMedicineDate, t.ClinicalInformationTransmissionEnum })
|
||||
.FirstOrDefaultAsync(t => t.TrialId == cRCRequestToQCCommand.TrialId);
|
||||
.FirstOrDefaultAsync(t => t.TrialId == cRCRequestToQCCommand.TrialId)).IfNullThrowException();
|
||||
|
||||
if (trialConfig == null) return Null404NotFound(trialConfig);
|
||||
|
||||
var dbSubjectVisitList = await _subjectVisitRepository.Where(t => cRCRequestToQCCommand.SubjectVisitIds.Contains(t.Id), true).Include(t => t.Subject).ToListAsync();
|
||||
|
||||
|
@ -1411,7 +1446,6 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
/// </summary>
|
||||
/// <param name="trialId"></param>
|
||||
/// <param name="subjectVisitId"></param>
|
||||
/// <param name="signId"></param>
|
||||
/// <param name="auditState"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("{trialId:guid}/{subjectVisitId:guid}/{auditState:int}")]
|
||||
|
@ -1431,7 +1465,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
return ResponseOutput.NotOk("有质疑未关闭,不允许该操作");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
var trialConfig = await _trialRepository
|
||||
.Select(t => new { TrialId = t.Id, t.QCProcessEnum, t.IsImageConsistencyVerification })
|
||||
|
@ -1944,24 +1978,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 验证QC是否可以操作 数据库查询判断当前QC执行人和登陆的用户是否一致
|
||||
/// </summary>
|
||||
/// <param name="subjectVisitId"></param>
|
||||
/// <returns></returns>
|
||||
private async Task<IResponseOutput> VerifyQCCanOpt(Guid subjectVisitId)
|
||||
{
|
||||
var optUser = await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).FirstOrDefaultAsync();
|
||||
|
||||
if (optUser == null) return Null404NotFound(optUser);
|
||||
|
||||
if (optUser.CurrentActionUserId != _userInfo.Id)
|
||||
{
|
||||
return ResponseOutput.NotOk("其他QC正在进行审核,当前操作不允许");
|
||||
}
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue