修改患者检查列表和查询
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
42e9c58d7a
commit
b6ceca9744
|
|
@ -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();
|
||||
|
||||
|
||||
#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,
|
||||
|
|
@ -850,7 +861,14 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
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