影像库增加新的字段,后处理上传、scp服务修改
continuous-integration/drone/push Build is running Details

Test_IRC_Net8
hang 2025-09-19 15:43:02 +08:00
parent 2e1a68fa14
commit 29c137a2c5
14 changed files with 20837 additions and 39 deletions

View File

@ -22,6 +22,7 @@ using SharpCompress.Common;
using SixLabors.ImageSharp.Formats.Jpeg;
using IRaCIS.Core.Infrastructure;
using IRaCIS.Core.Infrastructure.Extention;
using FellowOakDicom.IO.Buffer;
namespace IRaCIS.Core.SCP.Service
{
@ -40,9 +41,9 @@ namespace IRaCIS.Core.SCP.Service
{
private IServiceProvider _serviceProvider { get; set; }
private List<Guid> _SCPStudyIdList { get; set; } = new List<Guid>();
private List<Guid> _SCPStudyIdList => _ImageUploadList.Where(t => t.SCPStudyId != Guid.Empty).Select(t => t.SCPStudyId).ToList();
private List<string> _StudyInstanceUIdList { get; set; } = new List<string>();
private List<ImageUploadInfo> _ImageUploadList { get; set; } = new List<ImageUploadInfo>();
private SCPImageUpload _upload { get; set; }
@ -165,18 +166,19 @@ namespace IRaCIS.Core.SCP.Service
public async Task OnReceiveAssociationReleaseRequestAsync()
{
var _distributedLockProvider = _serviceProvider.GetService<IDistributedLockProvider>();
var @lock = _distributedLockProvider.CreateLock($"{_upload.CallingAE}");
using (await @lock.AcquireAsync())
{
await DataMaintenanceAsaync();
//记录监控
var _SCPImageUploadRepository = _serviceProvider.GetService<IRepository<SCPImageUpload>>();
await AddUploadLogAsync();
_upload.EndTime = DateTime.Now;
_upload.StudyCount = _StudyInstanceUIdList.Count;
_upload.TrialId = _trialId;
_upload.TrialSiteId = _trialSiteId;
await _SCPImageUploadRepository.AddAsync(_upload, true);
var _studyRepository = _serviceProvider.GetService<IRepository<SCPStudy>>();
@ -185,7 +187,27 @@ namespace IRaCIS.Core.SCP.Service
await _studyRepository.SaveChangesAndClearAllTrackingAsync();
}
await SendAssociationReleaseResponseAsync();
}
private async Task AddUploadLogAsync()
{
//记录监控
var _SCPImageUploadRepository = _serviceProvider.GetService<IRepository<SCPImageUpload>>();
_upload.EndTime = DateTime.Now;
_upload.StudyCount = _ImageUploadList.Count;
_upload.TrialId = _trialId;
_upload.TrialSiteId = _trialSiteId;
_upload.UploadJsonStr = (new SCPImageLog() { UploadList = _ImageUploadList }).ToJsonStr();
//可能是测试echo 导致记录了
await _SCPImageUploadRepository.AddAsync(_upload, _upload.FileCount > 0 ? true : false);
}
@ -251,6 +273,11 @@ namespace IRaCIS.Core.SCP.Service
//await _studyRepository.SaveChangesAndClearAllTrackingAsync();
}
else
{
//记录日志
await AddUploadLogAsync();
}
Log.Logger.Warning($"连接关闭 {exception?.Message} {exception?.InnerException?.Message}");
}
@ -261,20 +288,22 @@ namespace IRaCIS.Core.SCP.Service
public async Task<DicomCStoreResponse> OnCStoreRequestAsync(DicomCStoreRequest request)
{
string studyInstanceUid = request.Dataset.GetSingleValueOrDefault(DicomTag.StudyInstanceUID,string.Empty);
string studyInstanceUid = request.Dataset.GetSingleValueOrDefault(DicomTag.StudyInstanceUID, string.Empty);
string seriesInstanceUid = request.Dataset.GetSingleValueOrDefault(DicomTag.SeriesInstanceUID, string.Empty);
string sopInstanceUid = request.Dataset.GetSingleValueOrDefault(DicomTag.SOPInstanceUID, string.Empty);
string patientIdStr = request.Dataset.GetSingleValueOrDefault(DicomTag.PatientID, string.Empty);
if(studyInstanceUid.IsNullOrEmpty() || seriesInstanceUid.IsNullOrEmpty() || sopInstanceUid.IsNullOrEmpty())
if (studyInstanceUid.IsNullOrEmpty() || seriesInstanceUid.IsNullOrEmpty() || sopInstanceUid.IsNullOrEmpty())
{
Log.Logger.Error($"接收数据读取StudyInstanceUID{studyInstanceUid}、SeriesInstanceUID{seriesInstanceUid}、SOPInstanceUID{sopInstanceUid}有空 ");
return new DicomCStoreResponse(request, DicomStatus.Success);
}
if (!_StudyInstanceUIdList.Contains(studyInstanceUid))
//确保来了影像集合存在
if (!_ImageUploadList.Any(t => t.StudyInstanceUid == studyInstanceUid))
{
_StudyInstanceUIdList.Add(studyInstanceUid);
_ImageUploadList.Add(new ImageUploadInfo() { StudyInstanceUid = studyInstanceUid });
}
//Guid studyId = IdentifierHelper.CreateGuid(studyInstanceUid, trialId.ToString());
@ -295,11 +324,70 @@ namespace IRaCIS.Core.SCP.Service
long fileSize = 0;
try
{
using (MemoryStream ms = new MemoryStream())
{
await request.File.SaveAsync(ms);
#region 1帧拆成多个固定大小的方便移动端浏览
// 回到开头,读取 dicom
ms.Position = 0;
var dicomFile = DicomFile.Open(ms);
var pixelData = DicomPixelData.Create(dicomFile.Dataset);
var syntax = pixelData.Syntax;
// 每个 fragment 固定大小 (64KB 示例,可以自己调整)
int fragmentSize = 20 * 1024;
if (syntax.IsEncapsulated)
{
var newFragments = new DicomOtherByteFragment(DicomTag.PixelData);
for (int n = 0; n < pixelData.NumberOfFrames; n++)
{
var frameData = pixelData.GetFrame(n); // 获取完整一帧
var data = frameData.Data;
int offset = 0;
while (offset < data.Length)
{
int size = Math.Min(fragmentSize, data.Length - offset);
var buffer = new byte[size];
Buffer.BlockCopy(data, offset, buffer, 0, size);
newFragments.Fragments.Add(new MemoryByteBuffer(buffer));
offset += size;
}
}
// 替换原 PixelData
dicomFile.Dataset.AddOrUpdate(newFragments);
// 重新保存 dicom 到流
ms.SetLength(0);
dicomFile.Save(ms);
}
ms.Position = 0;
#endregion
#region 本地测试
//// --- 保存到本地文件测试 ---
//var localPath = @"D:\TestDicom.dcm";
//using (var fs = new FileStream(localPath, FileMode.Create, FileAccess.Write))
//{
// ms.CopyTo(fs);
//}
//return new DicomCStoreResponse(request, DicomStatus.Success);
#endregion
//irc 从路径最后一截取Guid
storeRelativePath = await ossService.UploadToOSSAsync(ms, ossFolderPath, instanceId.ToString(), false);
@ -322,12 +410,8 @@ namespace IRaCIS.Core.SCP.Service
{
try
{
var scpStudyId = await dicomArchiveService.ArchiveDicomFileAsync(request.Dataset, _trialId, _trialSiteId, storeRelativePath, Association.CallingAE, Association.CalledAE,fileSize);
var scpStudyId = await dicomArchiveService.ArchiveDicomFileAsync(request.File, _trialId, _trialSiteId, storeRelativePath, Association.CallingAE, Association.CalledAE,fileSize);
if (!_SCPStudyIdList.Contains(scpStudyId))
{
_SCPStudyIdList.Add(scpStudyId);
}
var series = await _seriesRepository.FirstOrDefaultAsync(t => t.Id == seriesId);
@ -356,12 +440,40 @@ namespace IRaCIS.Core.SCP.Service
await _seriesRepository.SaveChangesAsync();
if (_ImageUploadList.Any(t => t.StudyInstanceUid == studyInstanceUid))
{
var find = _ImageUploadList.FirstOrDefault(t => t.StudyInstanceUid.Equals(studyInstanceUid));
find.SuccessImageCount++;
if (!find.PatientNameList.Any(t => t == patientIdStr) && patientIdStr.IsNotNullOrEmpty())
{
find.PatientNameList.Add(patientIdStr);
}
//首次 默认是Guid 空数据库归档出了Id
if (find.SCPStudyId != scpStudyId)
{
find.SCPStudyId = scpStudyId;
}
}
}
catch (Exception ex)
{
Log.Logger.Warning($"CallingAE:{Association.CallingAE} CalledAE:{Association.CalledAE} 传输处理异常:{ex.ToString()}");
if (_ImageUploadList.Any(t => t.StudyInstanceUid == studyInstanceUid))
{
var find = _ImageUploadList.FirstOrDefault(t => t.StudyInstanceUid.Equals(studyInstanceUid));
find.FailedImageCount++;
}
}
}

View File

@ -13,6 +13,7 @@ using IRaCIS.Core.Infra.EFCore;
using MassTransit;
using System.Runtime.Intrinsics.X86;
using Serilog.Sinks.File;
using IRaCIS.Core.Infrastructure.Extention;
namespace IRaCIS.Core.SCP.Service
{
@ -52,8 +53,10 @@ namespace IRaCIS.Core.SCP.Service
/// <param name="dataset"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
public async Task<Guid> ArchiveDicomFileAsync(DicomDataset dataset, Guid trialId, Guid trialSiteId, string fileRelativePath, string callingAE, string calledAE,long fileSize)
public async Task<Guid> ArchiveDicomFileAsync(DicomFile dicomFile, Guid trialId, Guid trialSiteId, string fileRelativePath, string callingAE, string calledAE,long fileSize)
{
var dataset = dicomFile.Dataset;
string studyInstanceUid = dataset.GetString(DicomTag.StudyInstanceUID);
string seriesInstanceUid = dataset.GetString(DicomTag.SeriesInstanceUID);
string sopInstanceUid = dataset.GetString(DicomTag.SOPInstanceUID);
@ -82,7 +85,7 @@ namespace IRaCIS.Core.SCP.Service
DateTime? studyTime = dataset.GetSingleValueOrDefault(DicomTag.StudyDate, string.Empty) == string.Empty ? null : dataset.GetSingleValue<DateTime>(DicomTag.StudyDate).Add(dataset.GetSingleValueOrDefault(DicomTag.StudyTime, string.Empty) == string.Empty ? TimeSpan.Zero : dataset.GetSingleValue<DateTime>(DicomTag.StudyTime).TimeOfDay);
//先传输了修改了患者编号的又传输了没有修改患者编号的导致后传输的没有修改患者编号的下面的检查为0
if (findPatient == null && findStudy==null)
if (findPatient == null /*&& findStudy==null*/)
{
isPatientNeedAdd = true;
@ -151,6 +154,32 @@ namespace IRaCIS.Core.SCP.Service
}
findPatient.LatestPushTime = DateTime.Now;
findPatient.PatientName = dataset.GetSingleValueOrDefault(DicomTag.PatientName, string.Empty);
findPatient.PatientSex = dataset.GetSingleValueOrDefault(DicomTag.PatientSex, string.Empty);
findPatient.PatientAge = dataset.GetSingleValueOrDefault(DicomTag.PatientAge, string.Empty);
findPatient.PatientBirthDate = dataset.GetSingleValueOrDefault(DicomTag.PatientBirthDate, string.Empty);
if (findPatient.PatientBirthDate.Length == 8)
{
var birthDateStr = $"{findPatient.PatientBirthDate[0]}{findPatient.PatientBirthDate[1]}{findPatient.PatientBirthDate[2]}{findPatient.PatientBirthDate[3]}-{findPatient.PatientBirthDate[4]}{findPatient.PatientBirthDate[5]}-{findPatient.PatientBirthDate[6]}{findPatient.PatientBirthDate[7]}";
var yearStr = $"{findPatient.PatientBirthDate[0]}{findPatient.PatientBirthDate[1]}{findPatient.PatientBirthDate[2]}{findPatient.PatientBirthDate[3]}";
int year = 0;
var canParse = int.TryParse(yearStr, out year);
if (canParse && year > 1900)
{
findPatient.PatientBirthDate = birthDateStr;
}
else
{
findPatient.PatientBirthDate = string.Empty;
}
}
}
if (findStudy == null)
@ -167,6 +196,9 @@ namespace IRaCIS.Core.SCP.Service
TrialSiteId = trialSiteId,
StudyInstanceUid = studyInstanceUid,
StudyTime = studyTime,
DicomStudyDate = dataset.GetSingleValueOrDefault(DicomTag.StudyDate, string.Empty),
DicomStudyTime = dataset.GetSingleValueOrDefault(DicomTag.StudyTime, string.Empty),
Modalities = dataset.GetSingleValueOrDefault(DicomTag.Modality, string.Empty),
//ModalityForEdit = modalityForEdit,
Description = dataset.GetSingleValueOrDefault(DicomTag.StudyDescription, string.Empty),
@ -201,6 +233,19 @@ namespace IRaCIS.Core.SCP.Service
findStudy.PatientBirthDate = $"{findStudy.PatientBirthDate[0]}{findStudy.PatientBirthDate[1]}{findStudy.PatientBirthDate[2]}{findStudy.PatientBirthDate[3]}-{findStudy.PatientBirthDate[4]}{findStudy.PatientBirthDate[5]}-{findStudy.PatientBirthDate[6]}{findStudy.PatientBirthDate[7]}";
}
}
else
{
findStudy.DicomStudyDate = dataset.GetSingleValueOrDefault(DicomTag.StudyDate, string.Empty);
findStudy.DicomStudyTime = dataset.GetSingleValueOrDefault(DicomTag.StudyTime, string.Empty);
findStudy.CalledAE = calledAE;
findStudy.CallingAE = callingAE;
findStudy.PatientName = dataset.GetSingleValueOrDefault(DicomTag.PatientName, string.Empty);
findStudy.PatientSex = dataset.GetSingleValueOrDefault(DicomTag.PatientSex, string.Empty);
findStudy.PatientAge = dataset.GetSingleValueOrDefault(DicomTag.PatientAge, string.Empty);
findStudy.UpdateTime = DateTime.Now;
await _patientRepository.BatchUpdateNoTrackingAsync(t => t.Id == findStudy.PatientId, u => new SCPPatient() { LatestPushTime = DateTime.Now });
}
if (findSerice == null)
@ -218,6 +263,9 @@ namespace IRaCIS.Core.SCP.Service
//SeriesTime = dataset.GetSingleValueOrDefault(DicomTag.SeriesDate, DateTime.Now).Add(dataset.GetSingleValueOrDefault(DicomTag.SeriesTime, DateTime.Now).TimeOfDay),
//SeriesTime = DateTime.TryParse(dataset.GetSingleValue<string>(DicomTag.SeriesDate) + dataset.GetSingleValue<string>(DicomTag.SeriesTime), out DateTime dt) ? dt : null,
SeriesTime = dataset.GetSingleValueOrDefault(DicomTag.SeriesDate, string.Empty) == string.Empty ? null : dataset.GetSingleValue<DateTime>(DicomTag.SeriesDate).Add(dataset.GetSingleValueOrDefault(DicomTag.SeriesTime, string.Empty) == string.Empty ? TimeSpan.Zero : dataset.GetSingleValue<DateTime>(DicomTag.SeriesTime).TimeOfDay),
DicomSeriesDate = dataset.GetSingleValueOrDefault(DicomTag.SeriesDate, string.Empty),
DicomSeriesTime = dataset.GetSingleValueOrDefault(DicomTag.SeriesTime, string.Empty),
Modality = dataset.GetSingleValueOrDefault(DicomTag.Modality, string.Empty),
Description = dataset.GetSingleValueOrDefault(DicomTag.SeriesDescription, string.Empty),
SliceThickness = dataset.GetSingleValueOrDefault(DicomTag.SliceThickness, string.Empty),
@ -239,7 +287,20 @@ namespace IRaCIS.Core.SCP.Service
++findStudy.SeriesCount;
}
else
{
findSerice.DicomSeriesDate = dataset.GetSingleValueOrDefault(DicomTag.SeriesDate, string.Empty);
findSerice.DicomSeriesTime = dataset.GetSingleValueOrDefault(DicomTag.SeriesTime, string.Empty);
findSerice.UpdateTime = DateTime.Now;
}
var transferSyntaxUID = dicomFile.FileMetaInfo.GetSingleValueOrDefault(DicomTag.TransferSyntaxUID, string.Empty);
var isEncapsulated = false;
if (transferSyntaxUID.IsNotNullOrEmpty())
{
isEncapsulated = DicomTransferSyntax.Lookup(DicomUID.Parse(transferSyntaxUID)).IsEncapsulated;
}
if (findInstance == null)
{
@ -280,6 +341,15 @@ namespace IRaCIS.Core.SCP.Service
++findStudy.InstanceCount;
++findSerice.InstanceCount;
}
else
{
findInstance.SOPClassUID = dataset.GetSingleValueOrDefault(DicomTag.SOPClassUID, string.Empty);
findInstance.MediaStorageSOPClassUID = dataset.GetSingleValueOrDefault(DicomTag.MediaStorageSOPClassUID, string.Empty);
findInstance.TransferSytaxUID = transferSyntaxUID;
findInstance.MediaStorageSOPInstanceUID = dataset.GetSingleValueOrDefault(DicomTag.MediaStorageSOPInstanceUID, string.Empty);
findInstance.IsEncapsulated = isEncapsulated;
findInstance.UpdateTime = DateTime.Now;
}
if (isPatientNeedAdd)
{

View File

@ -5,7 +5,7 @@ namespace IRaCIS.Core.SCP.Service
{
public interface IDicomArchiveService
{
Task<Guid> ArchiveDicomFileAsync(DicomDataset dicomDataset,Guid trialId,Guid trialSiteId, string fileRelativePath,string callingAE,string calledAE,long fileSize);
Task<Guid> ArchiveDicomFileAsync(DicomFile dicomFile, Guid trialId,Guid trialSiteId, string fileRelativePath,string callingAE,string calledAE,long fileSize);
}
}

View File

@ -324,16 +324,27 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
}
#region 只配置单个部位自动赋值
//项目配置的影像部位
var trialBodyParts = _trialRepository.Where(t => t.Id == trialId).Select(t => t.BodyPartTypes).FirstOrDefault();
var trialBodyPartList = trialBodyParts.Split('|', StringSplitOptions.RemoveEmptyEntries);
var originStudy = _dicomStudyRepository.Where(t => t.TrialId == incommand.TrialId && t.StudyInstanceUid == findStudy.StudyInstanceUid).FirstOrDefault();
if (trialBodyPartList.Count() == 1)
if(originStudy != null)
{
var first = trialBodyPartList.First();
findStudy.BodyPartForEdit = first;
findStudy.BodyPartForEdit=originStudy.BodyPartForEdit;
findStudy.BodyPartForEditOther = originStudy.BodyPartForEditOther;
}
////项目配置的影像部位
//var trialBodyParts = _trialRepository.Where(t => t.Id == trialId).Select(t => t.BodyPartTypes).FirstOrDefault();
//var trialBodyPartList = trialBodyParts.Split('|', StringSplitOptions.RemoveEmptyEntries);
//if (trialBodyPartList.Count() == 1)
//{
// var first = trialBodyPartList.First();
// findStudy.BodyPartForEdit = first;
//}
#endregion
@ -579,7 +590,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
/// <returns></returns>
[HttpGet("{subjectVisitId:guid}")]
[AllowAnonymous]
public IResponseOutput<List<RelationStudyDTO>> GetAllRelationStudyList(Guid subjectVisitId,bool? isReading)
public IResponseOutput<List<RelationStudyDTO>> GetAllRelationStudyList(Guid subjectVisitId, bool? isReading)
{
#region 废弃
//var studylist = _studyRepository.Where(u => u.SubjectVisitId == subjectVisitId && u.IsDeleted == false).Select(t => new { StudyId = t.Id, t.SubjectId, t.TrialId }).ToList();
@ -608,17 +619,17 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
var studyInfo = _dicomStudyRepository.Where(u => u.SubjectVisitId == subjectVisitId).Select(t => new { t.SubjectId, t.TrialId }).FirstOrDefault().IfNullThrowException();
var list = _dicomStudyRepository.Where(t => t.SubjectVisitId != subjectVisitId && t.TrialId == studyInfo.TrialId && t.SubjectId == studyInfo.SubjectId)
.Select(t=> new RelationStudyDTO()
.Select(t => new RelationStudyDTO()
{
StudyId = t.Id,
StudyCode = t.StudyCode,
VisitName = t.SubjectVisit.VisitName,
Modalities = t.Modalities,
Description = t.Description,
SeriesCount = t.SeriesList.Where(t=> isReading==true? t.IsReading==true:true).Count()
}) .ToList();
SeriesCount = t.SeriesList.Where(t => isReading == true ? t.IsReading == true : true).Count()
}).ToList();
list = list.Where(t=>t.SeriesCount>0).OrderBy(u => u.VisitName).ThenBy(s => s.StudyCode).ToList();
list = list.Where(t => t.SeriesCount > 0).OrderBy(u => u.VisitName).ThenBy(s => s.StudyCode).ToList();
return ResponseOutput.Ok(list);
}
@ -628,7 +639,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
/// <param name="studyId"> Dicom检查的Id </param>
[HttpGet, Route("{studyId:guid}")]
[AllowAnonymous]
public IResponseOutput<DicomStudyDTO> Item(Guid studyId,bool? isPacs)
public IResponseOutput<DicomStudyDTO> Item(Guid studyId, bool? isPacs)
{
if (isPacs == true)
{
@ -861,7 +872,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
var verifyStudyInfo = _dicomStudyRepository.Where(t => t.TrialId == trialId && t.Id == expectStudyId,false,true).ProjectTo<VerifyStudyDto>(_mapper.ConfigurationProvider).FirstOrDefault();
var verifyStudyInfo = _dicomStudyRepository.Where(t => t.TrialId == trialId && t.Id == expectStudyId, false, true).ProjectTo<VerifyStudyDto>(_mapper.ConfigurationProvider).FirstOrDefault();
result.StudyInfo = verifyStudyInfo;

View File

@ -1,3 +1,5 @@
using System.Linq;
namespace IRaCIS.Core.Domain.Models;
[Comment("项目中心 - 影像推送记录")]
@ -21,4 +23,36 @@ public class SCPImageUpload : BaseAddAuditEntity
public int StudyCount { get; set; }
public Guid TrialId { get; set; }
public Guid TrialSiteId { get; set; }
[MaxLength]
public string UploadJsonStr { get; set; }
}
public class SCPImageLog
{
////当前传输 检查患者名字,一个检查可能患者名字不同 记录去重的,然后,拼接
//public string PatientNames => string.Join(",", UploadList.SelectMany(t => t.PatientNameList).ToList());
/// <summary>
/// 归档到数据库的检查Id
/// </summary>
public List<Guid> SCPStudyIdList => UploadList.Select(t => t.SCPStudyId).ToList();
public List<ImageUploadInfo> UploadList { get; set; } = new List<ImageUploadInfo>();
}
public class ImageUploadInfo
{
public List<string> PatientNameList { get; set; } = new List<string>();
public Guid SCPStudyId { get; set; }
public string StudyInstanceUid { get; set; }
public int FailedImageCount { get; set; }
public int SuccessImageCount { get; set; }
}

View File

@ -40,4 +40,20 @@ public class SCPInstance : BaseFullAuditEntity, IEntitySeqId
public string Path { get; set; } = string.Empty;
public long? FileSize { get; set; }
#region DIR 增加
public string SOPClassUID { get; set; }
public string MediaStorageSOPClassUID { get; set; }
public string TransferSytaxUID { get; set; }
public string MediaStorageSOPInstanceUID { get; set; }
public bool IsEncapsulated { get; set; }
#endregion
}

