添加接口

Uat_Study
he 2022-04-18 14:54:14 +08:00
parent 746366a1c2
commit ab3cfd7acd
9 changed files with 199 additions and 21 deletions

View File

@ -139,11 +139,11 @@ namespace IRaCIS.Core.API.Controllers
public async Task<IResponseOutput> AddOrUpdateQCChallenge(DataInspectionDto<AddOrUpdateQCChallengeDto> opt)
{
var fun = await _qCOperationService.AddOrUpdateQCChallenge(opt.OptCommand.qaQuestionCommand, opt.OptCommand.trialId, opt.OptCommand.trialQCProcess, opt.OptCommand.currentQCType);
if (!fun.IsSuccess)
{
return ResponseOutput.NotOk(fun.ErrorMessage);
}
return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, null, fun);
opt.AuditInfo.GeneralId = fun.Id;
Dictionary<string, object> keyValuePairs = new Dictionary<string, object>();
keyValuePairs.Add("ChallengeCode", fun.ChallengeCode);
opt.AuditInfo.JsonDetail = _inspectionService.AddJsonItem(opt.AuditInfo.JsonDetail, keyValuePairs);
return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, null, ResponseOutput.Ok());
}
@ -155,6 +155,7 @@ namespace IRaCIS.Core.API.Controllers
public async Task<IResponseOutput> AddQCChallengeReply(DataInspectionDto<QADialogCommand> opt)
{
var fun = _qCOperationService.AddQCChallengeReply;
opt.AuditInfo.GeneralId = opt.OptCommand.QCChallengeId;
return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, fun);
}
@ -166,6 +167,8 @@ namespace IRaCIS.Core.API.Controllers
public async Task<IResponseOutput> CloseQCChallenge(DataInspectionDto<CloseQCChallengeDto> opt)
{
var fun = await _qCOperationService.CloseQCChallenge(opt.OptCommand.qcChallengeId, opt.OptCommand.subjectVisitId, opt.OptCommand.closeEnum, opt.OptCommand.closeReason);
opt.AuditInfo.GeneralId = opt.OptCommand.qcChallengeId;
if (!fun.IsSuccess)
{
return ResponseOutput.NotOk(fun.ErrorMessage);
@ -185,7 +188,7 @@ namespace IRaCIS.Core.API.Controllers
public async Task<IResponseOutput> DeleteQCChallenge(DataInspectionDto<IDDto> opt)
{
var fun = _qCOperationService.DeleteQCChallenge;
opt.AuditInfo.GeneralId = opt.OptCommand.Id;
return await _inspectionService.Enforcement(opt.OptCommand.Id, opt.AuditInfo, opt.SignInfo, fun);
}
@ -200,6 +203,7 @@ namespace IRaCIS.Core.API.Controllers
{
var fun = _qCOperationService.AddCheckChallengeReply;
return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, fun);
}
@ -264,6 +268,89 @@ namespace IRaCIS.Core.API.Controllers
return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo,null, fun);
}
/// <summary>
/// 1、设置为不读片2 设置为读片(取消 先前设置为不读片) 4 设置为删除(数据库记录软删除) 5 恢复为未删除
/// </summary>
[HttpPost, Route("Inspection/QCOperation/SetSeriesState")]
[UnitOfWork]
public async Task<IResponseOutput> SetSeriesState(DataInspectionDto<SetSeriesStateDto> opt)
{
var fun = await _qCOperationService.SetSeriesState(opt.OptCommand.subjectVisitId, opt.OptCommand.studyId, opt.OptCommand.seriesId, opt.OptCommand.state);
return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, null, fun);
}
/// <summary>
/// 设置QC 通过或者不通过 7:QC failed 8QC passed
/// </summary>
[HttpPost, Route("Inspection/QCOperation/QCPassedOrFailed")]
[UnitOfWork]
public async Task<IResponseOutput> QCPassedOrFailed(DataInspectionDto<QCPassedOrFailedDto> opt)
{
var fun = await _qCOperationService.QCPassedOrFailed(opt.OptCommand.trialId, opt.OptCommand.subjectVisitId, opt.OptCommand.signId, opt.OptCommand.auditState);
return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, null, fun);
}
/// <summary>
/// 设置、取消 访视紧急
/// </summary>
[HttpPost, Route("Inspection/QCOperation/SetVisitUrgent")]
[UnitOfWork]
public async Task<IResponseOutput> SetVisitUrgent(DataInspectionDto<SetVisitUrgentDto> opt )
{
var fun = await _qCOperationService.SetVisitUrgent(opt.OptCommand.trialId, opt.OptCommand.subjectVisitId, opt.OptCommand.setOrCancel);
return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, null, fun);
}
/// <summary>
/// QA设置 需要重传
/// </summary>
[HttpPost, Route("Inspection/QCOperation/SetNeedReupload")]
[UnitOfWork]
public async Task<IResponseOutput> SetNeedReupload(DataInspectionDto<SetNeedReuploadDto> opt)
{
var fun = await _qCOperationService.SetNeedReupload(opt.OptCommand.trialId, opt.OptCommand.qcChallengeId);
return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, null, fun);
}
/// <summary>
/// CRC 设置已经重传完成
/// </summary>
[HttpPost, Route("Inspection/QCOperation/SetReuploadFinished")]
[UnitOfWork]
public async Task<IResponseOutput> SetReuploadFinished(DataInspectionDto<CRCReuploadFinishedCommand> opt)
{
var fun = _qCOperationService.SetReuploadFinished;
return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, fun);
}
/// <summary>
/// CRCRequestReUpload
/// </summary>
/// <param name="opt"></param>
/// <returns></returns>
[HttpPost, Route("Inspection/QCOperation/CRCRequestReUpload")]
[UnitOfWork]
public async Task<IResponseOutput> CRCRequestReUpload(DataInspectionDto<IDDto> opt)
{
var fun = _qCOperationService.CRCRequestReUpload;
return await _inspectionService.Enforcement(opt.OptCommand.Id, opt.AuditInfo, opt.SignInfo, fun);
}
/// <summary>
///
/// </summary>
/// <param name="opt"></param>
/// <returns></returns>
[HttpPost, Route("Inspection/QCOperation/ForwardSVDicomImage")]
[UnitOfWork]
public async Task<IResponseOutput> ForwardSVDicomImage(DataInspectionDto<ForwardSVDicomImageDto> opt)
{
var fun = _qCOperationService.ForwardSVDicomImage;
return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, fun);
}
#endregion
#region 影像上传

