Merge branch 'Test_IRC_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
ab9203eef0
|
@ -11,6 +11,7 @@ using FellowOakDicom.Network;
|
||||||
using IRaCIS.Core.SCP.Service;
|
using IRaCIS.Core.SCP.Service;
|
||||||
using IRaCIS.Core.Infra.EFCore;
|
using IRaCIS.Core.Infra.EFCore;
|
||||||
using MassTransit;
|
using MassTransit;
|
||||||
|
using System.Runtime.Intrinsics.X86;
|
||||||
|
|
||||||
namespace IRaCIS.Core.SCP.Service
|
namespace IRaCIS.Core.SCP.Service
|
||||||
{
|
{
|
||||||
|
@ -115,6 +116,20 @@ namespace IRaCIS.Core.SCP.Service
|
||||||
{
|
{
|
||||||
findPatient.PatientBirthDate = birthDateStr;
|
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
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -14621,6 +14621,19 @@
|
||||||
<param name="inDto"></param>
|
<param name="inDto"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.ClearSkipReadingCache">
|
||||||
|
<summary>
|
||||||
|
清除跳过阅片的缓存
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.SetSkipReadingCache(IRaCIS.Core.Application.Service.Reading.Dto.SetSkipReadingCacheInDto)">
|
||||||
|
<summary>
|
||||||
|
设置跳过阅片的缓存
|
||||||
|
</summary>
|
||||||
|
<param name="inDto"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.GetNextTask(IRaCIS.Core.Application.Service.Reading.Dto.GetNextTaskInDto)">
|
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.GetNextTask(IRaCIS.Core.Application.Service.Reading.Dto.GetNextTaskInDto)">
|
||||||
<summary>
|
<summary>
|
||||||
获取下一个阅片任务
|
获取下一个阅片任务
|
||||||
|
|
|
@ -1031,6 +1031,8 @@ namespace IRaCIS.Application.Contracts
|
||||||
|
|
||||||
public DateTime? LatestStudyTime { get; set; }
|
public DateTime? LatestStudyTime { get; set; }
|
||||||
public string? Modalities { get; set; }
|
public string? Modalities { get; set; }
|
||||||
|
|
||||||
|
public string? PatientInfo { get; set; }
|
||||||
}
|
}
|
||||||
public class VisitPatientStudyFilterView
|
public class VisitPatientStudyFilterView
|
||||||
{
|
{
|
||||||
|
@ -1048,12 +1050,34 @@ namespace IRaCIS.Application.Contracts
|
||||||
public string CalledAE { get; set; } = string.Empty;
|
public string CalledAE { get; set; } = string.Empty;
|
||||||
|
|
||||||
public string CallingAE { get; set; } = string.Empty;
|
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 Guid? SubjectVisitId { get; set; }
|
||||||
public string? VisitName { get; set; }
|
public string? VisitName { get; set; }
|
||||||
|
|
|
@ -106,12 +106,12 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
|
|
||||||
#region new ok
|
#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.PatientIdStr), t => t.PatientIdStr.Contains(inQuery.PatientIdStr))
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.PatientName), t => t.PatientName.Contains(inQuery.PatientName))
|
.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.SubejctCode), t => t.Subject.Code.Contains(inQuery.SubejctCode))
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.TrialSiteKeyInfo), t => t.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteKeyInfo)
|
.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.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(!string.IsNullOrWhiteSpace(inQuery.CalledAE), t => t.SCPStudyList.Any(t => t.CalledAE == inQuery.CalledAE))
|
||||||
.WhereIf(inQuery.BeginPushTime != null, t => t.LatestPushTime >= inQuery.BeginPushTime)
|
.WhereIf(inQuery.BeginPushTime != null, t => t.LatestPushTime >= inQuery.BeginPushTime)
|
||||||
|
@ -146,13 +146,13 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
StudyCount = patient.SCPStudyList.Count(),
|
StudyCount = patient.SCPStudyList.Count(),
|
||||||
|
|
||||||
TrialId=patient.TrialId,
|
TrialId = patient.TrialId,
|
||||||
SubejctId=patient.SubjectId,
|
SubejctId = patient.SubjectId,
|
||||||
SubjectCode=patient.Subject.Code,
|
SubjectCode = patient.Subject.Code,
|
||||||
TrialSiteAliasName=patient.TrialSite.TrialSiteAliasName,
|
TrialSiteAliasName = patient.TrialSite.TrialSiteAliasName,
|
||||||
TrialSiteCode=patient.TrialSite.TrialSiteCode,
|
TrialSiteCode = patient.TrialSite.TrialSiteCode,
|
||||||
TrialSiteName=patient.TrialSite.TrialSiteName
|
TrialSiteName = patient.TrialSite.TrialSiteName
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -192,10 +192,13 @@ namespace IRaCIS.Application.Services
|
||||||
SCPStudyId = scpStudy.Id,
|
SCPStudyId = scpStudy.Id,
|
||||||
SeriesCount = scpStudy.SeriesCount,
|
SeriesCount = scpStudy.SeriesCount,
|
||||||
StudyTime = scpStudy.StudyTime,
|
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 +215,7 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
public async Task<List<string>> GetDicomCalledAEList(Guid trialId)
|
public async Task<List<string>> 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;
|
return list;
|
||||||
}
|
}
|
||||||
|
@ -224,6 +227,13 @@ namespace IRaCIS.Application.Services
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<List<string>> GetDicomModalityList(Guid trialId)
|
||||||
|
{
|
||||||
|
var list = await _scpStudyRepository.Where(t => t.TrialId == trialId).SelectMany(t => t.SeriesList).Select(t=>t.Modality).Distinct().ToListAsync();
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 影像访视上传 检查列表
|
/// 影像访视上传 检查列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -233,16 +243,17 @@ namespace IRaCIS.Application.Services
|
||||||
public async Task<PageOutput<VisitPatientStudyFilterView>> GetVisitPatientStudyFilterList(VisitPatientStudyFilterQuery inQuery)
|
public async Task<PageOutput<VisitPatientStudyFilterView>> 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
|
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.EarliestStudyTime != null, t => t.StudyTime >= inQuery.EarliestStudyTime)
|
||||||
.WhereIf(inQuery.LatestStudyTime != null, t => t.StudyTime <= inQuery.LatestStudyTime)
|
.WhereIf(inQuery.LatestStudyTime != null, t => t.StudyTime <= inQuery.LatestStudyTime)
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Modalities), t => t.Modalities.Contains(inQuery.Modalities))
|
.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()
|
select new VisitPatientStudyFilterView()
|
||||||
{
|
{
|
||||||
Description = scpStudy.Description,
|
Description = scpStudy.Description,
|
||||||
|
@ -254,6 +265,13 @@ namespace IRaCIS.Application.Services
|
||||||
SCPStudyId = scpStudy.Id,
|
SCPStudyId = scpStudy.Id,
|
||||||
SeriesCount = scpStudy.SeriesCount,
|
SeriesCount = scpStudy.SeriesCount,
|
||||||
StudyTime = scpStudy.StudyTime,
|
StudyTime = scpStudy.StudyTime,
|
||||||
|
BodyPartExamined=scpStudy.BodyPartExamined,
|
||||||
|
|
||||||
|
PatientBirthDate=scpStudy.PatientBirthDate,
|
||||||
|
PatientAge = scpStudy.PatientAge,
|
||||||
|
PatientIdStr = scpStudy.PatientIdStr,
|
||||||
|
PatientName = scpStudy.PatientName,
|
||||||
|
PatientSex = scpStudy.PatientSex,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -276,10 +294,10 @@ namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
|
|
||||||
var subjectId = inCommand.SubjectId;
|
var subjectId = inCommand.SubjectId;
|
||||||
var subjectVisitId=inCommand.SubjectVisitId;
|
var subjectVisitId = inCommand.SubjectVisitId;
|
||||||
var trialId = inCommand.TrialId;
|
var trialId = inCommand.TrialId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var @lock = _distributedLockProvider.CreateLock($"StudyCode");
|
var @lock = _distributedLockProvider.CreateLock($"StudyCode");
|
||||||
|
|
||||||
|
@ -313,7 +331,7 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
foreach (var series in newSeriesList)
|
foreach (var series in newSeriesList)
|
||||||
{
|
{
|
||||||
|
|
||||||
series.SeqId = Guid.Empty;
|
series.SeqId = Guid.Empty;
|
||||||
series.TrialId = trialId;
|
series.TrialId = trialId;
|
||||||
series.SubjectId = subjectId;
|
series.SubjectId = subjectId;
|
||||||
|
@ -332,7 +350,7 @@ namespace IRaCIS.Application.Services
|
||||||
instance.TrialId = trialId;
|
instance.TrialId = trialId;
|
||||||
instance.SubjectId = subjectId;
|
instance.SubjectId = subjectId;
|
||||||
instance.SubjectVisitId = subjectVisitId;
|
instance.SubjectVisitId = subjectVisitId;
|
||||||
|
|
||||||
}
|
}
|
||||||
await _repository.AddRangeAsync(newInstanceList);
|
await _repository.AddRangeAsync(newInstanceList);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue