From 977d83924d099fa55314ea8eace10b98830cbbbc Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Tue, 12 Apr 2022 10:37:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0Dicom=E5=BD=B1=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/StudyController.cs | 12 ++++++-- .../Service/ImageAndDoc/StudyService.cs | 30 +++++++++++++++++-- .../Service/Visit/DTO/VisitPointViewModel.cs | 6 ++++ 3 files changed, 43 insertions(+), 5 deletions(-) diff --git a/IRaCIS.Core.API/Controllers/StudyController.cs b/IRaCIS.Core.API/Controllers/StudyController.cs index 87ad8c7a2..50db859fb 100644 --- a/IRaCIS.Core.API/Controllers/StudyController.cs +++ b/IRaCIS.Core.API/Controllers/StudyController.cs @@ -18,6 +18,9 @@ using EasyCaching.Core; using IRaCIS.Core.Infra.EFCore; using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Domain.Models; +using IRaCIS.Core.Application.Service.Inspection.Interface; +using Newtonsoft.Json; +using IRaCIS.Core.Application.Service.Inspection.DTO; namespace IRaCIS.Api.Controllers { @@ -31,7 +34,7 @@ namespace IRaCIS.Api.Controllers private readonly IStudyService _studyService; private readonly IDicomArchiveService _dicomArchiveService; private readonly ILogger _logger; - + private readonly IInspectionService _inspectionService; private IEasyCachingProvider _provider; private IUserInfo _userInfo; private static object _locker = new object(); @@ -40,6 +43,7 @@ namespace IRaCIS.Api.Controllers public StudyController(IStudyService studyService, IDicomArchiveService dicomArchiveService, ILogger logger, + IInspectionService inspectionService, IEasyCachingProvider provider, IUserInfo userInfo ) { @@ -48,7 +52,7 @@ namespace IRaCIS.Api.Controllers _studyService = studyService; _dicomArchiveService = dicomArchiveService; _logger = logger; - + this._inspectionService = inspectionService; } @@ -63,6 +67,8 @@ namespace IRaCIS.Api.Controllers [TypeFilter(typeof(TrialResourceFilter))] public async Task ArchiveStudy([FromForm] ArchiveStudyCommand archiveStudyCommand) { + + //Stopwatch sw = new Stopwatch(); var startTime = DateTime.Now; //sw.Start(); @@ -205,6 +211,8 @@ namespace IRaCIS.Api.Controllers return ResponseOutput.NotOk("未完成该检查的归档", archiveResult); } + await _inspectionService.AddInspectionRecordAsync(JsonConvert.DeserializeObject(archiveStudyCommand.AuditInfo)) + return ResponseOutput.Ok(archiveResult); } diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs index 0890e9da7..f2a50de8f 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs @@ -5,6 +5,9 @@ using IRaCIS.Core.Infra.EFCore; using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Application.Contracts; +using IRaCIS.Core.Application.Service.Inspection.Interface; +using IRaCIS.Core.Application.Service.Inspection.DTO; +using Newtonsoft.Json; namespace IRaCIS.Application.Services { @@ -16,7 +19,7 @@ namespace IRaCIS.Application.Services private readonly IRepository _subjectVisitRepository; private readonly IRepository _dicomInstanceRepository; private readonly IRepository _dicomSeriesRepository; - + private readonly IInspectionService _inspectionService; private readonly IUserInfo _userInfo; private readonly IMapper _mapper; @@ -34,7 +37,7 @@ namespace IRaCIS.Application.Services IRepository subjectVisitRepository, IRepository dicomInstanceRepository, IRepository dicomSeriesRepository, - + IInspectionService inspectionService, IUserInfo userInfo, IRepository dicomStudyMonitorRepository, @@ -50,6 +53,7 @@ namespace IRaCIS.Application.Services _subjectVisitRepository = subjectVisitRepository; _dicomInstanceRepository = dicomInstanceRepository; _dicomSeriesRepository = dicomSeriesRepository; + this._inspectionService = inspectionService; _mapper = mapper; } @@ -77,7 +81,7 @@ namespace IRaCIS.Application.Services sopInstanceUidList = _dicomInstanceRepository.Where(t => t.StudyId == studyId).Select(t => t.SopInstanceUid).ToList(); } - public void UploadOrReUploadNeedTodo(ArchiveStudyCommand archiveStudyCommand, List archiveStudyIds, ref DicomArchiveResult result,StudyMonitor monitor) + public void UploadOrReUploadNeedTodo(ArchiveStudyCommand archiveStudyCommand, List archiveStudyIds, ref DicomArchiveResult result,StudyMonitor monitor) { @@ -98,6 +102,9 @@ namespace IRaCIS.Application.Services subjectVisit.VisitExecuted = VisitExecutedEnum.Executed; + + + //处理拍片日期 @@ -144,6 +151,23 @@ namespace IRaCIS.Application.Services _ = _dicomStudyMonitorRepository.AddAsync(monitor).Result; _ = _studyRepository.SaveChangesAsync().Result; + // 这里上传dicom影像之后修改之后修改访视的状态 + _inspectionService.AddInspectionRecordAsync(new DataInspectionAddDTO() + { + SiteId = subjectVisit.SiteId, + SubjectId = subjectVisit.SubjectId, + IsSign = false, + VisitStageId = subjectVisit.VisitStageId, + SubjectVisitName = subjectVisit.VisitName, + BlindName = subjectVisit.BlindName, + SubjectVisitId = subjectVisit.Id, + Identification = "Edit|Visit|Status|Visit-Image Uplo", + JsonDetail= JsonConvert.SerializeObject(new { + SubmitState= subjectVisit.SubmitState, + VisitExecuted= subjectVisit.VisitExecuted, + }) + + }).Wait(); diff --git a/IRaCIS.Core.Application/Service/Visit/DTO/VisitPointViewModel.cs b/IRaCIS.Core.Application/Service/Visit/DTO/VisitPointViewModel.cs index 40e3c3a9d..273de03c8 100644 --- a/IRaCIS.Core.Application/Service/Visit/DTO/VisitPointViewModel.cs +++ b/IRaCIS.Core.Application/Service/Visit/DTO/VisitPointViewModel.cs @@ -3,6 +3,7 @@ using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Application.Contracts.Dicom.DTO; using Newtonsoft.Json; using System.ComponentModel.DataAnnotations; +using IRaCIS.Core.Application.Service.Inspection.DTO; namespace IRaCIS.Core.Application.Contracts { @@ -193,6 +194,11 @@ namespace IRaCIS.Core.Application.Contracts public string StudyInstanceUid { get; set; } = String.Empty; + + public string AuditInfo { get; set; }=string.Empty; + + + //public Guid TrialId { get; set; } //public Guid SiteId { get; set; } //public Guid SubjectId { get; set; }