View File

@ -126,6 +126,45 @@
QC修改检查部位和 拍片类型
</summary>
</member>
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.SetSeriesState(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.Service.Inspection.DTO.SetSeriesStateDto})">
<summary>
1、设置为不读片2 设置为读片(取消 先前设置为不读片) 4 设置为删除(数据库记录软删除) 5 恢复为未删除
</summary>
</member>
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.QCPassedOrFailed(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.Service.Inspection.DTO.QCPassedOrFailedDto})">
<summary>
设置QC 通过或者不通过 7:QC failed 8QC passed
</summary>
</member>
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.SetVisitUrgent(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.Service.Inspection.DTO.SetVisitUrgentDto})">
<summary>
设置、取消 访视紧急
</summary>
</member>
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.SetNeedReupload(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.Service.Inspection.DTO.SetNeedReuploadDto})">
<summary>
QA设置 需要重传
</summary>
</member>
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.SetReuploadFinished(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.Contracts.CRCReuploadFinishedCommand})">
<summary>
CRC 设置已经重传完成
</summary>
</member>
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.CRCRequestReUpload(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.Contracts.IDDto})">
<summary>
CRCRequestReUpload
</summary>
<param name="opt"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.ForwardSVDicomImage(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.Contracts.ForwardSVDicomImageDto})">
<summary>
</summary>
<param name="opt"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.UpdateSubjectAndSVInfo(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.Contracts.UploadSubjectAndVisitCommand})">
<summary>
疾病进展确认评估