View File

@ -39,4 +39,11 @@ public class SCPSeries : BaseFullDeleteAuditEntity, IEntitySeqId
[StringLength(1000)]
public string ImageResizePath { get; set; } = string.Empty;
#region DIR 增加
public string DicomSeriesDate { get; set; }
public string DicomSeriesTime { get; set; }
#endregion
}

View File

@ -64,4 +64,18 @@ public class SCPStudy : BaseFullDeleteAuditEntity, IEntitySeqId
public Guid TrialSiteId { get; set; }
public Guid? SubjectVisitId { get; set; }
public string BodyPartForEditOther { get; set; }
#region DIR 增加字段
public string DicomStudyDate { get; set; }
public string DicomStudyTime { get; set; }
public string StudyDIRPath { get; set; }
#endregion
}

View File

@ -46,4 +46,19 @@ public class TaskInstance : BaseFullAuditEntity, IEntitySeqId
public long? FileSize { get; set; }
#region DIR 增加
public string SOPClassUID { get; set; }
public string MediaStorageSOPClassUID { get; set; }
public string TransferSytaxUID { get; set; }
public string MediaStorageSOPInstanceUID { get; set; }
public bool IsEncapsulated { get; set; }
#endregion
}

View File

@ -41,4 +41,12 @@ public class TaskSeries : BaseFullDeleteAuditEntity, IEntitySeqId
[StringLength(1000)]
public string ImageResizePath { get; set; } = string.Empty;
#region DIR 增加
public string DicomSeriesDate { get; set; }
public string DicomSeriesTime { get; set; }
#endregion
}

