From f6d2b1e7f1b5008e6e4182af332bf974d3cee164 Mon Sep 17 00:00:00 2001
From: hang <872297557@qq.com>
Date: Fri, 17 May 2024 14:14:51 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=96=B0=E7=9A=84=E5=BD=B1?=
=?UTF-8?q?=E5=83=8F=E5=BD=92=E6=A1=A3=E6=A3=80=E6=9F=A5=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../IRaCIS.Core.Application.xml | 14 +--
.../ImageAndDoc/DTO/DownloadAndUploadDTO.cs | 37 +++++++
.../ImageAndDoc/DownloadAndUploadService.cs | 39 ++++++++
.../Service/ImageAndDoc/StudyService.cs | 6 +-
IRaCIS.Core.Domain/Allocation/VisitTask.cs | 2 +
IRaCIS.Core.Domain/Image/TaskInstance.cs | 57 +++++++++++
IRaCIS.Core.Domain/Image/TaskSeries.cs | 62 ++++++++++++
IRaCIS.Core.Domain/Image/TaskStudy.cs | 99 +++++++++++++++++++
8 files changed, 304 insertions(+), 12 deletions(-)
create mode 100644 IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DownloadAndUploadDTO.cs
create mode 100644 IRaCIS.Core.Domain/Image/TaskInstance.cs
create mode 100644 IRaCIS.Core.Domain/Image/TaskSeries.cs
create mode 100644 IRaCIS.Core.Domain/Image/TaskStudy.cs
diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
index f27ff3667..11f14de7d 100644
--- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
+++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
@@ -853,6 +853,13 @@
后台托管服务的方式运行
+
+
+ 获取该受试者任务上传列表(展示已上传情况)
+
+
+
+
打包和匿名化影像 默认是匿名化打包,也可以不匿名化打包
@@ -871,13 +878,6 @@
-
-
- 上传临床数据
-
-
-
-
指定资源Id,渲染Dicom检查的Jpeg预览图像
Dicom检查的Id
diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DownloadAndUploadDTO.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DownloadAndUploadDTO.cs
new file mode 100644
index 000000000..37a8f027b
--- /dev/null
+++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DownloadAndUploadDTO.cs
@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Web;
+
+namespace IRaCIS.Core.Application.Service.ImageAndDoc.DTO
+{
+ public class SubjectImageUploadDTO
+ {
+ public Guid SubejctId { get; set; }
+
+ public string SubjectCode { get; set; }
+
+ public string TaskBlindName { get; set; }
+
+ public string TaskName { get; set; }
+
+ public List OrginalStudyList { get; set; }
+
+ public List UploadStudyList { get; set; }
+
+ }
+
+ public class StudyBasicInfo
+ {
+ public Guid Id { get; set; }
+
+ public string Modalities { get; set; }
+
+ public string Description { get; set; }
+ public int SeriesCount { get; set; }
+ public int InstanceCount { get; set; }
+ }
+}
+
diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs
index 30d4d0a49..48f2a8258 100644
--- a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs
+++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs
@@ -1,5 +1,6 @@
using FellowOakDicom;
using IRaCIS.Core.Application.Helper;
+using IRaCIS.Core.Application.Service.ImageAndDoc.DTO;
using MassTransit;
using Microsoft.AspNetCore.Mvc;
using System;
@@ -31,6 +32,44 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
_oSSService = oSSService;
}
+ ///
+ /// 获取该受试者任务上传列表(展示已上传情况)
+ ///
+ ///
+ ///
+ public async Task >> GetSubjectImageUploadList(Guid subjectId)
+ {
+ var query=_repository.Where(t=>t.Id==subjectId)
+ .Select(u=>new SubjectImageUploadDTO()
+ {
+ SubejctId=u.SubjectId,
+ SubjectCode=u.IsSelfAnalysis==true? u.Subject.Code:u.BlindSubjectCode,
+ TaskBlindName=u.TaskBlindName,
+ TaskName=u.TaskName,
+ OrginalStudyList=u.SourceSubjectVisit.StudyList.Select(t=>new StudyBasicInfo()
+ {
+ Id=t.Id,
+ Description=t.Description,
+ InstanceCount=t.InstanceCount,
+ Modalities=t.Modalities,
+ SeriesCount=t.SeriesCount,
+ }).ToList(),
+
+ UploadStudyList=u.TaskStudyList.Select(t => new StudyBasicInfo()
+ {
+ Id = t.Id,
+ Description = t.Description,
+ InstanceCount = t.InstanceCount,
+ Modalities = t.Modalities,
+ SeriesCount = t.SeriesCount,
+ }).ToList()
+ })
+ ;
+
+ var list =await query.ToListAsync();
+
+ return ResponseOutput.Ok(list);
+ }
///
/// 打包和匿名化影像 默认是匿名化打包,也可以不匿名化打包
diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs
index c74549364..57e7a8cec 100644
--- a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs
+++ b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs
@@ -139,11 +139,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
}
- ///
- /// 上传临床数据
- ///
- ///
- ///
+
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task AddOrUpdateArchiveStudy(NewArchiveStudyCommand incommand)
{
diff --git a/IRaCIS.Core.Domain/Allocation/VisitTask.cs b/IRaCIS.Core.Domain/Allocation/VisitTask.cs
index 257e38e4e..6027ef925 100644
--- a/IRaCIS.Core.Domain/Allocation/VisitTask.cs
+++ b/IRaCIS.Core.Domain/Allocation/VisitTask.cs
@@ -19,6 +19,8 @@ namespace IRaCIS.Core.Domain.Models
[Table("VisitTask")]
public class VisitTask : Entity, IAuditUpdate, IAuditAdd
{
+ [JsonIgnore]
+ public List TaskStudyList { get; set; }
public string TaskName { get; set; } = string.Empty;
public string TaskBlindName { get; set; } = string.Empty;
diff --git a/IRaCIS.Core.Domain/Image/TaskInstance.cs b/IRaCIS.Core.Domain/Image/TaskInstance.cs
new file mode 100644
index 000000000..8e27f2f73
--- /dev/null
+++ b/IRaCIS.Core.Domain/Image/TaskInstance.cs
@@ -0,0 +1,57 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace IRaCIS.Core.Domain.Models
+{
+ public class TaskInstance : Entity, IAuditAdd, IAuditUpdate
+ {
+ [JsonIgnore]
+ [ForeignKey("SeriesId")]
+ public TaskSeries TaskSeries { get; set; }
+
+ [JsonIgnore]
+ [ForeignKey("StudyId")]
+ public TaskStudy TaskStudy { get; set; }
+
+ [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+
+ public Guid SeqId { get; set; }
+ public Guid StudyId { get; set; }
+ public Guid SeriesId { get; set; }
+ public string StudyInstanceUid { get; set; }
+ public string SeriesInstanceUid { get; set; }
+ public string SopInstanceUid { get; set; }
+ public int InstanceNumber { get; set; }
+ public DateTime? InstanceTime { get; set; }
+ public bool CPIStatus { get; set; }
+ public int ImageRows { get; set; }
+ public int ImageColumns { get; set; }
+ public int SliceLocation { get; set; }
+
+
+ public string SliceThickness { get; set; }
+ public int NumberOfFrames { get; set; }
+ public string PixelSpacing { get; set; }
+
+ public string ImagerPixelSpacing { get; set; }
+ public string FrameOfReferenceUID { get; set; }
+ public string WindowCenter { get; set; }
+ public string WindowWidth { get; set; }
+
+
+ public Guid TrialId { get; set; }
+ public Guid SubjectId { get; set; }
+ public Guid VisitTaskId { get; set; }
+ public bool Anonymize { get; set; }
+ public string Path { get; set; }
+
+ public Guid CreateUserId { get; set; }
+ public DateTime CreateTime { get; set; } = DateTime.Now;
+ public Guid UpdateUserId { get; set; }
+ public DateTime UpdateTime { get; set; } = DateTime.Now;
+
+ public string HtmlPath { get; set; }=string.Empty;
+
+ }
+}
diff --git a/IRaCIS.Core.Domain/Image/TaskSeries.cs b/IRaCIS.Core.Domain/Image/TaskSeries.cs
new file mode 100644
index 000000000..950082f5b
--- /dev/null
+++ b/IRaCIS.Core.Domain/Image/TaskSeries.cs
@@ -0,0 +1,62 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace IRaCIS.Core.Domain.Models
+{
+ public class TaskSeries : Entity, IAuditAdd, IAuditUpdate, ISoftDelete
+ {
+ [JsonIgnore]
+ [ForeignKey("StudyId")]
+ public TaskStudy TaskStudy { get; set; }
+
+ [JsonIgnore]
+ public List InstanceList { get; set; }
+
+
+ [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public Guid SeqId { get; set; }
+ public Guid StudyId { get; set; }
+ public string StudyInstanceUid { get; set; }
+ public string SeriesInstanceUid { get; set; }
+ public int SeriesNumber { get; set; }
+ public DateTime? SeriesTime { get; set; }
+ public string Modality { get; set; }
+ public string Description { get; set; }
+ public int InstanceCount { get; set; }
+ public string SliceThickness { get; set; }
+
+ public string ImagePositionPatient { get; set; }
+ public string ImageOrientationPatient { get; set; }
+ public string BodyPartExamined { get; set; }
+ public string SequenceName { get; set; }
+ public string ProtocolName { get; set; }
+ public string ImagerPixelSpacing { get; set; }
+
+ public string AcquisitionTime { get; set; } = string.Empty;
+ public string AcquisitionNumber { get; set; } = string.Empty;
+ public string TriggerTime { get; set; } = string.Empty;
+
+ public Guid TrialId { get; set; }
+ public Guid SubjectId { get; set; }
+ public Guid VisitTaskId { get; set; }
+
+
+ public string BodyPartForEdit { get; set; } = string.Empty;
+
+ public Guid CreateUserId { get; set; }
+ public DateTime CreateTime { get; set; } = DateTime.Now;
+ public Guid UpdateUserId { get; set; }
+ public DateTime UpdateTime { get; set; } = DateTime.Now;
+
+ public DateTime? DeletedTime { get; set; }
+
+ public Guid? DeleteUserId { get; set; }
+ public bool IsDeleted {get;set;}
+ public bool IsReading { get; set; } = true;
+
+ public string ImageResizePath { get; set; }=string.Empty;
+
+ }
+}
diff --git a/IRaCIS.Core.Domain/Image/TaskStudy.cs b/IRaCIS.Core.Domain/Image/TaskStudy.cs
new file mode 100644
index 000000000..83c66062a
--- /dev/null
+++ b/IRaCIS.Core.Domain/Image/TaskStudy.cs
@@ -0,0 +1,99 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace IRaCIS.Core.Domain.Models
+{
+ public class TaskStudy : Entity, IAuditUpdate, IAuditAdd, ISoftDelete
+ {
+
+ [JsonIgnore]
+ [ForeignKey("VisitTaskId")]
+ public VisitTask VisitTask { get; set; }
+
+ [JsonIgnore]
+ public List DicomStudyMonitorList { get; set; } = new List();
+
+
+ [JsonIgnore]
+ public List SeriesList { get; set; }
+
+
+ [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public Guid SeqId { get; set; }
+
+ public Guid TrialId { get; set; }
+
+
+ public Guid SubjectId { get; set; }
+
+
+ public Guid VisitTaskId { get; set; }
+
+ public int Code { get; set; } = 0;
+
+ public string StudyCode { get; set; } = string.Empty;
+
+ public string StudyInstanceUid { get; set; } = string.Empty;
+ public DateTime? StudyTime { get; set; }
+ public string Modalities { get; set; } = string.Empty;
+
+ public string Description { get; set; } = string.Empty;
+ public int SeriesCount { get; set; } = 0;
+ public int InstanceCount { get; set; } = 0;
+
+
+ public string InstitutionName { get; set; } = string.Empty;
+ public string PatientId { get; set; } = string.Empty;
+ public string PatientName { get; set; } = string.Empty;
+ public string PatientAge { get; set; } = string.Empty;
+ public string PatientSex { get; set; } = string.Empty;
+
+ public string StudyId { get; set; } = string.Empty;
+ public string AccessionNumber { get; set; } = string.Empty;
+ public string PatientBirthDate { get; set; } = string.Empty;
+ public string AcquisitionTime { get; set; } = string.Empty;
+ public string AcquisitionNumber { get; set; } = string.Empty;
+ public string TriggerTime { get; set; } = string.Empty;
+
+ public string BodyPartExamined { get; set; } = string.Empty;
+
+ public string BodyPartForEdit { get; set; } = string.Empty;
+
+ public string ModalityForEdit { get; set; } = string.Empty;
+
+
+
+ //0 未知 1 单重 2 双重
+ public bool IsDoubleReview { get; set; }
+
+ [JsonIgnore]
+ [ForeignKey("SubjectId")]
+ public Subject Subject { get; set; }
+
+ public Guid UpdateUserId { get; set; }
+ public DateTime UpdateTime { get; set; } = DateTime.Now;
+ public Guid CreateUserId { get; set; }
+ public DateTime CreateTime { get; set; } = DateTime.Now;
+
+ [JsonIgnore]
+ [ForeignKey("CreateUserId")]
+ public User Uploader { get; set; }
+
+ [JsonIgnore]
+
+ public List ReadingClinicalDataList { get; set; }
+
+
+
+ //软删除
+ public bool IsDeleted { get; set; }
+
+ public DateTime? DeletedTime { get; set; }
+
+ public Guid? DeleteUserId { get; set; }
+
+
+ }
+}