View File

@ -1527,7 +1527,7 @@
<param name="setOrCancel"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Image.QA.QCOperationService.SetNeedReupload(System.Guid,System.Guid,System.Guid)">
<member name="M:IRaCIS.Core.Application.Image.QA.QCOperationService.SetNeedReupload(System.Guid,System.Guid)">
<summary>
QA设置 需要重传
</summary>

View File

@ -169,6 +169,36 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
public string closeReason { get; set; }
}
public class SetNeedReuploadDto
{
public Guid trialId { get; set; }
public Guid qcChallengeId { get; set; }
}
public class SetVisitUrgentDto
{
public Guid trialId { get; set; }
public Guid subjectVisitId { get; set; }
public bool setOrCancel { get; set; }
}
public class QCPassedOrFailedDto
{
public Guid trialId { get; set; }
public Guid subjectVisitId { get; set; }
public Guid signId { get; set; }
public AuditStateEnum auditState { get; set; }
}
public class SetSeriesStateDto
{
public Guid subjectVisitId { get; set; }
public Guid studyId { get; set; }
public Guid seriesId { get; set; }
public int state { get; set; }
}
public class UpdateModalityDto
{
public Guid id { get; set; }

View File

@ -11,7 +11,7 @@ namespace IRaCIS.Core.Application.Image.QA
public interface IQCOperationService
{
Task<IResponseOutput> CheckBack(Guid subjectVisitId);
Task<IResponseOutput> SetNeedReupload(Guid trialId, Guid signId, Guid qcChallengeId);
Task<IResponseOutput> SetNeedReupload(Guid trialId, Guid qcChallengeId);
Task<IResponseOutput> QCPassedOrFailed(Guid trialId, Guid subjectVisitId, Guid signId, [FromRoute] AuditStateEnum auditState);
Task<IResponseOutput> SetCheckPass(Guid subjectVisitId);
@ -19,7 +19,7 @@ namespace IRaCIS.Core.Application.Image.QA
Task<IResponseOutput<CheckChallengeDialog>> AddCheckChallengeReply(CheckChallengeDialogCommand checkDialogCommand);
Task<IResponseOutput> AddOrUpdateQCChallenge(QCChallengeCommand qaQuestionCommand, Guid trialId, [FromRoute] TrialQCProcess trialQCProcess, [FromRoute] CurrentQC currentQCType);
Task<QCChallenge> AddOrUpdateQCChallenge(QCChallengeCommand qaQuestionCommand, Guid trialId, [FromRoute] TrialQCProcess trialQCProcess, [FromRoute] CurrentQC currentQCType);
Task<IResponseOutput> AddOrUpdateQCQuestionAnswerList(QCQuestionAnswerCommand[] qcQuestionAnswerCommands, Guid trialId, Guid subjectVisitId, [FromRoute] TrialQCProcess trialQCProcess, [FromRoute] CurrentQC currentQCType);
Task<IResponseOutput> AddQCChallengeReply(QADialogCommand qaDialogCommand);
Task<IResponseOutput> CloseCheckChallenge(Guid subjectVisitId);
@ -37,5 +37,7 @@ namespace IRaCIS.Core.Application.Image.QA
Task<IResponseOutput> UpdateSubjectAndSVInfo(UploadSubjectAndVisitCommand command);
Task<IResponseOutput> UploadVisitCheckExcel(IFormFile file, [FromServices] IMediator _mediator, Guid trialId, [FromServices] IWebHostEnvironment _hostEnvironment);
Task<IResponseOutput> VerifyCanQCPassedOrFailed(Guid subjectVisitId);
Task<IResponseOutput> ForwardSVDicomImage(Guid[] subjectVisitIdList);
}
}

