From c65a484b13cd68d9466634b64eeeac6a34f0d84d Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 17 Jul 2024 14:20:36 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=82=A3=E8=80=85?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=9F=A5=E8=AF=A2=EF=BC=8C=E5=92=8CModality?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Visit/DTO/PatientViewModel.cs | 7 +++ .../Service/Visit/PatientService.cs | 55 ++++++++++++------- 2 files changed, 41 insertions(+), 21 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs b/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs index 3c257e873..5acd1f0bb 100644 --- a/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs +++ b/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs @@ -1031,6 +1031,8 @@ namespace IRaCIS.Application.Contracts public DateTime? LatestStudyTime { get; set; } public string? Modalities { get; set; } + + public string? PatientInfo { get; set; } } public class VisitPatientStudyFilterView { @@ -1048,6 +1050,11 @@ namespace IRaCIS.Application.Contracts public string CalledAE { get; set; } = string.Empty; public string CallingAE { get; set; } = string.Empty; + + public string PatientIdStr { 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 class PatientStudySimpleView: VisitPatientStudyFilterView diff --git a/IRaCIS.Core.Application/Service/Visit/PatientService.cs b/IRaCIS.Core.Application/Service/Visit/PatientService.cs index 1f04338f8..6cb4ab6d4 100644 --- a/IRaCIS.Core.Application/Service/Visit/PatientService.cs +++ b/IRaCIS.Core.Application/Service/Visit/PatientService.cs @@ -106,12 +106,12 @@ namespace IRaCIS.Application.Services #region new ok - var query = _patientRepository.Where(t=>t.TrialId==inQuery.TrialId) + var query = _patientRepository.Where(t => t.TrialId == inQuery.TrialId) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.PatientIdStr), t => t.PatientIdStr.Contains(inQuery.PatientIdStr)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.PatientName), t => t.PatientName.Contains(inQuery.PatientName)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.SubejctCode), t => t.Subject.Code.Contains(inQuery.SubejctCode)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.TrialSiteKeyInfo), t => t.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteKeyInfo) - || t.TrialSite.TrialSiteAliasName.Contains(inQuery.TrialSiteKeyInfo)|| t.TrialSite.TrialSiteName.Contains(inQuery.TrialSiteKeyInfo)) + || t.TrialSite.TrialSiteAliasName.Contains(inQuery.TrialSiteKeyInfo) || t.TrialSite.TrialSiteName.Contains(inQuery.TrialSiteKeyInfo)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.CallingAE), t => t.SCPStudyList.Any(t => t.CallingAE == inQuery.CallingAE)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.CalledAE), t => t.SCPStudyList.Any(t => t.CalledAE == inQuery.CalledAE)) .WhereIf(inQuery.BeginPushTime != null, t => t.LatestPushTime >= inQuery.BeginPushTime) @@ -146,13 +146,13 @@ namespace IRaCIS.Application.Services StudyCount = patient.SCPStudyList.Count(), - TrialId=patient.TrialId, - SubejctId=patient.SubjectId, - SubjectCode=patient.Subject.Code, - TrialSiteAliasName=patient.TrialSite.TrialSiteAliasName, - TrialSiteCode=patient.TrialSite.TrialSiteCode, - TrialSiteName=patient.TrialSite.TrialSiteName - + TrialId = patient.TrialId, + SubejctId = patient.SubjectId, + SubjectCode = patient.Subject.Code, + TrialSiteAliasName = patient.TrialSite.TrialSiteAliasName, + TrialSiteCode = patient.TrialSite.TrialSiteCode, + TrialSiteName = patient.TrialSite.TrialSiteName + }; @@ -193,9 +193,9 @@ namespace IRaCIS.Application.Services SeriesCount = scpStudy.SeriesCount, StudyTime = scpStudy.StudyTime, - SubjectVisitId= scpStudy.SubjectVisitId, - VisitName=scpStudy.SubjectVisit.VisitName, - BlindName=scpStudy.SubjectVisit.BlindName + SubjectVisitId = scpStudy.SubjectVisitId, + VisitName = scpStudy.SubjectVisit.VisitName, + BlindName = scpStudy.SubjectVisit.BlindName }; @@ -212,7 +212,7 @@ namespace IRaCIS.Application.Services public async Task> GetDicomCalledAEList(Guid trialId) { - var list = await _scpStudyRepository.Where(t=>t.TrialId==trialId).Select(t => t.CalledAE).Distinct().ToListAsync(); + var list = await _scpStudyRepository.Where(t => t.TrialId == trialId).Select(t => t.CalledAE).Distinct().ToListAsync(); return list; } @@ -224,6 +224,13 @@ namespace IRaCIS.Application.Services return list; } + public async Task> GetDicomModalityList(Guid trialId) + { + var list = await _scpStudyRepository.Where(t => t.TrialId == trialId).SelectMany(t => t.SeriesList).Select(t=>t.Modality).Distinct().ToListAsync(); + + return list; + } + /// /// 影像访视上传 检查列表 /// @@ -233,16 +240,17 @@ namespace IRaCIS.Application.Services public async Task> GetVisitPatientStudyFilterList(VisitPatientStudyFilterQuery inQuery) { - var trialSiteId=_subjectRepository.Where(t=>t.Id==inQuery.SubjectId).Select(t=>t.TrialSiteId).FirstOrDefault(); + var trialSiteId = _subjectRepository.Where(t => t.Id == inQuery.SubjectId).Select(t => t.TrialSiteId).FirstOrDefault(); var query = from scpStudy in _scpStudyRepository //未绑定的患者,或者自己已绑定但是未绑定访视的 - .Where(t => t.Patient.SubjectId == null|| (t.Patient.SubjectId == inQuery.SubjectId && t.SubjectVisitId==null)) + .Where(t => t.Patient.SubjectId == null || (t.Patient.SubjectId == inQuery.SubjectId && t.SubjectVisitId == null)) //中心 - .Where(t=>t.TrialSiteId==trialSiteId) + .Where(t => t.TrialSiteId == trialSiteId) .WhereIf(inQuery.EarliestStudyTime != null, t => t.StudyTime >= inQuery.EarliestStudyTime) .WhereIf(inQuery.LatestStudyTime != null, t => t.StudyTime <= inQuery.LatestStudyTime) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.Modalities), t => t.Modalities.Contains(inQuery.Modalities)) + .WhereIf(!string.IsNullOrWhiteSpace(inQuery.PatientInfo), t => t.PatientIdStr.Contains(inQuery.PatientInfo) || t.PatientName.Contains(inQuery.PatientInfo) || t.PatientSex.Contains(inQuery.PatientInfo)) select new VisitPatientStudyFilterView() { Description = scpStudy.Description, @@ -254,6 +262,11 @@ namespace IRaCIS.Application.Services SCPStudyId = scpStudy.Id, SeriesCount = scpStudy.SeriesCount, StudyTime = scpStudy.StudyTime, + + PatientAge = scpStudy.PatientAge, + PatientIdStr = scpStudy.PatientIdStr, + PatientName = scpStudy.PatientName, + PatientSex = scpStudy.PatientSex, }; @@ -276,10 +289,10 @@ namespace IRaCIS.Application.Services { var subjectId = inCommand.SubjectId; - var subjectVisitId=inCommand.SubjectVisitId; + var subjectVisitId = inCommand.SubjectVisitId; var trialId = inCommand.TrialId; - - + + var @lock = _distributedLockProvider.CreateLock($"StudyCode"); @@ -313,7 +326,7 @@ namespace IRaCIS.Application.Services foreach (var series in newSeriesList) { - + series.SeqId = Guid.Empty; series.TrialId = trialId; series.SubjectId = subjectId; @@ -332,7 +345,7 @@ namespace IRaCIS.Application.Services instance.TrialId = trialId; instance.SubjectId = subjectId; instance.SubjectVisitId = subjectVisitId; - + } await _repository.AddRangeAsync(newInstanceList); } From 425bd7bf9ad47876bd7198631225ede854bf0b17 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 17 Jul 2024 14:44:37 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IRaCIS.Core.Application.xml | 13 ++++++++++++ .../Service/Visit/DTO/PatientViewModel.cs | 21 +++++++++++++++++-- .../Service/Visit/PatientService.cs | 5 +++++ 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 3eebc5573..0be0d769e 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -14621,6 +14621,19 @@ + + + 清除跳过阅片的缓存 + + + + + + 设置跳过阅片的缓存 + + + + 获取下一个阅片任务 diff --git a/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs b/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs index 5acd1f0bb..f3c8d4a72 100644 --- a/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs +++ b/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs @@ -1051,16 +1051,33 @@ namespace IRaCIS.Application.Contracts public string CallingAE { get; set; } = string.Empty; + public string BodyPartExamined { get; set; } = string.Empty; + public string PatientIdStr { 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 PatientBirthDate { get; set; } = string.Empty; } - public class PatientStudySimpleView: VisitPatientStudyFilterView + public class PatientStudySimpleView { - + public Guid SCPStudyId { get; set; } + + public Guid PatientId { get; set; } + + 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 CalledAE { get; set; } = string.Empty; + + public string CallingAE { get; set; } = string.Empty; public Guid? SubjectVisitId { get; set; } public string? VisitName { get; set; } diff --git a/IRaCIS.Core.Application/Service/Visit/PatientService.cs b/IRaCIS.Core.Application/Service/Visit/PatientService.cs index 6cb4ab6d4..dc49fe0ad 100644 --- a/IRaCIS.Core.Application/Service/Visit/PatientService.cs +++ b/IRaCIS.Core.Application/Service/Visit/PatientService.cs @@ -192,6 +192,9 @@ namespace IRaCIS.Application.Services SCPStudyId = scpStudy.Id, SeriesCount = scpStudy.SeriesCount, StudyTime = scpStudy.StudyTime, + + + SubjectVisitId = scpStudy.SubjectVisitId, VisitName = scpStudy.SubjectVisit.VisitName, @@ -262,7 +265,9 @@ namespace IRaCIS.Application.Services SCPStudyId = scpStudy.Id, SeriesCount = scpStudy.SeriesCount, StudyTime = scpStudy.StudyTime, + BodyPartExamined=scpStudy.BodyPartExamined, + PatientBirthDate=scpStudy.PatientBirthDate, PatientAge = scpStudy.PatientAge, PatientIdStr = scpStudy.PatientIdStr, PatientName = scpStudy.PatientName, From 0b3542e9c3e69f2d452ca38ffb8e12232f5754b8 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 17 Jul 2024 14:52:53 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E6=82=A3=E8=80=85=E5=B9=B4=E9=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRC.Core.SCP/Service/DicomArchiveService.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/IRC.Core.SCP/Service/DicomArchiveService.cs b/IRC.Core.SCP/Service/DicomArchiveService.cs index 8e66feceb..8632cd4e8 100644 --- a/IRC.Core.SCP/Service/DicomArchiveService.cs +++ b/IRC.Core.SCP/Service/DicomArchiveService.cs @@ -11,6 +11,7 @@ using FellowOakDicom.Network; using IRaCIS.Core.SCP.Service; using IRaCIS.Core.Infra.EFCore; using MassTransit; +using System.Runtime.Intrinsics.X86; namespace IRaCIS.Core.SCP.Service { @@ -115,6 +116,20 @@ namespace IRaCIS.Core.SCP.Service { findPatient.PatientBirthDate = birthDateStr; + DateTime birthDate; + + if (findPatient.PatientAge == string.Empty && studyTime.HasValue && DateTime.TryParse(findPatient.PatientBirthDate,out birthDate)) + { + var patientAge = studyTime.Value.Year - birthDate.Year; + // 如果生日还未到,年龄减去一岁 + if (studyTime.Value < birthDate.AddYears(patientAge)) + { + patientAge--; + } + + findPatient.PatientAge = patientAge.ToString(); + } + } else {