Merge branch 'Test_HIR_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_HIR_Net8
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
2b01c777a7
|
|
@ -400,7 +400,7 @@ namespace IRaCIS.Core.SCP.Service
|
|||
{
|
||||
try
|
||||
{
|
||||
var scpStudyId = await dicomArchiveService.ArchiveDicomFileAsync(request.Dataset, storeRelativePath, Association.CallingAE, Association.CalledAE, fileSize);
|
||||
var scpStudyId = await dicomArchiveService.ArchiveDicomFileAsync(request.File , storeRelativePath, Association.CallingAE, Association.CalledAE, fileSize);
|
||||
|
||||
var series = await _seriesRepository.FirstOrDefaultAsync(t => t.Id == seriesId);
|
||||
|
||||
|
|
|
|||
|
|
@ -52,8 +52,11 @@ namespace IRaCIS.Core.SCP.Service
|
|||
/// <param name="dataset"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public async Task<Guid> ArchiveDicomFileAsync(DicomDataset dataset, string fileRelativePath, string callingAE, string calledAE, long fileSize)
|
||||
public async Task<Guid> ArchiveDicomFileAsync(DicomFile dicomFile, 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);
|
||||
|
|
@ -272,10 +275,10 @@ namespace IRaCIS.Core.SCP.Service
|
|||
{
|
||||
findSerice.DicomSeriesDate = dataset.GetSingleValueOrDefault(DicomTag.SeriesDate, string.Empty);
|
||||
findSerice.DicomSeriesTime = dataset.GetSingleValueOrDefault(DicomTag.SeriesTime, string.Empty);
|
||||
findSerice.UpdateTime=DateTime.Now;
|
||||
findSerice.UpdateTime = DateTime.Now;
|
||||
}
|
||||
|
||||
var transferSyntaxUID = dataset.GetSingleValueOrDefault(DicomTag.TransferSyntaxUID, string.Empty);
|
||||
var transferSyntaxUID = dicomFile.FileMetaInfo.GetSingleValueOrDefault(DicomTag.TransferSyntaxUID, string.Empty);
|
||||
|
||||
var isEncapsulated = false;
|
||||
if (transferSyntaxUID.IsNotNullOrEmpty())
|
||||
|
|
@ -296,9 +299,9 @@ namespace IRaCIS.Core.SCP.Service
|
|||
|
||||
SopInstanceUid = sopInstanceUid,
|
||||
SOPClassUID = dataset.GetSingleValueOrDefault(DicomTag.SOPClassUID, string.Empty),
|
||||
MediaStorageSOPClassUID = dataset.GetSingleValueOrDefault(DicomTag.MediaStorageSOPClassUID, string.Empty),
|
||||
MediaStorageSOPClassUID = dicomFile.FileMetaInfo.GetSingleValueOrDefault(DicomTag.MediaStorageSOPClassUID, string.Empty),
|
||||
TransferSyntaxUID = transferSyntaxUID,
|
||||
MediaStorageSOPInstanceUID = dataset.GetSingleValueOrDefault(DicomTag.MediaStorageSOPInstanceUID, string.Empty),
|
||||
MediaStorageSOPInstanceUID = dicomFile.FileMetaInfo.GetSingleValueOrDefault(DicomTag.MediaStorageSOPInstanceUID, string.Empty),
|
||||
IsEncapsulated = isEncapsulated,
|
||||
|
||||
InstanceNumber = dataset.GetSingleValueOrDefault(DicomTag.InstanceNumber, 1),
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ namespace IRaCIS.Core.SCP.Service
|
|||
{
|
||||
public interface IDicomArchiveService
|
||||
{
|
||||
Task<Guid> ArchiveDicomFileAsync(DicomDataset dicomDataset,string fileRelativePath,string callingAE,string calledAE,long fileSize);
|
||||
Task<Guid> ArchiveDicomFileAsync(DicomFile dicomFile,string fileRelativePath,string callingAE,string calledAE,long fileSize);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -521,6 +521,20 @@ namespace IRaCIS.Core.Application.Service
|
|||
}
|
||||
|
||||
|
||||
public async Task<UserDetailDTO?> GetUserByEmail(string email)
|
||||
{
|
||||
|
||||
|
||||
var user = await _identityUserRepository.Where(t => t.EMail == email).ProjectTo<UserDetailDTO>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();
|
||||
|
||||
if (user != null)
|
||||
{
|
||||
user.AccountList = await _userRoleRepository.Where(t => t.IdentityUserId == user.Id).ProjectTo<UserAccountInfo>(_mapper.ConfigurationProvider).OrderBy(t => t.UserTypeShortName).ToListAsync();
|
||||
|
||||
}
|
||||
return user;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -1261,7 +1261,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
#region 自动激活一个月
|
||||
|
||||
if (trial.AuthorizationDate == null && trial.AuthorizationEncrypt.IsNotNullOrEmpty())
|
||||
if (trial.AuthorizationDate == null && trial.AuthorizationEncrypt.IsNullOrEmpty())
|
||||
{
|
||||
|
||||
var query = _hIRHospitalRepository.Where(t => t.IsDefault == true).ProjectTo<HIRHospitalView>(_mapper.ConfigurationProvider);
|
||||
|
|
|
|||
|
|
@ -532,13 +532,22 @@ namespace IRaCIS.Application.Contracts
|
|||
|
||||
public class PatientStudyInfoQuery : PageInput
|
||||
{
|
||||
[NotDefault]
|
||||
public Guid PatientId { get; set; }
|
||||
public Guid? PatientId { get; set; }
|
||||
|
||||
public DateTime? EarliestStudyTime { get; set; }
|
||||
|
||||
public DateTime? LatestStudyTime { get; set; }
|
||||
public string? Modalities { get; set; }
|
||||
|
||||
public List<Guid> HospitalGroupIdList { get; set; } = new List<Guid>();
|
||||
|
||||
public List<Guid> PatientHospitalGroupTagIdList { get; set; } = new List<Guid>();
|
||||
|
||||
public string? PatientIdStr { get; set; }
|
||||
public string? PatientName { get; set; }
|
||||
public List<string> CalledAEList { get; set; } = new List<string>();
|
||||
|
||||
public string? CallingAE { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1094,6 +1103,17 @@ namespace IRaCIS.Application.Contracts
|
|||
|
||||
public List<SCPStudyHospitalGroupInfo> ViewHospitalGroupList => HospitalGroupList.Where(t => CurrentUserHospitalGroupList.Any(c => c.Id == t.Id)).ToList();
|
||||
|
||||
public string StudyInstanceUid { get; set; } = string.Empty;
|
||||
#region 检查列表 展示患者信息 联合列表
|
||||
|
||||
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;
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
public class SCPStudyHospitalGroupInfo
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ using System.Dynamic;
|
|||
using System.Threading.Channels;
|
||||
using IRaCIS.Core.Application.Helper.OtherTool;
|
||||
using IRaCIS.Core.Infrastructure.Extention;
|
||||
using NPOI.POIFS.Properties;
|
||||
|
||||
|
||||
namespace IRaCIS.Application.Services
|
||||
|
|
@ -647,6 +648,8 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
#region new ok
|
||||
var query = _patientRepository.Where(t => isAdminOrOA ? true : t.SCPStudyList.Any(c => c.HospitalGroupList.Any(c => currentUserHospitalGroupIdList.Contains(c.HospitalGroupId))))
|
||||
|
||||
.WhereIf(inQuery.CalledAEList.Any(), t => t.SCPStudyList.Any(c=> inQuery.CalledAEList.Contains(c.CalledAE)))
|
||||
.WhereIf(inQuery.HospitalGroupIdList.Any(), t => t.SCPStudyList.Any(c => c.HospitalGroupList.Any(c => inQuery.HospitalGroupIdList.Contains(c.HospitalGroupId))))
|
||||
.WhereIf(inQuery.PatientHospitalGroupTagIdList.Any(), t => t.PatientHospitalGroupTagList.Any(k => inQuery.PatientHospitalGroupTagIdList.Contains(k.HospitalGroupTagId)))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.PatientIdStr), t => t.PatientIdStr.Contains(inQuery.PatientIdStr))
|
||||
|
|
@ -656,11 +659,10 @@ namespace IRaCIS.Application.Services
|
|||
.WhereIf(inQuery.BeginPushTime != null, t => t.LatestPushTime >= inQuery.BeginPushTime)
|
||||
.WhereIf(inQuery.EndPushTime != null, t => t.LatestPushTime <= inQuery.EndPushTime);
|
||||
|
||||
foreach (var calledAE in inQuery.CalledAEList)
|
||||
{
|
||||
query = query.Where(t => t.SCPStudyList.Select(c => c.CalledAE).Contains(calledAE));
|
||||
}
|
||||
|
||||
//foreach (var calledAE in inQuery.CalledAEList)
|
||||
//{
|
||||
// query = query.Where(t => t.SCPStudyList.Select(c => c.CalledAE).Contains(calledAE));
|
||||
//}
|
||||
|
||||
var resultQuery = from patient in query
|
||||
|
||||
|
|
@ -827,11 +829,20 @@ namespace IRaCIS.Application.Services
|
|||
.Where(t => t.IsDisabled == false && t.HospitalGroup.IsEnable).Select(t => t.HospitalGroupId).ToList();
|
||||
}
|
||||
|
||||
var query = from scpStudy in _studyRepository.Where(t => t.PatientId == inQuery.PatientId)
|
||||
var query = from scpStudy in _studyRepository
|
||||
.WhereIf(inQuery.PatientId != null, t => t.PatientId == inQuery.PatientId)
|
||||
.Where(t => isAdminOrOA ? true : t.HospitalGroupList.Any(c => currentUserHospitalGroupIdList.Contains(c.HospitalGroupId)))
|
||||
.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))
|
||||
.Where(t => isAdminOrOA ? true : t.HospitalGroupList.Any(c => currentUserHospitalGroupIdList.Contains(c.HospitalGroupId)))
|
||||
|
||||
.WhereIf(inQuery.CalledAEList.Any(), t => inQuery.CalledAEList.Contains(t.CalledAE))
|
||||
.WhereIf(inQuery.HospitalGroupIdList.Any(), t => t.HospitalGroupList.Any(c => inQuery.HospitalGroupIdList.Contains(c.HospitalGroupId)))
|
||||
.WhereIf(inQuery.PatientHospitalGroupTagIdList.Any(), t => t.Patient.PatientHospitalGroupTagList.Any(k => inQuery.PatientHospitalGroupTagIdList.Contains(k.HospitalGroupTagId)))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.PatientIdStr), t => t.Patient.PatientIdStr.Contains(inQuery.PatientIdStr))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.PatientName), t => t.Patient.PatientName.Contains(inQuery.PatientName))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.CallingAE), t => t.CallingAE == inQuery.CallingAE)
|
||||
select new PatientStudySimpleView()
|
||||
{
|
||||
Description = scpStudy.Description,
|
||||
|
|
@ -845,12 +856,20 @@ namespace IRaCIS.Application.Services
|
|||
SeriesCount = scpStudy.SeriesCount,
|
||||
StudyTime = scpStudy.StudyTime,
|
||||
StudyIdStr = scpStudy.StudyId,
|
||||
StudyInstanceUid= scpStudy.StudyInstanceUid,
|
||||
|
||||
HospitalGroupList = scpStudy.HospitalGroupList.Select(t => new SCPStudyHospitalGroupInfo()
|
||||
{
|
||||
Id = t.HospitalGroupId,
|
||||
Name = t.HospitalGroup.Name
|
||||
}).ToList()
|
||||
}).ToList(),
|
||||
|
||||
|
||||
PatientAge = scpStudy.Patient.PatientAge,
|
||||
PatientName = scpStudy.Patient.PatientName,
|
||||
PatientIdStr = scpStudy.Patient.PatientIdStr,
|
||||
PatientSex = scpStudy.Patient.PatientSex,
|
||||
PatientBirthDate = scpStudy.Patient.PatientBirthDate,
|
||||
};
|
||||
|
||||
var pageList = await query.ToPagedListAsync(inQuery, nameof(PatientStudySimpleView.StudyTime));
|
||||
|
|
|
|||
Loading…
Reference in New Issue