View File

@ -54,4 +54,17 @@ public class TaskStudy : BaseFullDeleteAuditEntity, IEntitySeqId
public string BodyPartForEdit { get; set; } = string.Empty;
public string ModalityForEdit { get; set; } = string.Empty;
public string BodyPartForEditOther { get; set; }
#region DIR 增加字段
public string DicomStudyDate { get; set; }
public string DicomStudyTime { get; set; }
public string StudyDIRPath { get; set; }
#endregion
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,291 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IRaCIS.Core.Infra.EFCore.Migrations
{
/// <inheritdoc />
public partial class ImageModify : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "BodyPartForEditOther",
table: "TaskStudy",
type: "nvarchar(400)",
maxLength: 400,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "DicomStudyDate",
table: "TaskStudy",
type: "nvarchar(400)",
maxLength: 400,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "DicomStudyTime",
table: "TaskStudy",
type: "nvarchar(400)",
maxLength: 400,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "StudyDIRPath",
table: "TaskStudy",
type: "nvarchar(400)",
maxLength: 400,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "DicomSeriesDate",
table: "TaskSeries",
type: "nvarchar(400)",
maxLength: 400,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "DicomSeriesTime",
table: "TaskSeries",
type: "nvarchar(400)",
maxLength: 400,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<bool>(
name: "IsEncapsulated",
table: "TaskInstance",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "MediaStorageSOPClassUID",
table: "TaskInstance",
type: "nvarchar(400)",
maxLength: 400,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "MediaStorageSOPInstanceUID",
table: "TaskInstance",
type: "nvarchar(400)",
maxLength: 400,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "SOPClassUID",
table: "TaskInstance",
type: "nvarchar(400)",
maxLength: 400,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "TransferSytaxUID",
table: "TaskInstance",
type: "nvarchar(400)",
maxLength: 400,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "BodyPartForEditOther",
table: "SCPStudy",
type: "nvarchar(400)",
maxLength: 400,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "DicomStudyDate",
table: "SCPStudy",
type: "nvarchar(400)",
maxLength: 400,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "DicomStudyTime",
table: "SCPStudy",
type: "nvarchar(400)",
maxLength: 400,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "StudyDIRPath",
table: "SCPStudy",
type: "nvarchar(400)",
maxLength: 400,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "DicomSeriesDate",
table: "SCPSeries",
type: "nvarchar(400)",
maxLength: 400,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "DicomSeriesTime",
table: "SCPSeries",
type: "nvarchar(400)",
maxLength: 400,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<bool>(
name: "IsEncapsulated",
table: "SCPInstance",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "MediaStorageSOPClassUID",
table: "SCPInstance",
type: "nvarchar(400)",
maxLength: 400,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "MediaStorageSOPInstanceUID",
table: "SCPInstance",
type: "nvarchar(400)",
maxLength: 400,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "SOPClassUID",
table: "SCPInstance",
type: "nvarchar(400)",
maxLength: 400,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "TransferSytaxUID",
table: "SCPInstance",
type: "nvarchar(400)",
maxLength: 400,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "UploadJsonStr",
table: "SCPImageUpload",
type: "nvarchar(max)",
nullable: false,
defaultValue: "");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "BodyPartForEditOther",
table: "TaskStudy");
migrationBuilder.DropColumn(
name: "DicomStudyDate",
table: "TaskStudy");
migrationBuilder.DropColumn(
name: "DicomStudyTime",
table: "TaskStudy");
migrationBuilder.DropColumn(
name: "StudyDIRPath",
table: "TaskStudy");
migrationBuilder.DropColumn(
name: "DicomSeriesDate",
table: "TaskSeries");
migrationBuilder.DropColumn(
name: "DicomSeriesTime",
table: "TaskSeries");
migrationBuilder.DropColumn(
name: "IsEncapsulated",
table: "TaskInstance");
migrationBuilder.DropColumn(
name: "MediaStorageSOPClassUID",
table: "TaskInstance");
migrationBuilder.DropColumn(
name: "MediaStorageSOPInstanceUID",
table: "TaskInstance");
migrationBuilder.DropColumn(
name: "SOPClassUID",
table: "TaskInstance");
migrationBuilder.DropColumn(
name: "TransferSytaxUID",
table: "TaskInstance");
migrationBuilder.DropColumn(
name: "BodyPartForEditOther",
table: "SCPStudy");
migrationBuilder.DropColumn(
name: "DicomStudyDate",
table: "SCPStudy");
migrationBuilder.DropColumn(
name: "DicomStudyTime",
table: "SCPStudy");
migrationBuilder.DropColumn(
name: "StudyDIRPath",
table: "SCPStudy");
migrationBuilder.DropColumn(
name: "DicomSeriesDate",
table: "SCPSeries");
migrationBuilder.DropColumn(
name: "DicomSeriesTime",
table: "SCPSeries");
migrationBuilder.DropColumn(
name: "IsEncapsulated",
table: "SCPInstance");
migrationBuilder.DropColumn(
name: "MediaStorageSOPClassUID",
table: "SCPInstance");
migrationBuilder.DropColumn(
name: "MediaStorageSOPInstanceUID",
table: "SCPInstance");
migrationBuilder.DropColumn(
name: "SOPClassUID",
table: "SCPInstance");
migrationBuilder.DropColumn(
name: "TransferSytaxUID",
table: "SCPInstance");
migrationBuilder.DropColumn(
name: "UploadJsonStr",
table: "SCPImageUpload");
}
}
}

