diff --git a/IRaCIS.Core.API/Controllers/InspectionController.cs b/IRaCIS.Core.API/Controllers/InspectionController.cs index ee07f13c4..9c3937d98 100644 --- a/IRaCIS.Core.API/Controllers/InspectionController.cs +++ b/IRaCIS.Core.API/Controllers/InspectionController.cs @@ -54,6 +54,7 @@ namespace IRaCIS.Core.API.Controllers ITrialConfigService _trialConfigService, INoneDicomStudyService noneDicomStudyService, ISubjectService _subjectService, + ISubjectVisitService subjectVisitService, IQCOperationService qCOperationService, IClinicalDataService clinicalDataService, @@ -88,8 +89,26 @@ namespace IRaCIS.Core.API.Controllers return await _inspectionService.GetInspectionData(dto); } + #region 影像质疑 + /// + /// 手动领取 或者取消 QC任务 + /// + /// + /// + [HttpPost, Route("Inspection/QCOperation/ObtainOrCancelQCTask")] + [UnitOfWork] + public async Task ObtainOrCancelQCTask(DataInspectionDto opt) + { + var fun = await _qCOperationService.ObtainOrCancelQCTask(opt.OptCommand.trialId, opt.OptCommand.subjectVisitId, opt.OptCommand.obtaionOrCancel); + if (!fun.IsSuccess) + { + return ResponseOutput.NotOk(fun.ErrorMessage); + } + return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, null, fun); + } - #region Qc + #endregion + #region 影像上传 /// @@ -195,9 +214,7 @@ namespace IRaCIS.Core.API.Controllers return await _inspectionService.Enforcement(opt.OptCommand.Id, opt.AuditInfo, opt.SignInfo, fun); } - #endregion - #region 临床数据采集 ClinicalDataService /// /// 新增或修改既往放疗史 @@ -291,8 +308,6 @@ namespace IRaCIS.Core.API.Controllers return await _inspectionService.Enforcement(opt.OptCommand.Id, opt.AuditInfo, opt.SignInfo, fun); } #endregion - - #region 访视计划 /// /// 新增或添加访视计划 diff --git a/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs b/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs index d4509caaf..54ccf1302 100644 --- a/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs +++ b/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs @@ -160,6 +160,13 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO #endregion + public class ObtainOrCancelQCTaskDto + { + public Guid trialId { get; set; } + public Guid subjectVisitId { get; set; } + public bool obtaionOrCancel { get; set; } + } + public class DataInspectionDto : IInspectionDTO, ISignDTO { diff --git a/IRaCIS.Core.Application/Service/Visit/SubjectService.cs b/IRaCIS.Core.Application/Service/Visit/SubjectService.cs index e6bfe167a..bee832a02 100644 --- a/IRaCIS.Core.Application/Service/Visit/SubjectService.cs +++ b/IRaCIS.Core.Application/Service/Visit/SubjectService.cs @@ -266,6 +266,26 @@ namespace IRaCIS.Application.Services var isSuccess = await _subjectRepository.DeleteFromQueryAsync(u => u.Id == id); await _repository.DeleteFromQueryAsync(u => u.SubjectId == id); + var subvisit = await _repository.GetQueryable().Where(x=>x.SubjectId==id).ToListAsync(); + + List datas = new List(); + + foreach (var item in subvisit) + { + datas.Add(new DataInspection() + { + SiteId = item.SiteId, + SubjectId = item.SubjectId, + TrialId = item.TrialId, + SubjectVisitId = item.Id, + Identification = "Delete|Visit|Data|Visit-Image Upload", + JsonDetail = JsonConvert.SerializeObject(item) + }); + }; + + + + await _inspectionService.AddListInspectionRecordAsync(datas); return ResponseOutput.Result(isSuccess); }