diff --git a/IRaCIS.Core.API/Controllers/InspectionController.cs b/IRaCIS.Core.API/Controllers/InspectionController.cs index 066a595e0..073fc6b0c 100644 --- a/IRaCIS.Core.API/Controllers/InspectionController.cs +++ b/IRaCIS.Core.API/Controllers/InspectionController.cs @@ -319,16 +319,16 @@ namespace IRaCIS.Core.API.Controllers } - /// - /// QC修改检查部位和 拍片类型 - /// - [HttpPost, Route("Inspection/QCOperation/UpdateModality")] - [UnitOfWork] - public async Task UpdateModality(DataInspectionDto opt) - { - var fun = await _qCOperationService.UpdateModality(opt.OptCommand.id, (Guid)opt.AuditInfo.SubjectVisitId, opt.OptCommand.type, opt.OptCommand.modality, opt.OptCommand.bodyPart); - return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, null, fun); - } + ///// + ///// QC修改检查部位和 拍片类型 + ///// + //[HttpPost, Route("Inspection/QCOperation/UpdateModality")] + //[UnitOfWork] + //public async Task UpdateModality(DataInspectionDto opt) + //{ + // var fun = await _qCOperationService.UpdateModality(opt.OptCommand.id, (Guid)opt.AuditInfo.SubjectVisitId, opt.OptCommand.type, opt.OptCommand.modality, opt.OptCommand.bodyPart); + // return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, null, fun); + //} /// /// 1、设置为不读片,2 设置为读片(取消 先前设置为不读片) 4 设置为删除(数据库记录软删除) 5 恢复为未删除 diff --git a/IRaCIS.Core.API/IRaCIS.Core.API.xml b/IRaCIS.Core.API/IRaCIS.Core.API.xml index a07fa4e2c..8b74bd9fc 100644 --- a/IRaCIS.Core.API/IRaCIS.Core.API.xml +++ b/IRaCIS.Core.API/IRaCIS.Core.API.xml @@ -146,11 +146,6 @@ 一致性核查 回退 对话记录不清除 只允许PM回退 - - - QC修改检查部位和 拍片类型 - - 1、设置为不读片,2 设置为读片(取消 先前设置为不读片) 4 设置为删除(数据库记录软删除) 5 恢复为未删除 diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 24c429f08..2ae931076 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -1563,15 +1563,10 @@ - + type 1 :study 2: series 3:非dicom QC修改检查部位和 拍片类型 - - - - - diff --git a/IRaCIS.Core.Application/Service/QC/DTO/QARecordViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/QARecordViewModel.cs index 6f5ef8232..becd4c7e9 100644 --- a/IRaCIS.Core.Application/Service/QC/DTO/QARecordViewModel.cs +++ b/IRaCIS.Core.Application/Service/QC/DTO/QARecordViewModel.cs @@ -37,6 +37,18 @@ namespace IRaCIS.Core.Application.Contracts.DTO } + public class UpdateModalityCommand + { + public Guid Id { get; set; } + public Guid SubjectVisitId { get; set; } + + public int Type { get; set; } + + public string Modality { get; set; } = String.Empty; + + public string BodyPart { get; set; } = String.Empty; + + } public class QCQuestionAnswerCommand { diff --git a/IRaCIS.Core.Application/Service/QC/Interface/IQCOperationService.cs b/IRaCIS.Core.Application/Service/QC/Interface/IQCOperationService.cs index f017f1786..e60f66483 100644 --- a/IRaCIS.Core.Application/Service/QC/Interface/IQCOperationService.cs +++ b/IRaCIS.Core.Application/Service/QC/Interface/IQCOperationService.cs @@ -34,7 +34,7 @@ namespace IRaCIS.Core.Application.Image.QA Task SetReuploadFinished(CRCReuploadFinishedCommand cRCReuploadFinishedCommand); Task SetSeriesState(Guid subjectVisitId, Guid studyId, Guid seriesId, int state); Task SetVisitUrgent(Guid trialId, Guid subjectVisitId, bool setOrCancel); - Task UpdateModality(Guid id, Guid subjectVisitId, int type, [FromQuery] string modality, [FromQuery] string bodyPart); + Task UpdateModality(UpdateModalityCommand updateModalityCommand); Task UpdateSubjectAndSVInfo(UploadSubjectAndVisitCommand command); Task UploadVisitCheckExcel(IFormFile file, Guid trialId); Task VerifyCanQCPassedOrFailed(Guid subjectVisitId); diff --git a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs index b4f2b948b..4cda42aa1 100644 --- a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs @@ -784,46 +784,40 @@ namespace IRaCIS.Core.Application.Image.QA /// ///type 1 :study 2: series 3:非dicom QC修改检查部位和 拍片类型 /// - /// - /// - /// - /// - /// /// - [HttpPut("{trialId:guid}/{subjectVisitId:guid}/{id:guid}/{type:int}")] + [HttpPost("{trialId:guid}")] [TypeFilter(typeof(TrialResourceFilter))] - public async Task UpdateModality(Guid id, Guid subjectVisitId, int type, string modality, string bodyPart) + public async Task UpdateModality(UpdateModalityCommand updateModalityCommand) { - await VerifyIsCanQCAsync(null, subjectVisitId); + await VerifyIsCanQCAsync(null, updateModalityCommand.SubjectVisitId); - var DicomSeriesdata = await _repository.GetQueryable().Where(x => x.StudyId == id).ToListAsync(); - var study = await _repository.FirstOrDefaultAsync(t => t.Id == id); DateTime time = DateTime.Now.AddMilliseconds(500); - if (type == 1) + if (updateModalityCommand.Type == 1) { - if (study == null) return Null404NotFound(study); + var studyId = updateModalityCommand.Id; + var study = (await _repository.FirstOrDefaultAsync(t => t.Id == studyId)).IfNullThrowException(); - study.BodyPartForEdit = bodyPart; - study.Modalities = modality; - await _repository.BatchUpdateAsync(t => t.StudyId == id, r => new DicomSeries() { BodyPartForEdit = bodyPart, Modality = modality }); + + study.BodyPartForEdit = updateModalityCommand.BodyPart; + study.Modalities = updateModalityCommand.Modality; + await _repository.BatchUpdateAsync(t => t.StudyId == studyId, r => new DicomSeries() { BodyPartForEdit = updateModalityCommand.BodyPart, Modality = updateModalityCommand.Modality }); } - else if (type == 2) + else if (updateModalityCommand.Type == 2) { - var series = await _repository.FirstOrDefaultAsync(t => t.Id == id); - if (series == null) return Null404NotFound(series); - series.BodyPartForEdit = bodyPart; + + var seriesId = updateModalityCommand.Id; + var series = (await _repository.FirstOrDefaultAsync(t => t.Id == seriesId)).IfNullThrowException(); + series.BodyPartForEdit = updateModalityCommand.BodyPart; } - else if (type == 3) + else if (updateModalityCommand.Type == 3) { } - // 移动不进去 - //await _trialRepository.AddListInspectionRecordAsync(datas); await _repository.SaveChangesAsync(); return ResponseOutput.Ok(); }