上传Dicom影像

Uat_Study
he 2022-04-12 10:37:18 +08:00
parent 046c13ecf4
commit 977d83924d
3 changed files with 43 additions and 5 deletions

View File

@ -18,6 +18,9 @@ using EasyCaching.Core;
using IRaCIS.Core.Infra.EFCore; using IRaCIS.Core.Infra.EFCore;
using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Domain.Models; 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 namespace IRaCIS.Api.Controllers
{ {
@ -31,7 +34,7 @@ namespace IRaCIS.Api.Controllers
private readonly IStudyService _studyService; private readonly IStudyService _studyService;
private readonly IDicomArchiveService _dicomArchiveService; private readonly IDicomArchiveService _dicomArchiveService;
private readonly ILogger<StudyController> _logger; private readonly ILogger<StudyController> _logger;
private readonly IInspectionService _inspectionService;
private IEasyCachingProvider _provider; private IEasyCachingProvider _provider;
private IUserInfo _userInfo; private IUserInfo _userInfo;
private static object _locker = new object(); private static object _locker = new object();
@ -40,6 +43,7 @@ namespace IRaCIS.Api.Controllers
public StudyController(IStudyService studyService, public StudyController(IStudyService studyService,
IDicomArchiveService dicomArchiveService, IDicomArchiveService dicomArchiveService,
ILogger<StudyController> logger, ILogger<StudyController> logger,
IInspectionService inspectionService,
IEasyCachingProvider provider, IUserInfo userInfo IEasyCachingProvider provider, IUserInfo userInfo
) )
{ {
@ -48,7 +52,7 @@ namespace IRaCIS.Api.Controllers
_studyService = studyService; _studyService = studyService;
_dicomArchiveService = dicomArchiveService; _dicomArchiveService = dicomArchiveService;
_logger = logger; _logger = logger;
this._inspectionService = inspectionService;
} }
@ -63,6 +67,8 @@ namespace IRaCIS.Api.Controllers
[TypeFilter(typeof(TrialResourceFilter))] [TypeFilter(typeof(TrialResourceFilter))]
public async Task<IResponseOutput> ArchiveStudy([FromForm] ArchiveStudyCommand archiveStudyCommand) public async Task<IResponseOutput> ArchiveStudy([FromForm] ArchiveStudyCommand archiveStudyCommand)
{ {
//Stopwatch sw = new Stopwatch(); //Stopwatch sw = new Stopwatch();
var startTime = DateTime.Now; var startTime = DateTime.Now;
//sw.Start(); //sw.Start();
@ -205,6 +211,8 @@ namespace IRaCIS.Api.Controllers
return ResponseOutput.NotOk("未完成该检查的归档", archiveResult); return ResponseOutput.NotOk("未完成该检查的归档", archiveResult);
} }
await _inspectionService.AddInspectionRecordAsync(JsonConvert.DeserializeObject<DataInspectionAddDTO>(archiveStudyCommand.AuditInfo))
return ResponseOutput.Ok(archiveResult); return ResponseOutput.Ok(archiveResult);
} }

View File

@ -5,6 +5,9 @@ using IRaCIS.Core.Infra.EFCore;
using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Application.Contracts; 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 namespace IRaCIS.Application.Services
{ {
@ -16,7 +19,7 @@ namespace IRaCIS.Application.Services
private readonly IRepository<SubjectVisit> _subjectVisitRepository; private readonly IRepository<SubjectVisit> _subjectVisitRepository;
private readonly IRepository<DicomInstance> _dicomInstanceRepository; private readonly IRepository<DicomInstance> _dicomInstanceRepository;
private readonly IRepository<DicomSeries> _dicomSeriesRepository; private readonly IRepository<DicomSeries> _dicomSeriesRepository;
private readonly IInspectionService _inspectionService;
private readonly IUserInfo _userInfo; private readonly IUserInfo _userInfo;
private readonly IMapper _mapper; private readonly IMapper _mapper;
@ -34,7 +37,7 @@ namespace IRaCIS.Application.Services
IRepository<SubjectVisit> subjectVisitRepository, IRepository<SubjectVisit> subjectVisitRepository,
IRepository<DicomInstance> dicomInstanceRepository, IRepository<DicomInstance> dicomInstanceRepository,
IRepository<DicomSeries> dicomSeriesRepository, IRepository<DicomSeries> dicomSeriesRepository,
IInspectionService inspectionService,
IUserInfo userInfo, IUserInfo userInfo,
IRepository<StudyMonitor> dicomStudyMonitorRepository, IRepository<StudyMonitor> dicomStudyMonitorRepository,
@ -50,6 +53,7 @@ namespace IRaCIS.Application.Services
_subjectVisitRepository = subjectVisitRepository; _subjectVisitRepository = subjectVisitRepository;
_dicomInstanceRepository = dicomInstanceRepository; _dicomInstanceRepository = dicomInstanceRepository;
_dicomSeriesRepository = dicomSeriesRepository; _dicomSeriesRepository = dicomSeriesRepository;
this._inspectionService = inspectionService;
_mapper = mapper; _mapper = mapper;
} }
@ -77,7 +81,7 @@ namespace IRaCIS.Application.Services
sopInstanceUidList = _dicomInstanceRepository.Where(t => t.StudyId == studyId).Select(t => t.SopInstanceUid).ToList(); sopInstanceUidList = _dicomInstanceRepository.Where(t => t.StudyId == studyId).Select(t => t.SopInstanceUid).ToList();
} }
public void UploadOrReUploadNeedTodo(ArchiveStudyCommand archiveStudyCommand, List<Guid> archiveStudyIds, ref DicomArchiveResult result,StudyMonitor monitor) public void UploadOrReUploadNeedTodo(ArchiveStudyCommand archiveStudyCommand, List<Guid> archiveStudyIds, ref DicomArchiveResult result,StudyMonitor monitor)
{ {
@ -100,6 +104,9 @@ namespace IRaCIS.Application.Services
//处理拍片日期 //处理拍片日期
var svTime = _subjectVisitRepository.Where(t => t.Id == archiveStudyCommand.SubjectVisitId).Select(t => new var svTime = _subjectVisitRepository.Where(t => t.Id == archiveStudyCommand.SubjectVisitId).Select(t => new
{ {
@ -144,6 +151,23 @@ namespace IRaCIS.Application.Services
_ = _dicomStudyMonitorRepository.AddAsync(monitor).Result; _ = _dicomStudyMonitorRepository.AddAsync(monitor).Result;
_ = _studyRepository.SaveChangesAsync().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();

View File

@ -3,6 +3,7 @@ using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Application.Contracts.Dicom.DTO; using IRaCIS.Core.Application.Contracts.Dicom.DTO;
using Newtonsoft.Json; using Newtonsoft.Json;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using IRaCIS.Core.Application.Service.Inspection.DTO;
namespace IRaCIS.Core.Application.Contracts namespace IRaCIS.Core.Application.Contracts
{ {
@ -193,6 +194,11 @@ namespace IRaCIS.Core.Application.Contracts
public string StudyInstanceUid { get; set; } = String.Empty; public string StudyInstanceUid { get; set; } = String.Empty;
public string AuditInfo { get; set; }=string.Empty;
//public Guid TrialId { get; set; } //public Guid TrialId { get; set; }
//public Guid SiteId { get; set; } //public Guid SiteId { get; set; }
//public Guid SubjectId { get; set; } //public Guid SubjectId { get; set; }