View File

@ -21,6 +21,7 @@ using Magicodes.ExporterAndImporter.Excel;
using Newtonsoft.Json;
using Magicodes.ExporterAndImporter.Csv;
using IRaCIS.Core.Application.Service.Inspection.Interface;
using IRaCIS.Core.Infrastructure;
namespace IRaCIS.Core.Application.Image.QA
{
@ -74,14 +75,15 @@ namespace IRaCIS.Core.Application.Image.QA
[HttpPost("{trialId:guid}/{trialQCProcess:int}/{currentQCType:int}")]
[TypeFilter(typeof(TrialResourceFilter))]
[Authorize(Policy = "ImageQCPolicy")]
public async Task<IResponseOutput> AddOrUpdateQCChallenge(QCChallengeCommand qaQuestionCommand, Guid trialId, [FromRoute] TrialQCProcess trialQCProcess, [FromRoute] CurrentQC currentQCType)
public async Task<QCChallenge> AddOrUpdateQCChallenge(QCChallengeCommand qaQuestionCommand, Guid trialId, [FromRoute] TrialQCProcess trialQCProcess, [FromRoute] CurrentQC currentQCType)
{
if (qaQuestionCommand.Id == null)
{
if (await _repository.AnyAsync<QCChallenge>(t => t.IsClosed == false && t.SubjectVisitId == qaQuestionCommand.SubjectVisitId && t.ReuploadEnum == QCChanllengeReuploadEnum.QCAgreeUpload))
{
return ResponseOutput.NotOk("当前访视有未关闭的 同意CRC上传的质疑不允许再次添加质疑");
throw new BusinessValidationFailedException("当前访视有未关闭的 同意CRC上传的质疑不允许再次添加质疑");
}
QCChallenge? qcChallenge = null;
@ -90,7 +92,10 @@ namespace IRaCIS.Core.Application.Image.QA
{
var trialConfig = _repository.Where<Trial>(t => t.Id == trialId).Select(t => new { TrialId = t.Id, t.QCProcessEnum, t.IsImageConsistencyVerification }).FirstOrDefault();
if (trialConfig == null) return Null404NotFound(trialConfig);
if (trialConfig == null)
{
throw new BusinessValidationFailedException("项目不存在");
}
#region 处理访视状态变更
//var dbSubjectVisit = _subjectVisitRepository.FirstOrDefault(t => t.Id == qaQuestionCommand.SubjectVisitId);
@ -148,7 +153,7 @@ namespace IRaCIS.Core.Application.Image.QA
//分开两个事务 处理访视质疑状态
await DealChallengeState(qcChallenge.SubjectVisitId);
return ResponseOutput.Result(success, qcChallenge.Id);
return qcChallenge;
#region 添加的时候把记录给留存
//var templateItems = _mapper.Map<List<QARecordTemplateItemDetail>>(visitQaCommand.QATrialTemplateItemList);
@ -173,7 +178,10 @@ namespace IRaCIS.Core.Application.Image.QA
var qcChallenge = await _repository.FirstOrDefaultAsync<QCChallenge>(t => t.Id == qaQuestionCommand.Id);
if (qcChallenge == null) return Null404NotFound(qcChallenge);
if (qcChallenge == null)
{
throw new BusinessValidationFailedException("QC问题不存在");
};
_mapper.Map(qaQuestionCommand, qcChallenge);
@ -182,7 +190,7 @@ namespace IRaCIS.Core.Application.Image.QA
await DealChallengeState(qcChallenge.SubjectVisitId);
return ResponseOutput.Result(success);
return qcChallenge;
}
@ -1579,7 +1587,7 @@ namespace IRaCIS.Core.Application.Image.QA
/// <returns></returns>
[HttpPut("{trialId:guid}/{qcChallengeId:guid}/{signId:guid}")]
[TypeFilter(typeof(TrialResourceFilter))]
public async Task<IResponseOutput> SetNeedReupload(Guid trialId, Guid signId, Guid qcChallengeId)
public async Task<IResponseOutput> SetNeedReupload(Guid trialId, Guid qcChallengeId)
{
if (_userInfo.UserTypeEnumInt != (int)UserTypeEnum.IQC)
{
@ -1654,9 +1662,9 @@ namespace IRaCIS.Core.Application.Image.QA
var success = await _repository.SaveChangesAsync();
var signSuccess = await _repository.UpdateFromQueryAsync<TrialSign>(t => t.Id == signId, u => new TrialSign() { IsCompleted = true });
//var signSuccess = await _repository.UpdateFromQueryAsync<TrialSign>(t => t.Id == signId, u => new TrialSign() { IsCompleted = true });
return ResponseOutput.Result(success && signSuccess);
return ResponseOutput.Result(success);
}
@ -1817,6 +1825,7 @@ namespace IRaCIS.Core.Application.Image.QA
SiteId = data.SiteId,
TrialId = data.TrialId,
IsSign = false,
Identification= "Edit|Subject|Info|Subject",
CreateTime =DateTime.Now.AddSeconds(1),
JsonDetail = JsonConvert.SerializeObject(new
{
@ -1863,7 +1872,7 @@ namespace IRaCIS.Core.Application.Image.QA
[HttpPost("{trialId:guid}")]
public async Task<IResponseOutput> ForwardSVDicomImage(Guid[] subjectVisitIdList, [FromServices] DicomFileStoreHelper _dicomFileStoreHelper)
public async Task<IResponseOutput> ForwardSVDicomImage(Guid[] subjectVisitIdList)
{
foreach (var subjectVisitId in subjectVisitIdList)

View File

@ -45,6 +45,7 @@ namespace IRaCIS.Core.Application.Contracts
}
public class IDDto
{
public Guid Id { get; set; }
@ -110,6 +111,11 @@ namespace IRaCIS.Core.Application.Contracts
}
public class ForwardSVDicomImageDto
{
public Guid[] subjectVisitIdList { get; set; }
}
public class SubjectVisitSearchDTO : PageInput
{
public string SubjectInfo { get; set; } = String.Empty;

View File

@ -130,6 +130,7 @@ namespace IRaCIS.Core.Application.Services
SiteId = subject.SiteId,
TrialId = subject.TrialId,
IsSign = false,
Identification= "Edit|Subject|Info|Subject",
CreateTime = DateTime.Now.AddSeconds(1),
JsonDetail = JsonConvert.SerializeObject(new
{

View File

@ -556,11 +556,12 @@ namespace IRaCIS.Application.Services
Identification = "Add|Visit|Info|Visit-Image Upload",
JsonDetail = JsonConvert.SerializeObject(new
{
IsBaseLine = x.BlindName,
IsBaseLine = x.IsBaseLine,
VisitName = x.VisitName,
VisitNum = x.VisitNum,
VisitDay = x.VisitDay,
VisitExecuted=false,
BlindName=x.BlindName,
VisitWindowLeft = x.VisitWindowLeft,
VisitWindowRight = x.VisitWindowRight,
IsEnrollment=y.IsEnrollment,
@ -577,15 +578,18 @@ namespace IRaCIS.Application.Services
TrialId = x.TrialId,
SubjectCode = y.Code,
BlindName = x.BlindName,
SubjectVisitName = x.VisitName,
IsSign = false,
CreateTime = createtime.AddMilliseconds(500),
Identification = "Init|Visit|Status|Visit-Image Upload",
JsonDetail = JsonConvert.SerializeObject(new
{
BlindName = x.BlindName,
VisitName = x.VisitName,
SubmitState = "",
AuditState = "",
IsBaseLine = x.IsBaseLine,
IsEnrollment = y.IsEnrollment,
IsUrgent = y.IsUrgent,
})