View File

@ -7726,6 +7726,10 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
b.Property<Guid>("TrialSiteId")
.HasColumnType("uniqueidentifier");
b.Property<string>("UploadJsonStr")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("CreateUserId");
@ -7786,6 +7790,19 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
b.Property<DateTime?>("InstanceTime")
.HasColumnType("datetime2");
b.Property<bool>("IsEncapsulated")
.HasColumnType("bit");
b.Property<string>("MediaStorageSOPClassUID")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("MediaStorageSOPInstanceUID")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<int>("NumberOfFrames")
.HasColumnType("int");
@ -7799,6 +7816,11 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("SOPClassUID")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<Guid>("SeriesId")
.HasColumnType("uniqueidentifier");
@ -7828,6 +7850,11 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("TransferSytaxUID")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime2");
@ -7977,6 +8004,16 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("DicomSeriesDate")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("DicomSeriesTime")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
@ -8099,6 +8136,11 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("BodyPartForEditOther")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("CalledAE")
.IsRequired()
.HasMaxLength(400)
@ -8126,6 +8168,16 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("DicomStudyDate")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("DicomStudyTime")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
@ -8184,6 +8236,11 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
b.Property<int>("SeriesCount")
.HasColumnType("int");
b.Property<string>("StudyDIRPath")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("StudyId")
.IsRequired()
.HasMaxLength(400)
@ -10309,6 +10366,19 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
b.Property<DateTime?>("InstanceTime")
.HasColumnType("datetime2");
b.Property<bool>("IsEncapsulated")
.HasColumnType("bit");
b.Property<string>("MediaStorageSOPClassUID")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("MediaStorageSOPInstanceUID")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<int>("NumberOfFrames")
.HasColumnType("int");
@ -10322,6 +10392,11 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("SOPClassUID")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<Guid>("SeriesId")
.HasColumnType("uniqueidentifier");
@ -10354,6 +10429,11 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
b.Property<Guid>("SubjectId")
.HasColumnType("uniqueidentifier");
b.Property<string>("TransferSytaxUID")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<Guid>("TrialId")
.HasColumnType("uniqueidentifier");
@ -10625,6 +10705,16 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("DicomSeriesDate")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("DicomSeriesTime")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
@ -10756,6 +10846,11 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("BodyPartForEditOther")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<int>("Code")
.HasColumnType("int");
@ -10776,6 +10871,16 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("DicomStudyDate")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("DicomStudyTime")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
@ -10833,6 +10938,11 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("StudyDIRPath")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("StudyId")
.IsRequired()
.HasMaxLength(400)