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
34f52d8218
|
|
@ -46,6 +46,10 @@ namespace IRaCIS.Core.SCP.Service
|
||||||
|
|
||||||
private SCPImageUpload _upload { get; set; }
|
private SCPImageUpload _upload { get; set; }
|
||||||
|
|
||||||
|
public HospitalGroup CurrentHospitalGroup { get; set; }
|
||||||
|
|
||||||
|
private List<Guid> HospitalGroupIdList { get; set; }
|
||||||
|
|
||||||
|
|
||||||
private static readonly DicomTransferSyntax[] _acceptedTransferSyntaxes = new DicomTransferSyntax[]
|
private static readonly DicomTransferSyntax[] _acceptedTransferSyntaxes = new DicomTransferSyntax[]
|
||||||
{
|
{
|
||||||
|
|
@ -99,11 +103,19 @@ namespace IRaCIS.Core.SCP.Service
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var _hospitalGroupRepository = _serviceProvider.GetService<IRepository<HospitalGroup>>();
|
||||||
|
|
||||||
|
|
||||||
|
var list = _hospitalGroupRepository.Where(t => t.IsEnable).ToList();
|
||||||
|
|
||||||
|
CurrentHospitalGroup = list.FirstOrDefault(t => t.CallingAE == Association.CallingAE);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var calledAEList = option.CalledAEList;
|
var calledAEList = option.CalledAEList;
|
||||||
|
|
||||||
if (!calledAEList.Contains(association.CalledAE))
|
if (!calledAEList.Contains(association.CalledAE))
|
||||||
|
|
||||||
//if (association.CalledAE != "STORESCP")
|
|
||||||
{
|
{
|
||||||
|
|
||||||
Log.Logger.Warning($"拒绝CalledAE:{association.CalledAE}的连接");
|
Log.Logger.Warning($"拒绝CalledAE:{association.CalledAE}的连接");
|
||||||
|
|
@ -169,11 +181,14 @@ namespace IRaCIS.Core.SCP.Service
|
||||||
var _dictionaryRepository = _serviceProvider.GetService<IRepository<Dictionary>>();
|
var _dictionaryRepository = _serviceProvider.GetService<IRepository<Dictionary>>();
|
||||||
var _seriesRepository = _serviceProvider.GetService<IRepository<SCPSeries>>();
|
var _seriesRepository = _serviceProvider.GetService<IRepository<SCPSeries>>();
|
||||||
var _studyRepository = _serviceProvider.GetService<IRepository<SCPStudy>>();
|
var _studyRepository = _serviceProvider.GetService<IRepository<SCPStudy>>();
|
||||||
|
var _studyGroupRepository = _serviceProvider.GetService<IRepository<SCPStudyHospitalGroup>>();
|
||||||
|
|
||||||
|
var _cmoveStudyRepository = _serviceProvider.GetService<IRepository<CmoveStudy>>();
|
||||||
|
|
||||||
var dicModalityList = _dictionaryRepository.Where(t => t.Code == "Modality").SelectMany(t => t.ChildList.Select(c => c.Value)).ToList();
|
var dicModalityList = _dictionaryRepository.Where(t => t.Code == "Modality").SelectMany(t => t.ChildList.Select(c => c.Value)).ToList();
|
||||||
var seriesModalityList = _seriesRepository.Where(t => _SCPStudyIdList.Contains(t.StudyId)).Select(t => new { SCPStudyId = t.StudyId, t.Modality }).ToList();
|
var seriesModalityList = _seriesRepository.Where(t => _SCPStudyIdList.Contains(t.StudyId)).Select(t => new { SCPStudyId = t.StudyId, t.Modality, t.StudyInstanceUid }).ToList();
|
||||||
|
|
||||||
foreach (var g in seriesModalityList.GroupBy(t => t.SCPStudyId))
|
foreach (var g in seriesModalityList.GroupBy(t => new { t.SCPStudyId, t.StudyInstanceUid }))
|
||||||
{
|
{
|
||||||
var modality = string.Join('、', g.Select(t => t.Modality).Distinct().ToList());
|
var modality = string.Join('、', g.Select(t => t.Modality).Distinct().ToList());
|
||||||
|
|
||||||
|
|
@ -194,7 +209,32 @@ namespace IRaCIS.Core.SCP.Service
|
||||||
modalityForEdit = "PET-CT";
|
modalityForEdit = "PET-CT";
|
||||||
}
|
}
|
||||||
|
|
||||||
await _studyRepository.BatchUpdateNoTrackingAsync(t => t.Id == g.Key, u => new SCPStudy() { Modalities = modality, ModalityForEdit = modalityForEdit });
|
await _studyRepository.BatchUpdateNoTrackingAsync(t => t.Id == g.Key.SCPStudyId, u => new SCPStudy() { Modalities = modality, ModalityForEdit = modalityForEdit });
|
||||||
|
|
||||||
|
//添加课题组标签
|
||||||
|
if (CurrentHospitalGroup != null)
|
||||||
|
{
|
||||||
|
if (!_studyGroupRepository.Any(t => t.SCPStudyId == g.Key.SCPStudyId && t.HospitalGroupId == CurrentHospitalGroup.Id))
|
||||||
|
{
|
||||||
|
await _studyGroupRepository.AddAsync(new SCPStudyHospitalGroup() { SCPStudyId = g.Key.SCPStudyId, HospitalGroupId = CurrentHospitalGroup.Id });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var findCmoveInfo = _cmoveStudyRepository.Where(t => t.StudyInstanceUIDList.Any(c => c == g.Key.StudyInstanceUid)).OrderByDescending(t => t.CreateTime).FirstOrDefault();
|
||||||
|
|
||||||
|
if (findCmoveInfo != null)
|
||||||
|
{
|
||||||
|
foreach (var item in findCmoveInfo.HopitalGroupIdList)
|
||||||
|
{
|
||||||
|
await _studyGroupRepository.AddAsync(new SCPStudyHospitalGroup() { SCPStudyId = g.Key.SCPStudyId, HospitalGroupId = item });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log.Logger.Error($"未找到{g.Key.StudyInstanceUid}的Cmove记录");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,7 @@
|
||||||
"FromEmail": "test-study@extimaging.com",
|
"FromEmail": "test-study@extimaging.com",
|
||||||
"FromName": "Test_HIR",
|
"FromName": "Test_HIR",
|
||||||
"AuthorizationCode": "zhanying123",
|
"AuthorizationCode": "zhanying123",
|
||||||
"SiteUrl": "http://hir.test.extimaging.com/login"
|
"SiteUrl": "http://hir.test.extimaging.com/login",
|
||||||
|
"EmailRegexStr": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -171,6 +171,8 @@ namespace IRaCIS.Application.Contracts
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
|
|
||||||
public List<UserAccountInfo> AccountList { get; set; }
|
public List<UserAccountInfo> AccountList { get; set; }
|
||||||
|
|
||||||
|
public List<Guid> HospitalGroupIdList { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class UserInfo
|
public class UserInfo
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,8 @@ namespace IRaCIS.Core.Application.Service
|
||||||
CreateMap<UserType, TrialUserType>()
|
CreateMap<UserType, TrialUserType>()
|
||||||
.ForMember(d => d.UserType, u => u.MapFrom(t => t.UserTypeName));
|
.ForMember(d => d.UserType, u => u.MapFrom(t => t.UserTypeName));
|
||||||
|
|
||||||
CreateMap<IdentityUser, UserDetailDTO>();
|
CreateMap<IdentityUser, UserDetailDTO>()
|
||||||
|
.ForMember(d => d.HospitalGroupIdList, u => u.MapFrom(s => s.IdentityUserHospitalGroupList.Select(t => t.HospitalGroupId)));
|
||||||
|
|
||||||
|
|
||||||
CreateMap<IdentityUser, UserListDTO>()
|
CreateMap<IdentityUser, UserListDTO>()
|
||||||
|
|
@ -149,8 +150,9 @@ namespace IRaCIS.Core.Application.Service
|
||||||
CreateMap<UserRole, IdentityUserTypeDTO>()
|
CreateMap<UserRole, IdentityUserTypeDTO>()
|
||||||
.ForMember(d => d.UserTypeShortName, c => c.MapFrom(t => t.UserTypeRole.UserTypeShortName));
|
.ForMember(d => d.UserTypeShortName, c => c.MapFrom(t => t.UserTypeRole.UserTypeShortName));
|
||||||
|
|
||||||
|
CreateMap<UserAddUserType, UserRole>();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -472,8 +472,13 @@ namespace IRaCIS.Application.Contracts
|
||||||
|
|
||||||
public class TrialUserAddCommand
|
public class TrialUserAddCommand
|
||||||
{
|
{
|
||||||
|
[NotDefault]
|
||||||
|
public Guid IdentityUserId { get; set; }
|
||||||
|
|
||||||
|
[NotDefault]
|
||||||
public Guid UserId { get; set; }
|
public Guid UserId { get; set; }
|
||||||
|
|
||||||
|
[NotDefault]
|
||||||
public Guid TrialId { get; set; }
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -165,19 +165,47 @@ namespace IRaCIS.Core.Application.Service
|
||||||
public async Task<IResponseOutput> AddTrialUsers(TrialUserAddCommand[] userTrialCommands)
|
public async Task<IResponseOutput> AddTrialUsers(TrialUserAddCommand[] userTrialCommands)
|
||||||
{
|
{
|
||||||
|
|
||||||
var addArray = _mapper.Map<TrialUserRole[]>(userTrialCommands);
|
foreach (var item in userTrialCommands.GroupBy(t => t.IdentityUserId))
|
||||||
|
|
||||||
var trialUsers = await _trialUseRoleRepository.AddRangeAsync(addArray);
|
|
||||||
|
|
||||||
foreach (var item in trialUsers)
|
|
||||||
{
|
{
|
||||||
item.JoinTime = DateTime.Now;
|
var currentUserRoleList = item.ToList();
|
||||||
|
|
||||||
|
var first = currentUserRoleList.FirstOrDefault();
|
||||||
|
|
||||||
|
var findTrialuser = await _trialIdentityUserRepository.Where(t => t.TrialId == first.TrialId && t.IdentityUserId == item.Key, true, true).Include(t => t.TrialUserRoleList).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
if (findTrialuser == null)
|
||||||
|
{
|
||||||
|
var currentUser = new TrialIdentityUser()
|
||||||
|
{
|
||||||
|
TrialId = first.TrialId,
|
||||||
|
IdentityUserId = item.Key,
|
||||||
|
JoinTime = DateTime.Now,
|
||||||
|
TrialUserRoleList = currentUserRoleList.Select(t => new TrialUserRole() { UserId = t.UserId, TrialId = t.TrialId }).ToList()
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
await _trialIdentityUserRepository.AddAsync(currentUser);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (findTrialuser.IsDeleted == true)
|
||||||
|
{
|
||||||
|
findTrialuser.IsDeleted = false;
|
||||||
|
findTrialuser.DeletedTime = null;
|
||||||
|
findTrialuser.JoinTime = DateTime.Now;
|
||||||
|
findTrialuser.RemoveTime = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
findTrialuser.TrialUserRoleList.AddRange(currentUserRoleList.Select(t => new TrialUserRole() { UserId = t.UserId, TrialId = t.TrialId, TrialUserId = findTrialuser.Id }).ToList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var success = await _trialUseRoleRepository.SaveChangesAsync();
|
|
||||||
|
|
||||||
return ResponseOutput.Result(success);
|
var success = await _trialIdentityUserRepository.SaveChangesAsync();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return ResponseOutput.Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,10 @@ public class HospitalGroupAddOrEdit
|
||||||
|
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public bool IsEnable { get; set; }
|
||||||
|
|
||||||
|
public string CallingAE { get; set; }
|
||||||
|
|
||||||
public List<Guid> IdentityUserIdList { get; set; }
|
public List<Guid> IdentityUserIdList { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -49,6 +53,10 @@ public class HospitalGroupQuery : PageInput
|
||||||
public string? ContactPhone { get; set; }
|
public string? ContactPhone { get; set; }
|
||||||
|
|
||||||
public string? Name { get; set; }
|
public string? Name { get; set; }
|
||||||
|
|
||||||
|
public bool? IsEnable { get; set; }
|
||||||
|
|
||||||
|
public string? CallingAE { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,8 @@ namespace IRaCIS.Application.Contracts
|
||||||
public int? UnSubmitCount { get; set; }
|
public int? UnSubmitCount { get; set; }
|
||||||
|
|
||||||
public int? UnReadCount { get; set; }
|
public int? UnReadCount { get; set; }
|
||||||
|
|
||||||
|
public string HospitalGroupName { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class NewTrialQuery : PageInput
|
public class NewTrialQuery : PageInput
|
||||||
|
|
@ -276,7 +278,7 @@ namespace IRaCIS.Application.Contracts
|
||||||
|
|
||||||
public List<string> CurrentUserHospitalGroupList { get; set; } = new List<string>();
|
public List<string> CurrentUserHospitalGroupList { get; set; } = new List<string>();
|
||||||
|
|
||||||
public List<string> ViewHospitalGroupList => StudyHospitalGroupList.Except(CurrentUserHospitalGroupList).ToList();
|
public List<string> ViewHospitalGroupList => StudyHospitalGroupList.Intersect(CurrentUserHospitalGroupList).ToList();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -525,7 +527,7 @@ namespace IRaCIS.Application.Contracts
|
||||||
|
|
||||||
public class SCPStudyHospitalGroupCommand
|
public class SCPStudyHospitalGroupCommand
|
||||||
{
|
{
|
||||||
public Guid HospitalGroupId { get; set; }
|
public List<Guid> HospitalGroupIdList { get; set; }
|
||||||
public List<Guid> SCPstudyIdList { get; set; }
|
public List<Guid> SCPstudyIdList { get; set; }
|
||||||
|
|
||||||
public int AddOrDelete { get; set; }
|
public int AddOrDelete { get; set; }
|
||||||
|
|
@ -1067,7 +1069,7 @@ namespace IRaCIS.Application.Contracts
|
||||||
|
|
||||||
public List<SCPStudyHospitalGroupInfo> HospitalGroupList { get; set; }
|
public List<SCPStudyHospitalGroupInfo> HospitalGroupList { get; set; }
|
||||||
|
|
||||||
public List<HospitalGroupInfo> CurrentUserHospitalGroupList { get; set; }
|
public List<HospitalGroupInfo> CurrentUserHospitalGroupList { get; set; } = new List<HospitalGroupInfo>();
|
||||||
|
|
||||||
public List<SCPStudyHospitalGroupInfo> ViewHospitalGroupList => HospitalGroupList.Where(t => CurrentUserHospitalGroupList.Any(c => c.Id == t.Id)).ToList();
|
public List<SCPStudyHospitalGroupInfo> ViewHospitalGroupList => HospitalGroupList.Where(t => CurrentUserHospitalGroupList.Any(c => c.Id == t.Id)).ToList();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,8 @@ namespace IRaCIS.Application.Contracts
|
||||||
public Guid PacsDicomAEId { get; set; }
|
public Guid PacsDicomAEId { get; set; }
|
||||||
|
|
||||||
public List<string> StudyInstanceUIDList { get; set; }
|
public List<string> StudyInstanceUIDList { get; set; }
|
||||||
|
|
||||||
|
public List<Guid> HospitalGroupIdList { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SCUStudyView : SCUBasicInfo
|
public class SCUStudyView : SCUBasicInfo
|
||||||
|
|
@ -60,6 +62,12 @@ namespace IRaCIS.Application.Contracts
|
||||||
|
|
||||||
public string? ModalitiesInStudy { get; set; }
|
public string? ModalitiesInStudy { get; set; }
|
||||||
|
|
||||||
|
public List<HospitalGroupInfo> HospitalGroupList { get; set; }
|
||||||
|
|
||||||
|
public List<HospitalGroupInfo> CurrentUserHospitalGroupList { get; set; } = new List<HospitalGroupInfo>();
|
||||||
|
|
||||||
|
public List<HospitalGroupInfo> ViewHospitalGroupList => HospitalGroupList.Where(t => CurrentUserHospitalGroupList.Any(c => c.Id == t.Id)).ToList();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TJCmoveStudyCommand
|
public class TJCmoveStudyCommand
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ public class HospitalGroupService(IRepository<HospitalGroup> _hospitalGroupRepos
|
||||||
|
|
||||||
public async Task<List<HospitalGroupAdminUserInfo>> GetGAUserList()
|
public async Task<List<HospitalGroupAdminUserInfo>> GetGAUserList()
|
||||||
{
|
{
|
||||||
var list = await _identityUserRepository.Where(t => t.UserRoleList.Any(t => t.UserTypeEnum == UserTypeEnum.GA)).ProjectTo<HospitalGroupAdminUserInfo>(_mapper.ConfigurationProvider).ToListAsync();
|
var list = await _identityUserRepository.Where(t => t.UserRoleList.Any(t => t.UserTypeEnum == UserTypeEnum.GA && t.IsUserRoleDisabled == false)).ProjectTo<HospitalGroupAdminUserInfo>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
@ -47,6 +47,9 @@ public class HospitalGroupService(IRepository<HospitalGroup> _hospitalGroupRepos
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Affiliation), t => t.Affiliation.Contains(inQuery.Affiliation))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Affiliation), t => t.Affiliation.Contains(inQuery.Affiliation))
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ContactPhone), t => t.ContactPhone.Contains(inQuery.ContactPhone))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ContactPhone), t => t.ContactPhone.Contains(inQuery.ContactPhone))
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ContactName), t => t.ContactName.Contains(inQuery.ContactName))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ContactName), t => t.ContactName.Contains(inQuery.ContactName))
|
||||||
|
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.GA, t => _userInfo.HospitalGroupIdList.Contains(t.Id))
|
||||||
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.CallingAE), t => t.CallingAE.Contains(inQuery.CallingAE))
|
||||||
|
.WhereIf(inQuery.IsEnable != null, t => t.IsEnable == inQuery.IsEnable)
|
||||||
.ProjectTo<HospitalGroupView>(_mapper.ConfigurationProvider);
|
.ProjectTo<HospitalGroupView>(_mapper.ConfigurationProvider);
|
||||||
|
|
||||||
var pageList = await hospitalGroupQueryable.SortToListAsync(inQuery);
|
var pageList = await hospitalGroupQueryable.SortToListAsync(inQuery);
|
||||||
|
|
@ -69,6 +72,8 @@ public class HospitalGroupService(IRepository<HospitalGroup> _hospitalGroupRepos
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Affiliation), t => t.Affiliation.Contains(inQuery.Affiliation))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Affiliation), t => t.Affiliation.Contains(inQuery.Affiliation))
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ContactPhone), t => t.ContactPhone.Contains(inQuery.ContactPhone))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ContactPhone), t => t.ContactPhone.Contains(inQuery.ContactPhone))
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ContactName), t => t.ContactName.Contains(inQuery.ContactName))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ContactName), t => t.ContactName.Contains(inQuery.ContactName))
|
||||||
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.CallingAE), t => t.CallingAE.Contains(inQuery.CallingAE))
|
||||||
|
.WhereIf(!inQuery.IsEnable != null, t => t.IsEnable == inQuery.IsEnable)
|
||||||
.ProjectTo<HospitalGroupView>(_mapper.ConfigurationProvider);
|
.ProjectTo<HospitalGroupView>(_mapper.ConfigurationProvider);
|
||||||
|
|
||||||
var pageList = await hospitalGroupQueryable.ToPagedListAsync(inQuery);
|
var pageList = await hospitalGroupQueryable.ToPagedListAsync(inQuery);
|
||||||
|
|
@ -108,7 +113,7 @@ public class HospitalGroupService(IRepository<HospitalGroup> _hospitalGroupRepos
|
||||||
var adminUserList = addOrEditHospitalGroup.IdentityUserIdList.Select(t => new HospitalGroupIdentityUser() { IdentityUserId = t, HospitalGroupId = (Guid)addOrEditHospitalGroup.Id, IsManager = true }).ToList();
|
var adminUserList = addOrEditHospitalGroup.IdentityUserIdList.Select(t => new HospitalGroupIdentityUser() { IdentityUserId = t, HospitalGroupId = (Guid)addOrEditHospitalGroup.Id, IsManager = true }).ToList();
|
||||||
|
|
||||||
await _hospitalGroupIdentityUserRepository.AddRangeAsync(adminUserList);
|
await _hospitalGroupIdentityUserRepository.AddRangeAsync(adminUserList);
|
||||||
var entity = await _hospitalGroupRepository.UpdateFromDTOAsync(addOrEditHospitalGroup, false, false, verifyExp1);
|
var entity = await _hospitalGroupRepository.UpdateFromDTOAsync(addOrEditHospitalGroup, true, false, verifyExp1);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -121,7 +126,15 @@ public class HospitalGroupService(IRepository<HospitalGroup> _hospitalGroupRepos
|
||||||
[HttpDelete("{hospitalGroupId:guid}")]
|
[HttpDelete("{hospitalGroupId:guid}")]
|
||||||
public async Task<IResponseOutput> DeleteHospitalGroup(Guid hospitalGroupId)
|
public async Task<IResponseOutput> DeleteHospitalGroup(Guid hospitalGroupId)
|
||||||
{
|
{
|
||||||
var success = await _hospitalGroupRepository.DeleteFromQueryAsync(t => t.Id == hospitalGroupId, true);
|
if (_hospitalGroupIdentityUserRepository.Any(t => t.HospitalGroupId == hospitalGroupId && t.IsManager == false))
|
||||||
|
{
|
||||||
|
return ResponseOutput.NotOk(_localizer["HospitalGroup_ExistUser"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
var success = await _hospitalGroupRepository.DeleteFromQueryAsync(t => t.Id == hospitalGroupId);
|
||||||
|
|
||||||
|
await _hospitalGroupIdentityUserRepository.DeleteFromQueryAsync(t => t.Id == hospitalGroupId && t.IsManager, true);
|
||||||
|
|
||||||
return ResponseOutput.Ok();
|
return ResponseOutput.Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,8 @@ using System.Threading.Channels;
|
||||||
using NPOI.HSSF.Record.Chart;
|
using NPOI.HSSF.Record.Chart;
|
||||||
using IRaCIS.Core.Application.Helper.OtherTool;
|
using IRaCIS.Core.Application.Helper.OtherTool;
|
||||||
using IRaCIS.Core.Infrastructure.Extention;
|
using IRaCIS.Core.Infrastructure.Extention;
|
||||||
|
using DocumentFormat.OpenXml.Drawing.Charts;
|
||||||
|
using DocumentFormat.OpenXml.Drawing.Diagrams;
|
||||||
|
|
||||||
|
|
||||||
namespace IRaCIS.Application.Services
|
namespace IRaCIS.Application.Services
|
||||||
|
|
@ -62,7 +64,9 @@ namespace IRaCIS.Application.Services
|
||||||
public class PatientService(IRepository<SCPStudySubjectVisit> _studySubjectVisitRepository,
|
public class PatientService(IRepository<SCPStudySubjectVisit> _studySubjectVisitRepository,
|
||||||
IRepository<SubjectPatient> _subjectPatientRepository, IRepository<SCPStudyHospitalGroup> _SCPStudyHospitalGroupRepository,
|
IRepository<SubjectPatient> _subjectPatientRepository, IRepository<SCPStudyHospitalGroup> _SCPStudyHospitalGroupRepository,
|
||||||
IRepository<Trial> _trialRepository,
|
IRepository<Trial> _trialRepository,
|
||||||
|
IRepository<CmoveStudy> _cmoveStudyRepository,
|
||||||
IRepository<SCPPatient> _patientRepository,
|
IRepository<SCPPatient> _patientRepository,
|
||||||
|
IRepository<HospitalGroup> _hospitalGroupRepository,
|
||||||
IRepository<SCPStudy> _studyRepository,
|
IRepository<SCPStudy> _studyRepository,
|
||||||
IRepository<Subject> _subjectRepository,
|
IRepository<Subject> _subjectRepository,
|
||||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||||
|
|
@ -137,7 +141,7 @@ namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
var exp = new EntityVerifyExp<HIRHospital>()
|
var exp = new EntityVerifyExp<HIRHospital>()
|
||||||
{
|
{
|
||||||
VerifyExp = h => h.IsDefault.Equals(addOrEditHIRHospital.IsDefault),
|
VerifyExp = h => h.IsDefault.Equals(addOrEditHIRHospital.IsDefault) && addOrEditHIRHospital.IsDefault == true,
|
||||||
|
|
||||||
//"默认医院只允许一个"
|
//"默认医院只允许一个"
|
||||||
VerifyMsg = _localizer["Patient_OnlyOneDefaultHospital"]
|
VerifyMsg = _localizer["Patient_OnlyOneDefaultHospital"]
|
||||||
|
|
@ -270,6 +274,8 @@ namespace IRaCIS.Application.Services
|
||||||
// throw new BusinessValidationFailedException($"已超过当前系统配置的未启动项目数量的限制,您的操作被限制,请获取授权再进行操作!");
|
// throw new BusinessValidationFailedException($"已超过当前系统配置的未启动项目数量的限制,您的操作被限制,请获取授权再进行操作!");
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
var hospitalInfo = await _fusionCache.GetOrSetAsync(CacheKeys.Hospital, _ => CacheHelper.GetHospitalCode(_hIRHospitalRepository), TimeSpan.FromDays(7));
|
||||||
|
|
||||||
inCommand.ResearchProgramNo = inCommand.ResearchProgramNo.Trim();
|
inCommand.ResearchProgramNo = inCommand.ResearchProgramNo.Trim();
|
||||||
|
|
||||||
if (inCommand.Id == Guid.Empty || inCommand.Id == null)
|
if (inCommand.Id == Guid.Empty || inCommand.Id == null)
|
||||||
|
|
@ -330,6 +336,8 @@ namespace IRaCIS.Application.Services
|
||||||
trial.IsConfigureEmail = true;
|
trial.IsConfigureEmail = true;
|
||||||
trial.CreateTime = DateTime.Now;
|
trial.CreateTime = DateTime.Now;
|
||||||
|
|
||||||
|
trial.HospitalId = hospitalInfo.Id;
|
||||||
|
|
||||||
var success = await _trialRepository.SaveChangesAsync();
|
var success = await _trialRepository.SaveChangesAsync();
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -660,7 +668,7 @@ namespace IRaCIS.Application.Services
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var allHospitalGroupList = _hospitalGroupRepository.Where(t => t.IsEnable).Select(t => t.Name).ToList();
|
||||||
|
|
||||||
var pageList = await resultQuery.ToPagedListAsync(inQuery, nameof(PatientQueryView.PatientIdStr));
|
var pageList = await resultQuery.ToPagedListAsync(inQuery, nameof(PatientQueryView.PatientIdStr));
|
||||||
|
|
||||||
|
|
@ -669,6 +677,8 @@ namespace IRaCIS.Application.Services
|
||||||
if (isAdminOrOA)
|
if (isAdminOrOA)
|
||||||
{
|
{
|
||||||
//不处理,默认看所有
|
//不处理,默认看所有
|
||||||
|
|
||||||
|
item.CurrentUserHospitalGroupList = allHospitalGroupList;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -790,11 +800,15 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
var pageList = await query.ToPagedListAsync(inQuery, nameof(PatientStudySimpleView.StudyTime));
|
var pageList = await query.ToPagedListAsync(inQuery, nameof(PatientStudySimpleView.StudyTime));
|
||||||
|
|
||||||
|
var allHospitalGroupList = _hospitalGroupRepository.Where(t => t.IsEnable).Select(t => new HospitalGroupInfo() { Id = t.Id, Code = t.Code, Name = t.Name }).ToList();
|
||||||
|
|
||||||
foreach (var item in pageList.CurrentPageData)
|
foreach (var item in pageList.CurrentPageData)
|
||||||
{
|
{
|
||||||
if (isAdminOrOA)
|
if (isAdminOrOA)
|
||||||
{
|
{
|
||||||
//不处理,默认看所有
|
//不处理,默认看所有
|
||||||
|
|
||||||
|
item.CurrentUserHospitalGroupList = allHospitalGroupList;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -806,7 +820,7 @@ namespace IRaCIS.Application.Services
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 修改检查课题组 1是添加 2是删除
|
/// 修改检查课题组 1是添加 2是删除,3是更新
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="incommand"></param>
|
/// <param name="incommand"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
|
@ -818,19 +832,48 @@ namespace IRaCIS.Application.Services
|
||||||
//添加
|
//添加
|
||||||
foreach (var item in incommand.SCPstudyIdList)
|
foreach (var item in incommand.SCPstudyIdList)
|
||||||
{
|
{
|
||||||
await _SCPStudyHospitalGroupRepository.AddAsync(new SCPStudyHospitalGroup() { SCPStudyId = item, HospitalGroupId = incommand.HospitalGroupId });
|
foreach (var hospitalGroupId in incommand.HospitalGroupIdList)
|
||||||
|
{
|
||||||
|
if (!_SCPStudyHospitalGroupRepository.Any(t => t.SCPStudyId == item && hospitalGroupId == t.HospitalGroupId))
|
||||||
|
{
|
||||||
|
await _SCPStudyHospitalGroupRepository.AddAsync(new SCPStudyHospitalGroup() { SCPStudyId = item, HospitalGroupId = hospitalGroupId });
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (incommand.AddOrDelete == 2)
|
||||||
{
|
{
|
||||||
//删除
|
//删除
|
||||||
foreach (var item in incommand.SCPstudyIdList)
|
foreach (var item in incommand.SCPstudyIdList)
|
||||||
{
|
{
|
||||||
await _SCPStudyHospitalGroupRepository.DeleteFromQueryAsync(t => t.HospitalGroupId == incommand.HospitalGroupId && t.SCPStudyId == item);
|
foreach (var hospitalGroupId in incommand.HospitalGroupIdList)
|
||||||
|
{
|
||||||
|
await _SCPStudyHospitalGroupRepository.DeleteFromQueryAsync(t => t.HospitalGroupId == hospitalGroupId && t.SCPStudyId == item);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (incommand.AddOrDelete == 3)
|
||||||
|
{
|
||||||
|
//更新
|
||||||
|
foreach (var item in incommand.SCPstudyIdList)
|
||||||
|
{
|
||||||
|
await _SCPStudyHospitalGroupRepository.BatchDeleteNoTrackingAsync(t => t.SCPStudyId == item);
|
||||||
|
|
||||||
|
foreach (var hospitalGroupId in incommand.HospitalGroupIdList)
|
||||||
|
{
|
||||||
|
await _SCPStudyHospitalGroupRepository.AddAsync(new SCPStudyHospitalGroup() { SCPStudyId = item, HospitalGroupId = hospitalGroupId });
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
await _SCPStudyHospitalGroupRepository.SaveChangesAsync();
|
await _SCPStudyHospitalGroupRepository.SaveChangesAsync();
|
||||||
|
|
||||||
|
|
@ -3338,11 +3381,29 @@ namespace IRaCIS.Application.Services
|
||||||
var resultInstanceUidList = result.Select(t => t.StudyInstanceUID).ToList();
|
var resultInstanceUidList = result.Select(t => t.StudyInstanceUID).ToList();
|
||||||
|
|
||||||
var existStudyIdList = _studyRepository.Where(t => resultInstanceUidList.Contains(t.StudyInstanceUid))
|
var existStudyIdList = _studyRepository.Where(t => resultInstanceUidList.Contains(t.StudyInstanceUid))
|
||||||
.Select(t => t.StudyInstanceUid).ToList();
|
.Select(t => new { t.StudyInstanceUid, HospitalGroupList = t.HospitalGroupList.Select(t => new HospitalGroupInfo { Id = t.HospitalGroupId, Name = t.HospitalGroup.Name, Code = t.HospitalGroup.Code }).ToList() }).ToList();
|
||||||
|
|
||||||
|
var allHospitalGroupList = _hospitalGroupRepository.Where(t => t.IsEnable).Select(t => new HospitalGroupInfo() { Name = t.Name, Id = t.Id, Code = t.Code }).ToList();
|
||||||
|
|
||||||
|
var isAdminOrOA = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.Admin || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.OA || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin;
|
||||||
|
|
||||||
|
|
||||||
foreach (var item in result)
|
foreach (var item in result)
|
||||||
{
|
{
|
||||||
item.IsStudyExist = existStudyIdList.Any(t => t == item.StudyInstanceUID);
|
item.IsStudyExist = existStudyIdList.Any(t => t.StudyInstanceUid == item.StudyInstanceUID);
|
||||||
|
item.HospitalGroupList = existStudyIdList.FirstOrDefault(t => t.StudyInstanceUid == item.StudyInstanceUID)?.HospitalGroupList;
|
||||||
|
|
||||||
|
if (isAdminOrOA)
|
||||||
|
{
|
||||||
|
//不处理,默认看所有
|
||||||
|
|
||||||
|
item.CurrentUserHospitalGroupList = allHospitalGroupList;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
item.CurrentUserHospitalGroupList = _userInfo.HospitalGroupList.Select(t => new HospitalGroupInfo() { Code = t.Code, Id = t.Id, Name = t.Name }).ToList();
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -3478,6 +3539,8 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
var cmoveRequestList = new List<DicomCMoveRequest>();
|
var cmoveRequestList = new List<DicomCMoveRequest>();
|
||||||
|
|
||||||
|
var cmoveStudyUIdList = new List<string>();
|
||||||
|
|
||||||
foreach (var item in inCommand.StudyInstanceUIDList)
|
foreach (var item in inCommand.StudyInstanceUIDList)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -3491,6 +3554,8 @@ namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
await _fusionCache.SetAsync(CacheKeys.CmoveStudyId(item), item, TimeSpan.FromMinutes(cmoveConfig.CmoveIntervalMinutes));
|
await _fusionCache.SetAsync(CacheKeys.CmoveStudyId(item), item, TimeSpan.FromMinutes(cmoveConfig.CmoveIntervalMinutes));
|
||||||
|
|
||||||
|
cmoveStudyUIdList.Add(item);
|
||||||
|
|
||||||
var cmoveRequest = new DicomCMoveRequest(hirServer.CalledAE, item);
|
var cmoveRequest = new DicomCMoveRequest(hirServer.CalledAE, item);
|
||||||
|
|
||||||
cmoveRequest.OnResponseReceived += responseDelegate;
|
cmoveRequest.OnResponseReceived += responseDelegate;
|
||||||
|
|
@ -3508,8 +3573,15 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cmoveRequestList.Count > 0)
|
||||||
|
{
|
||||||
|
await _cmoveStudyRepository.AddAsync(new CmoveStudy() { CallingAE = hirClient.CalledAE, CalledAE = find.CalledAE, StudyInstanceUIDList = cmoveStudyUIdList, HopitalGroupIdList = inCommand.HospitalGroupIdList }, true);
|
||||||
|
|
||||||
await client.AddRequestsAsync(cmoveRequestList);
|
await client.AddRequestsAsync(cmoveRequestList);
|
||||||
await client.SendAsync();
|
await client.SendAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//await task;
|
//await task;
|
||||||
|
|
|
||||||
|
|
@ -136,6 +136,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
CreateMap<Trial, NewTrialView>()
|
CreateMap<Trial, NewTrialView>()
|
||||||
.ForMember(d => d.TrialId, u => u.MapFrom(s => s.Id))
|
.ForMember(d => d.TrialId, u => u.MapFrom(s => s.Id))
|
||||||
|
.ForMember(d => d.HospitalGroupName, u => u.MapFrom(s => s.HospitalGroup.Name))
|
||||||
.ForMember(d => d.UnSubmitCount, u => u.MapFrom(s => s.SubjectVisitList.Count(t => t.SubmitState == SubmitStateEnum.ToSubmit)))
|
.ForMember(d => d.UnSubmitCount, u => u.MapFrom(s => s.SubjectVisitList.Count(t => t.SubmitState == SubmitStateEnum.ToSubmit)))
|
||||||
.ForMember(d => d.UnReadCount, u => u.MapFrom(s => s.VisitTaskList.Count(t => t.TaskState == TaskState.Effect && t.SignTime == null)))
|
.ForMember(d => d.UnReadCount, u => u.MapFrom(s => s.VisitTaskList.Count(t => t.TaskState == TaskState.Effect && t.SignTime == null)))
|
||||||
;
|
;
|
||||||
|
|
|
||||||
|
|
@ -80,8 +80,11 @@ public class SCPStudy : BaseFullDeleteAuditEntity, IEntitySeqId
|
||||||
public class SCPStudyHospitalGroup : BaseFullAuditEntity
|
public class SCPStudyHospitalGroup : BaseFullAuditEntity
|
||||||
{
|
{
|
||||||
#region MyRegion
|
#region MyRegion
|
||||||
|
[ForeignKey("HospitalGroupId")]
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public HospitalGroup HospitalGroup { get; set; }
|
public HospitalGroup HospitalGroup { get; set; }
|
||||||
|
|
||||||
|
[ForeignKey("SCPStudyId")]
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public SCPStudy SCPStudy { get; set; }
|
public SCPStudy SCPStudy { get; set; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,10 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
|
|
||||||
public string ContactPhone { get; set; }
|
public string ContactPhone { get; set; }
|
||||||
|
|
||||||
|
public string CallingAE { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
|
||||||
|
public bool IsEnable { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -177,7 +179,7 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
|
|
||||||
public class CmoveStudy : BaseFullAuditEntity
|
public class CmoveStudy : BaseFullAuditEntity
|
||||||
{
|
{
|
||||||
public List<string> StudyInstanceUID { get; set; }
|
public List<string> StudyInstanceUIDList { get; set; }
|
||||||
|
|
||||||
public string CallingAE { get; set; }
|
public string CallingAE { get; set; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,10 @@ public partial class Trial : BaseFullDeleteAuditEntity
|
||||||
//[JsonIgnore]
|
//[JsonIgnore]
|
||||||
//[ForeignKey("CROId")]
|
//[ForeignKey("CROId")]
|
||||||
//public CRO CRO { get; set; }
|
//public CRO CRO { get; set; }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public HospitalGroup HospitalGroup { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public List<TrialBodyPart> TrialBodyPartList { get; set; }
|
public List<TrialBodyPart> TrialBodyPartList { get; set; }
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
|
|
||||||
|
|
@ -589,6 +589,8 @@ public class IRaCISDBContext : DbContext
|
||||||
|
|
||||||
public virtual DbSet<TrialIdentityUser> TrialIdentityUser { get; set; }
|
public virtual DbSet<TrialIdentityUser> TrialIdentityUser { get; set; }
|
||||||
|
|
||||||
|
public virtual DbSet<CmoveStudy> CmoveStudy { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TestLength : Entity
|
public class TestLength : Entity
|
||||||
|
|
|
||||||
|
|
@ -91,6 +91,8 @@ public class SCPStudyConfigration : IEntityTypeConfiguration<SCPStudy>
|
||||||
|
|
||||||
builder.HasMany(s => s.InstanceList).WithOne(se => se.SCPStudy).HasForeignKey(se => se.StudyId).HasPrincipalKey(st => st.Id);
|
builder.HasMany(s => s.InstanceList).WithOne(se => se.SCPStudy).HasForeignKey(se => se.StudyId).HasPrincipalKey(st => st.Id);
|
||||||
|
|
||||||
|
builder.HasMany(s => s.HospitalGroupList).WithOne(se => se.SCPStudy).HasForeignKey(se => se.SCPStudyId).HasPrincipalKey(st => st.Id);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
18828
IRaCIS.Core.Infra.EFCore/Migrations/20250820061139_hospitalisEnable.Designer.cs
generated
Normal file
18828
IRaCIS.Core.Infra.EFCore/Migrations/20250820061139_hospitalisEnable.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,29 @@
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class hospitalisEnable : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<bool>(
|
||||||
|
name: "IsEnable",
|
||||||
|
table: "HospitalGroup",
|
||||||
|
type: "bit",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "IsEnable",
|
||||||
|
table: "HospitalGroup");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
18844
IRaCIS.Core.Infra.EFCore/Migrations/20250821093209_addGroupAE.Designer.cs
generated
Normal file
18844
IRaCIS.Core.Infra.EFCore/Migrations/20250821093209_addGroupAE.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,75 @@
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class addGroupAE : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_SCPStudyHospitalGroup_SCPStudy_SCPStudyId",
|
||||||
|
table: "SCPStudyHospitalGroup");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "CallingAE",
|
||||||
|
table: "HospitalGroup",
|
||||||
|
type: "nvarchar(400)",
|
||||||
|
maxLength: 400,
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: "");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Trial_HospitalGroupId",
|
||||||
|
table: "Trial",
|
||||||
|
column: "HospitalGroupId");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_SCPStudyHospitalGroup_SCPStudy_SCPStudyId",
|
||||||
|
table: "SCPStudyHospitalGroup",
|
||||||
|
column: "SCPStudyId",
|
||||||
|
principalTable: "SCPStudy",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Trial_HospitalGroup_HospitalGroupId",
|
||||||
|
table: "Trial",
|
||||||
|
column: "HospitalGroupId",
|
||||||
|
principalTable: "HospitalGroup",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_SCPStudyHospitalGroup_SCPStudy_SCPStudyId",
|
||||||
|
table: "SCPStudyHospitalGroup");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_Trial_HospitalGroup_HospitalGroupId",
|
||||||
|
table: "Trial");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_Trial_HospitalGroupId",
|
||||||
|
table: "Trial");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "CallingAE",
|
||||||
|
table: "HospitalGroup");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_SCPStudyHospitalGroup_SCPStudy_SCPStudyId",
|
||||||
|
table: "SCPStudyHospitalGroup",
|
||||||
|
column: "SCPStudyId",
|
||||||
|
principalTable: "SCPStudy",
|
||||||
|
principalColumn: "SeqId",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,52 @@
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class cmoveadd : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "CmoveStudy",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
|
StudyInstanceUIDList = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
CallingAE = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
|
||||||
|
CalledAE = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
|
||||||
|
HopitalGroupIdList = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
CreateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
|
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||||
|
UpdateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
|
UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_CmoveStudy", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_CmoveStudy_User_CreateUserId",
|
||||||
|
column: x => x.CreateUserId,
|
||||||
|
principalTable: "User",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_CmoveStudy_CreateUserId",
|
||||||
|
table: "CmoveStudy",
|
||||||
|
column: "CreateUserId");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "CmoveStudy");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -493,6 +493,48 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("IRaCIS.Core.Domain.Models.CmoveStudy", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<string>("CalledAE")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(400)
|
||||||
|
.HasColumnType("nvarchar(400)");
|
||||||
|
|
||||||
|
b.Property<string>("CallingAE")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(400)
|
||||||
|
.HasColumnType("nvarchar(400)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreateTime")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<Guid>("CreateUserId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<string>("HopitalGroupIdList")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("StudyInstanceUIDList")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("UpdateTime")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<Guid>("UpdateUserId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("CreateUserId");
|
||||||
|
|
||||||
|
b.ToTable("CmoveStudy");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.CommonDocument", b =>
|
modelBuilder.Entity("IRaCIS.Core.Domain.Models.CommonDocument", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
|
|
@ -2786,6 +2828,11 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
.HasColumnType("nvarchar(400)")
|
.HasColumnType("nvarchar(400)")
|
||||||
.HasComment("所属科室");
|
.HasComment("所属科室");
|
||||||
|
|
||||||
|
b.Property<string>("CallingAE")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(400)
|
||||||
|
.HasColumnType("nvarchar(400)");
|
||||||
|
|
||||||
b.Property<string>("Code")
|
b.Property<string>("Code")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasMaxLength(400)
|
.HasMaxLength(400)
|
||||||
|
|
@ -2807,6 +2854,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
b.Property<Guid>("CreateUserId")
|
b.Property<Guid>("CreateUserId")
|
||||||
.HasColumnType("uniqueidentifier");
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<bool>("IsEnable")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
b.Property<string>("Name")
|
b.Property<string>("Name")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasMaxLength(400)
|
.HasMaxLength(400)
|
||||||
|
|
@ -11028,6 +11078,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
|
||||||
b.HasIndex("CreateUserId");
|
b.HasIndex("CreateUserId");
|
||||||
|
|
||||||
|
b.HasIndex("HospitalGroupId");
|
||||||
|
|
||||||
b.HasIndex("IndicationTypeId");
|
b.HasIndex("IndicationTypeId");
|
||||||
|
|
||||||
b.HasIndex("PhaseId");
|
b.HasIndex("PhaseId");
|
||||||
|
|
@ -14545,6 +14597,17 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
b.Navigation("CreateUserRole");
|
b.Navigation("CreateUserRole");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("IRaCIS.Core.Domain.Models.CmoveStudy", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("IRaCIS.Core.Domain.Models.UserRole", "CreateUserRole")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("CreateUserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("CreateUserRole");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.CommonDocument", b =>
|
modelBuilder.Entity("IRaCIS.Core.Domain.Models.CommonDocument", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("IRaCIS.Core.Domain.Models.UserRole", "CreateUserRole")
|
b.HasOne("IRaCIS.Core.Domain.Models.UserRole", "CreateUserRole")
|
||||||
|
|
@ -16402,6 +16465,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
b.HasOne("IRaCIS.Core.Domain.Models.SCPStudy", "SCPStudy")
|
b.HasOne("IRaCIS.Core.Domain.Models.SCPStudy", "SCPStudy")
|
||||||
.WithMany("HospitalGroupList")
|
.WithMany("HospitalGroupList")
|
||||||
.HasForeignKey("SCPStudyId")
|
.HasForeignKey("SCPStudyId")
|
||||||
|
.HasPrincipalKey("Id")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
|
|
@ -17272,6 +17336,12 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("IRaCIS.Core.Domain.Models.HospitalGroup", "HospitalGroup")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("HospitalGroupId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("IRaCIS.Core.Domain.Models.Dictionary", "IndicationType")
|
b.HasOne("IRaCIS.Core.Domain.Models.Dictionary", "IndicationType")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("IndicationTypeId")
|
.HasForeignKey("IndicationTypeId")
|
||||||
|
|
@ -17324,6 +17394,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
|
||||||
b.Navigation("CreateUserRole");
|
b.Navigation("CreateUserRole");
|
||||||
|
|
||||||
|
b.Navigation("HospitalGroup");
|
||||||
|
|
||||||
b.Navigation("IndicationType");
|
b.Navigation("IndicationType");
|
||||||
|
|
||||||
b.Navigation("Phase");
|
b.Navigation("Phase");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue