From c5dd75e5d628dabdd46a0cc98678b5bc9df89886 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 6 May 2022 10:04:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9Subject?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/InspectionController.cs | 4 +- .../Service/Visit/SubjectService.cs | 38 ++----------------- 2 files changed, 6 insertions(+), 36 deletions(-) diff --git a/IRaCIS.Core.API/Controllers/InspectionController.cs b/IRaCIS.Core.API/Controllers/InspectionController.cs index 470076026..c9bc87ba9 100644 --- a/IRaCIS.Core.API/Controllers/InspectionController.cs +++ b/IRaCIS.Core.API/Controllers/InspectionController.cs @@ -19,8 +19,7 @@ using IRaCIS.Core.Infra.EFCore; using IRaCIS.Core.Infrastructure.Extention; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using Newtonsoft.Json; + namespace IRaCIS.Core.API.Controllers { @@ -543,6 +542,7 @@ namespace IRaCIS.Core.API.Controllers } #endregion + #region 临床数据采集 ClinicalDataService /// /// 新增或修改既往放疗史 diff --git a/IRaCIS.Core.Application/Service/Visit/SubjectService.cs b/IRaCIS.Core.Application/Service/Visit/SubjectService.cs index f9c974f29..c2d3eb25f 100644 --- a/IRaCIS.Core.Application/Service/Visit/SubjectService.cs +++ b/IRaCIS.Core.Application/Service/Visit/SubjectService.cs @@ -3,9 +3,7 @@ using IRaCIS.Application.Contracts; using IRaCIS.Core.Application.Filter; using IRaCIS.Core.Domain.Share; using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Application.Service.Inspection.Interface; -using Newtonsoft.Json; -using IRaCIS.Core.Domain.Common; + namespace IRaCIS.Application.Services { @@ -13,13 +11,11 @@ namespace IRaCIS.Application.Services public class SubjectService : BaseService, ISubjectService { private readonly IRepository _subjectRepository; - private readonly IInspectionService _inspectionService; private readonly IRepository _subjectVisitRepository; - public SubjectService(IRepository subjectRepository, IInspectionService inspectionService,IRepository subjectVisitRepository) + public SubjectService(IRepository subjectRepository,IRepository subjectVisitRepository) { _subjectRepository = subjectRepository; - _inspectionService = inspectionService; _subjectVisitRepository = subjectVisitRepository; } @@ -91,21 +87,16 @@ namespace IRaCIS.Application.Services } - [HttpPut("{trialId:guid}")] + [HttpPut] [UnitOfWork] public async Task UpdateSubjectStatus(SubjectStatusChangeCommand subjectStatusChangeCommand) { - await _subjectRepository.UpdateFromDTOAsync(subjectStatusChangeCommand, true); - return ResponseOutput.Ok(); - - } - [HttpDelete("{id:guid}/{trialId:guid}")] - [TrialAudit(AuditType.SubjectAudit, AuditOptType.DeleteSubject)] + [HttpDelete("{trialId:guid}/{id:guid}")] [TypeFilter(typeof(TrialResourceFilter))] public async Task DeleteSubject(Guid id) { @@ -118,8 +109,6 @@ namespace IRaCIS.Application.Services await _subjectRepository.DeleteFromQueryAsync(u => u.Id == id); await _subjectVisitRepository.DeleteFromQueryAsync(u => u.SubjectId == id); - - var isSuccess = await _subjectRepository.SaveChangesAsync(); @@ -176,25 +165,6 @@ namespace IRaCIS.Application.Services return query.ToList(); } - [Obsolete] - [HttpGet("{trialId:guid}/{subjectId:guid}/{finalSubjectVisitId:guid}")] - public async Task VerifySubjectFinalVisit(Guid subjectId, Guid finalSubjectVisitId) - { - - if (await _repository.AnyAsync(t => t.SubjectId == subjectId && t.IsFinalVisit)) - { - return ResponseOutput.NotOk("该受试者已经有访视设置为末次访视,不允许将该访视设置为末次访视"); - } - - var sv = (await _repository.FirstOrDefaultAsync(t => t.Id == finalSubjectVisitId)).IfNullThrowException(); - - if (await _repository.AnyAsync(t => t.SubjectId == subjectId && t.VisitNum > sv.VisitNum && t.SubmitState == SubmitStateEnum.ToSubmit)) - { - return ResponseOutput.NotOk("该受试者此访视后有影像上传,该访视不允许设置为末次访视"); - } - - return ResponseOutput.Ok(); - } } }