Merge branch 'Test_IRC_Net8' of http://192.168.3.68:2000/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
f92ace1894
|
@ -259,7 +259,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.ProjectTo<TaskMedicalReviewView>(_mapper.ConfigurationProvider);
|
||||
|
||||
|
||||
var defalutSortArray = new string[] { nameof(TaskMedicalReviewView.AuditState), nameof(TaskMedicalReviewView.SubjectId), nameof(TaskMedicalReviewView.ArmEnum), nameof(TaskMedicalReviewView.VisitTaskNum) };
|
||||
var defalutSortArray = new string[] { nameof(TaskMedicalReviewView.SubjectId), nameof(TaskMedicalReviewView.ArmEnum), nameof(TaskMedicalReviewView.VisitTaskNum) };
|
||||
var pageList = await taskMedicalReviewQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
|
||||
|
||||
return ResponseOutput.Ok(pageList, new
|
||||
|
|
|
@ -1107,8 +1107,19 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
}
|
||||
|
||||
public class GetNextCRCChallengeInDto
|
||||
{
|
||||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public class ChallengeQuery : PageInput
|
||||
/// <summary>
|
||||
/// QCChallengeId
|
||||
/// </summary>
|
||||
public Guid QCChallengeId { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class ChallengeQuery : PageInput
|
||||
{
|
||||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
|
|
|
@ -9,6 +9,7 @@ using IRaCIS.Application.Contracts;
|
|||
using IRaCIS.Core.Application.ViewModel;
|
||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||
using static Org.BouncyCastle.Math.EC.ECCurve;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
|
||||
namespace IRaCIS.Core.Application.Image.QA
|
||||
{
|
||||
|
@ -87,14 +88,69 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// CRC 质疑列表
|
||||
/// 获取下一个crc的未关闭的质疑
|
||||
/// </summary>
|
||||
/// <param name="challengeQuery"></param>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="BusinessValidationFailedException"></exception>
|
||||
[HttpPost]
|
||||
public async Task<QCCRCChallengeViewModel> GetNextCRCChallenge(GetNextCRCChallengeInDto inDto)
|
||||
{
|
||||
var list =await GetCRCChallengeList(new ChallengeQuery()
|
||||
{
|
||||
TrialId = inDto.TrialId,
|
||||
PageIndex = 1,
|
||||
PageSize = 9999
|
||||
});
|
||||
|
||||
var pageList = list.Item1.CurrentPageData.ToList();
|
||||
|
||||
|
||||
var data = pageList.Where(x=>x.Id==inDto.QCChallengeId||x.IsClosed==false).ToList();
|
||||
|
||||
if (data.Count > 0)
|
||||
{
|
||||
|
||||
var index = data.ToList().FindIndex(x => x.Id == inDto.QCChallengeId);
|
||||
|
||||
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();
|
||||
|
||||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["QCList_CRCFinishChallenge"]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// CRC 质疑列表
|
||||
/// </summary>
|
||||
/// <param name="challengeQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<(PageOutput<QCCRCChallengeViewModel>, TrialSubjectAndSVConfig)> GetCRCChallengeList(ChallengeQuery challengeQuery)
|
||||
{
|
||||
|
||||
|
@ -117,7 +173,7 @@ 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 query2.ToPagedListAsync(challengeQuery.PageIndex, challengeQuery.PageSize, challengeQuery.SortField, challengeQuery.Asc, string.IsNullOrWhiteSpace(challengeQuery.SortField), new string[] { "IsUrgent desc", "IsClosed asc" });
|
||||
var pageList = await query2.ToPagedListAsync(challengeQuery.PageIndex, challengeQuery.PageSize, challengeQuery.SortField, challengeQuery.Asc, string.IsNullOrWhiteSpace(challengeQuery.SortField), new string[] { "IsUrgent desc", "CreateTime asc" });
|
||||
|
||||
var config = await _repository.Where<Trial>(t => t.Id == challengeQuery.TrialId).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
|
||||
return (pageList, config);
|
||||
|
|
|
@ -42,7 +42,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
|
||||
public Guid TrialReadingCriterionId { get; set; }
|
||||
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid TaskMedicalReviewId { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -792,40 +792,33 @@ namespace IRaCIS.Core.Application.Service
|
|||
var list = await GetIRMedicalFeedbackList(new GetIRMedicalFeedbackListInDto()
|
||||
{
|
||||
TrialId=inDto.TrialId,
|
||||
AuditState= MedicalReviewAuditState.Auditing,
|
||||
TrialReadingCriterionId=inDto.TrialReadingCriterionId,
|
||||
SubjectId=inDto.SubjectId,
|
||||
PageIndex=1,
|
||||
PageSize=1,
|
||||
PageSize=99999,
|
||||
});
|
||||
|
||||
var index = list.CurrentPageData.ToList().FindIndex(x => x.Id == inDto.TaskMedicalReviewId);
|
||||
|
||||
if (list.CurrentPageData.Count() == 0)
|
||||
var result = new GetIRMedicalFeedbackListOutDto() { };
|
||||
|
||||
if (index + 1 == list.CurrentPageData.Count()) // 最后一个
|
||||
{
|
||||
list = await GetIRMedicalFeedbackList(new GetIRMedicalFeedbackListInDto()
|
||||
{
|
||||
TrialId = inDto.TrialId,
|
||||
AuditState = MedicalReviewAuditState.Auditing,
|
||||
TrialReadingCriterionId = inDto.TrialReadingCriterionId,
|
||||
PageIndex = 1,
|
||||
PageSize = 1,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (list.CurrentPageData.Count() > 0)
|
||||
{
|
||||
return list.CurrentPageData[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["MedicalReview_IRFinish"], ApiResponseCodeEnum.CloseCurrentWindows);
|
||||
}
|
||||
else if (index == -1 || list.CurrentPageData.Count == 1) // 第一个或者只有一个
|
||||
{
|
||||
if (list.CurrentPageData[0].Id == inDto.TaskMedicalReviewId)
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["MedicalReview_IRFinish"], ApiResponseCodeEnum.CloseCurrentWindows);
|
||||
}
|
||||
result = list.CurrentPageData[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
result = list.CurrentPageData.Skip(index + 1).Take(1).First();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in New Issue