增加项目课题组,缓存bug修改
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
f409c6468e
commit
a7db0c2887
|
|
@ -39,7 +39,8 @@ namespace IRaCIS.Core.Application.Auth
|
|||
new Claim(JwtIRaCISClaimType.UserTypeShortName,user.UserTypeShortName),
|
||||
new Claim(JwtIRaCISClaimType.PermissionStr,user.PermissionStr),
|
||||
new Claim(JwtIRaCISClaimType.IsZhiZhun,user.IsZhiZhun.ToString()),
|
||||
new Claim(JwtIRaCISClaimType.IsTestUser,user.IsTestUser.ToString())
|
||||
new Claim(JwtIRaCISClaimType.IsTestUser,user.IsTestUser.ToString()),
|
||||
new Claim(JwtIRaCISClaimType.HospitalGroupList,user.HospitalGroupList.ToJsonStr())
|
||||
};
|
||||
|
||||
////创建令牌
|
||||
|
|
|
|||
|
|
@ -23,5 +23,7 @@ namespace IRaCIS.Core.Application.Auth
|
|||
public bool IsZhiZhun { get; set; }
|
||||
|
||||
public string UserTypeShortName { get; set; } = string.Empty;
|
||||
|
||||
public List<HospitalGroupInfo> HospitalGroupList { get; set; } = new List<HospitalGroupInfo>();
|
||||
}
|
||||
}
|
||||
|
|
@ -120,7 +120,7 @@ public class TrialGlobalLimitActionFilter(IFusionCache _fusionCache, IUserInfo _
|
|||
|
||||
trialIdStr = matchResult.Value;
|
||||
|
||||
var trialInfo = await _fusionCache.GetOrSetAsync(CacheKeys.Trial(trialIdStr), async _ =>await CacheHelper.GetTrialStatusAsync(Guid.Parse(trialIdStr), _trialRepository), TimeSpan.FromDays(7));
|
||||
var trialInfo = await _fusionCache.GetOrSetAsync(CacheKeys.Trial(trialIdStr), _ => CacheHelper.GetTrialStatusAsync(Guid.Parse(trialIdStr), _trialRepository), TimeSpan.FromDays(7));
|
||||
|
||||
if (string.IsNullOrWhiteSpace(trialInfo?.TrialStatusStr))
|
||||
{
|
||||
|
|
@ -152,9 +152,9 @@ public class TrialGlobalLimitActionFilter(IFusionCache _fusionCache, IUserInfo _
|
|||
//通过path 或者body 找到trialId 了
|
||||
if (!string.IsNullOrWhiteSpace(trialIdStr))
|
||||
{
|
||||
var trialInfo = await _fusionCache.GetOrSetAsync(CacheKeys.Trial(trialIdStr), async _ => await CacheHelper.GetTrialStatusAsync(Guid.Parse(trialIdStr), _trialRepository), TimeSpan.FromDays(7));
|
||||
var trialInfo = await _fusionCache.GetOrSetAsync(CacheKeys.Trial(trialIdStr), _ => CacheHelper.GetTrialStatusAsync(Guid.Parse(trialIdStr), _trialRepository), TimeSpan.FromDays(7));
|
||||
|
||||
var hospitalInfo = await _fusionCache.GetOrSetAsync(CacheKeys.Hospital, async _ => await CacheHelper.GetHospitalCode(_hirHospitalRepository), TimeSpan.FromDays(7));
|
||||
var hospitalInfo = await _fusionCache.GetOrSetAsync(CacheKeys.Hospital, _ => CacheHelper.GetHospitalCode(_hirHospitalRepository), TimeSpan.FromDays(7));
|
||||
|
||||
var trialStatusStr = string.Empty;
|
||||
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ public class TrialGlobalLimitEndpointFilter(IFusionCache _fusionCache, IUserInfo
|
|||
|
||||
trialIdStr = matchResult.Value;
|
||||
|
||||
var trialInfo = await _fusionCache.GetOrSetAsync(CacheKeys.Trial(trialIdStr), async _ => await CacheHelper.GetTrialStatusAsync(Guid.Parse(trialIdStr), _trialRepository), TimeSpan.FromDays(7));
|
||||
var trialInfo = await _fusionCache.GetOrSetAsync(CacheKeys.Trial(trialIdStr), _ => CacheHelper.GetTrialStatusAsync(Guid.Parse(trialIdStr), _trialRepository), TimeSpan.FromDays(7));
|
||||
|
||||
if (string.IsNullOrWhiteSpace(trialInfo?.TrialStatusStr))
|
||||
{
|
||||
|
|
@ -158,9 +158,9 @@ public class TrialGlobalLimitEndpointFilter(IFusionCache _fusionCache, IUserInfo
|
|||
//通过path 或者body 找到trialId 了
|
||||
if (!string.IsNullOrWhiteSpace(trialIdStr))
|
||||
{
|
||||
var trialInfo = await _fusionCache.GetOrSetAsync(CacheKeys.Trial(trialIdStr), async _ => await CacheHelper.GetTrialStatusAsync(Guid.Parse(trialIdStr), _trialRepository), TimeSpan.FromDays(7));
|
||||
var trialInfo = await _fusionCache.GetOrSetAsync(CacheKeys.Trial(trialIdStr), _ => CacheHelper.GetTrialStatusAsync(Guid.Parse(trialIdStr), _trialRepository), TimeSpan.FromDays(7));
|
||||
|
||||
var hospitalInfo = await _fusionCache.GetOrSetAsync(CacheKeys.Hospital, async _ => await CacheHelper.GetHospitalCode(_hirHospitalRepository), TimeSpan.FromDays(7));
|
||||
var hospitalInfo = await _fusionCache.GetOrSetAsync(CacheKeys.Hospital, _ => CacheHelper.GetHospitalCode(_hirHospitalRepository), TimeSpan.FromDays(7));
|
||||
|
||||
var trialStatusStr = string.Empty;
|
||||
|
||||
|
|
|
|||
|
|
@ -18216,6 +18216,13 @@
|
|||
<param name="inQuery"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Application.Services.PatientService.ModifySCPStudyHospitalGroup(IRaCIS.Application.Contracts.SCPStudyHospitalGroupCommand)">
|
||||
<summary>
|
||||
修改检查课题组 1是添加 2是删除
|
||||
</summary>
|
||||
<param name="inQuery"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Application.Services.PatientService.DeletePatientStudyAllData(System.Guid,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SCPSeries},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SCPInstance},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.DicomStudy},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.DicomSeries},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.DicomInstance},IRaCIS.Core.Application.Helper.IOSSService)">
|
||||
<summary>
|
||||
清除该患者绑定的受试者的所有的数据、(subject subjectVisit visitTask dicom)
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ namespace IRaCIS.Core.Application.Services
|
|||
}
|
||||
|
||||
|
||||
var anonymizeList = await _fusionCache.GetOrSetAsync(CacheKeys.SystemAnonymization, async _ => await CacheHelper.GetSystemAnonymizationListAsync(_systemAnonymizationRepository), TimeSpan.FromDays(7));
|
||||
var anonymizeList = await _fusionCache.GetOrSetAsync(CacheKeys.SystemAnonymization, _ => CacheHelper.GetSystemAnonymizationListAsync(_systemAnonymizationRepository), TimeSpan.FromDays(7));
|
||||
|
||||
var fixedFiledList = anonymizeList.Where(t => t.IsFixed).ToList();
|
||||
var ircFiledList = anonymizeList.Where(t => t.IsFixed == false).ToList();
|
||||
|
|
|
|||
|
|
@ -782,7 +782,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
// 写入dicom 固定的信息,以及组织路径的信息 以及匿名化的信息
|
||||
var otherData = GetSaveToDicomInfo(verifyInfo.SubjectVisitId);
|
||||
|
||||
var anonymizeList = _fusionCache.GetOrSetAsync(CacheKeys.SystemAnonymization, async _ => await CacheHelper.GetSystemAnonymizationListAsync(_systemAnonymizationRepository), TimeSpan.FromDays(7)).Result;
|
||||
var anonymizeList = _fusionCache.GetOrSetAsync(CacheKeys.SystemAnonymization, _ => CacheHelper.GetSystemAnonymizationListAsync(_systemAnonymizationRepository), TimeSpan.FromDays(7)).Result;
|
||||
|
||||
return ResponseOutput.Ok<List<VerifyStudyUploadResult>>(result, new
|
||||
{
|
||||
|
|
|
|||
|
|
@ -82,6 +82,8 @@ namespace IRaCIS.Application.Contracts
|
|||
|
||||
public class UserBasicInfo
|
||||
{
|
||||
public List<HospitalGroupInfo> HospitalGroupList { get; set; }
|
||||
|
||||
public Guid IdentityUserId { get; set; }
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
public async Task<IResponseOutput> ResetPassword(Guid identityUserId)
|
||||
{
|
||||
|
||||
var hospitalInfo = await _fusionCache.GetOrSetAsync(CacheKeys.Hospital, async _ => await CacheHelper.GetHospitalCode(_hirHospitalRepository), TimeSpan.FromDays(7));
|
||||
var hospitalInfo = await _fusionCache.GetOrSetAsync(CacheKeys.Hospital, _ => CacheHelper.GetHospitalCode(_hirHospitalRepository), TimeSpan.FromDays(7));
|
||||
|
||||
|
||||
//var pwd = IRCEmailPasswordHelper.GenerateRandomPassword(10);
|
||||
|
|
@ -426,7 +426,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
var success = await _identityUserRepository.BatchUpdateNoTrackingAsync(t => t.Id == _userInfo.IdentityUserId, u => new IdentityUser()
|
||||
{
|
||||
Password = editPwModel.NewPassWord,
|
||||
CheckCode=editPwModel.CheckCode,
|
||||
CheckCode = editPwModel.CheckCode,
|
||||
LastChangePassWordTime = DateTime.Now,
|
||||
IsFirstAdd = false
|
||||
});
|
||||
|
|
@ -470,7 +470,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.WhereIf(inQuery.EndLastLoginTime != null, t => t.LastLoginTime <= inQuery.EndLastLoginTime)
|
||||
.WhereIf(inQuery.BeginLastChangePassWordTime != null, t => t.LastChangePassWordTime >= inQuery.BeginLastChangePassWordTime)
|
||||
.WhereIf(inQuery.EndLastChangePassWordTime != null, t => t.LastChangePassWordTime <= inQuery.EndLastChangePassWordTime)
|
||||
.WhereIf(inQuery.UserType != null, t => t.UserRoleList.Any(t => t.UserTypeId == inQuery.UserType && t.IsUserRoleDisabled==false))
|
||||
.WhereIf(inQuery.UserType != null, t => t.UserRoleList.Any(t => t.UserTypeId == inQuery.UserType && t.IsUserRoleDisabled == false))
|
||||
.WhereIf(inQuery.UserState != null, t => t.Status == inQuery.UserState)
|
||||
.WhereIf(inQuery.IsTestUser != null, t => t.IsTestUser == inQuery.IsTestUser)
|
||||
.WhereIf(inQuery.IsZhiZhun != null, t => t.IsZhiZhun == inQuery.IsZhiZhun)
|
||||
|
|
@ -511,7 +511,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
[UnitOfWork]
|
||||
public async Task<IResponseOutput<UserAddedReturnDTO>> AddUser(UserCommand userAddModel)
|
||||
{
|
||||
var hospitalInfo = await _fusionCache.GetOrSetAsync(CacheKeys.Hospital, async _ => await CacheHelper.GetHospitalCode(_hirHospitalRepository), TimeSpan.FromDays(7));
|
||||
var hospitalInfo = await _fusionCache.GetOrSetAsync(CacheKeys.Hospital, _ => CacheHelper.GetHospitalCode(_hirHospitalRepository), TimeSpan.FromDays(7));
|
||||
|
||||
if (userAddModel.UserName.IsNotNullOrEmpty())
|
||||
{
|
||||
|
|
@ -593,7 +593,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
//await VerifyUserPhoneAsync(model.Id, model.UserTypeId, model.Phone);
|
||||
|
||||
var user = await _identityUserRepository.Where(t => t.Id == model.Id, true).Include(t => t.UserRoleList).Include(t=>t.IdentityUserHospitalGroupList).FirstOrDefaultAsync();
|
||||
var user = await _identityUserRepository.Where(t => t.Id == model.Id, true).Include(t => t.UserRoleList).Include(t => t.IdentityUserHospitalGroupList).FirstOrDefaultAsync();
|
||||
|
||||
if (user == null) return Null404NotFound(user);
|
||||
|
||||
|
|
@ -645,14 +645,14 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
var existHospitalGroupIdList = user.IdentityUserHospitalGroupList.Select(t => t.HospitalGroupId).ToList();
|
||||
|
||||
var removeIdList= existHospitalGroupIdList.Except(model.HospitalGroupIdList).ToList();
|
||||
var removeIdList = existHospitalGroupIdList.Except(model.HospitalGroupIdList).ToList();
|
||||
|
||||
user.IdentityUserHospitalGroupList = user.IdentityUserHospitalGroupList.Where(t => !removeIdList.Contains(t.HospitalGroupId)).ToList();
|
||||
|
||||
var addIdList = model.HospitalGroupIdList.Except(existHospitalGroupIdList).ToList();
|
||||
|
||||
user.IdentityUserHospitalGroupList.AddRange(addIdList.Select(t => new HospitalGroupIdentityUser() { HospitalGroupId = t, IsManager = false, IdentityUserId = user.Id }));
|
||||
|
||||
|
||||
|
||||
var success = await _userRoleRepository.SaveChangesAsync();
|
||||
|
||||
|
|
@ -718,7 +718,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public async Task<UserBasicInfo> GetUserBasicInfo(Guid userId, string pwd)
|
||||
|
|
@ -926,8 +926,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
.WhereIf(inQuery.OptTypeList != null && inQuery.OptTypeList.Count > 0, t => inQuery.OptTypeList.Contains(t.OptType))
|
||||
.WhereIf(inQuery.BeginDate != null, t => t.CreateTime >= inQuery.BeginDate)
|
||||
.WhereIf(inQuery.EndDate != null, t => t.CreateTime <= inQuery.EndDate)
|
||||
.WhereIf(inQuery.IsLoginUncommonly != null , t => t.IsLoginUncommonly== inQuery.IsLoginUncommonly)
|
||||
|
||||
.WhereIf(inQuery.IsLoginUncommonly != null, t => t.IsLoginUncommonly == inQuery.IsLoginUncommonly)
|
||||
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.LoginUserName), t => t.ActionUserName.Contains(inQuery.LoginUserName!))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.LoginFaildName), t => t.ActionUserName.Contains(inQuery.LoginFaildName!))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.IP), t => t.IP.Contains(inQuery.IP!))
|
||||
|
|
@ -975,7 +975,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
[HttpGet("{email}/{verifyCode}")]
|
||||
public async Task<List<UserAccountInfo>> VerifyAnonymousVerifyCode(string email, string verifyCode)
|
||||
{
|
||||
var hospitalInfo = await _fusionCache.GetOrSetAsync(CacheKeys.Hospital, async _ => await CacheHelper.GetHospitalCode(_hirHospitalRepository), TimeSpan.FromDays(7));
|
||||
var hospitalInfo = await _fusionCache.GetOrSetAsync(CacheKeys.Hospital, _ => CacheHelper.GetHospitalCode(_hirHospitalRepository), TimeSpan.FromDays(7));
|
||||
|
||||
if (hospitalInfo.IsCanConnectInternet)
|
||||
{
|
||||
|
|
@ -1055,7 +1055,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
var password = loginDto.Password;
|
||||
|
||||
var emailConfig = _emailConfig.CurrentValue;
|
||||
var companyInfo = new SystemEmailSendConfigView() { CompanyName = emailConfig.CompanyName, CompanyNameCN = emailConfig.CompanyNameCN, CompanyShortName = emailConfig.CompanyShortName, CompanyShortNameCN = emailConfig.CompanyShortNameCN,SystemShortName=emailConfig.SystemShortName ,EmailRegexStr=emailConfig.EmailRegexStr};
|
||||
var companyInfo = new SystemEmailSendConfigView() { CompanyName = emailConfig.CompanyName, CompanyNameCN = emailConfig.CompanyNameCN, CompanyShortName = emailConfig.CompanyShortName, CompanyShortNameCN = emailConfig.CompanyShortNameCN, SystemShortName = emailConfig.SystemShortName, EmailRegexStr = emailConfig.EmailRegexStr };
|
||||
|
||||
|
||||
int maxFailures = _verifyConfig.CurrentValue.LoginMaxFailCount;
|
||||
|
|
@ -1124,7 +1124,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
//超过90天没修改密码
|
||||
|
||||
if (loginUser!= null&&_verifyConfig.CurrentValue.IsNeedChangePassWord && loginUser.LastChangePassWordTime != null && DateTime.Now.AddDays(-_verifyConfig.CurrentValue.ChangePassWordDays) > loginUser.LastChangePassWordTime.Value)
|
||||
if (loginUser != null && _verifyConfig.CurrentValue.IsNeedChangePassWord && loginUser.LastChangePassWordTime != null && DateTime.Now.AddDays(-_verifyConfig.CurrentValue.ChangePassWordDays) > loginUser.LastChangePassWordTime.Value)
|
||||
{
|
||||
loginUser.NeedChangePassWord = true;
|
||||
}
|
||||
|
|
@ -1135,7 +1135,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
UserOptType.LoginLockedAccount
|
||||
};
|
||||
|
||||
var actionUserName= loginUser!= null ? loginUser.UserName : userName;
|
||||
var actionUserName = loginUser != null ? loginUser.UserName : userName;
|
||||
|
||||
var lastLoginIPRegion = await _userLogRepository.Where(t => t.ActionUserName == actionUserName && userOptTypes.Contains(t.OptType))
|
||||
.OrderByDescending(t => t.CreateTime).Select(t => t.IPRegion).FirstOrDefaultAsync();
|
||||
|
|
@ -1155,7 +1155,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
//异地登录
|
||||
loginUser.LoginState = 2;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1255,6 +1255,14 @@ namespace IRaCIS.Core.Application.Service
|
|||
PermissionStr = t.UserTypeRole.PermissionStr,
|
||||
UserName = t.IdentityUser.UserName,
|
||||
UserTypeShortName = t.UserTypeRole.UserTypeShortName,
|
||||
|
||||
HospitalGroupList = t.IdentityUser.IdentityUserHospitalGroupList.Select(t => new HospitalGroupInfo()
|
||||
{
|
||||
Id = t.HospitalGroupId,
|
||||
Name = t.HospitalGroup.Name,
|
||||
Code = t.HospitalGroup.Code
|
||||
|
||||
}).ToList()
|
||||
}).FirstOrDefaultAsync();
|
||||
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = userTokenInfo.IdentityUserId, ActionUserName = $"{userTokenInfo.UserName}", ActionUserType = userTokenInfo.UserTypeShortName, OptType = UserOptType.LoginSelectRole }, true);
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.ForMember(d => d.TrialCode, u => u.MapFrom(s => s.Trial.TrialCode))
|
||||
.ForMember(d => d.JoinedTrialCount, u => u.MapFrom(s => s.UserTrialList.Count()))
|
||||
.ForMember(d => d.ResearchProgramNo, u => u.MapFrom(s => s.Trial.ResearchProgramNo))
|
||||
.ForMember(d => d.HospitalGroupList, u => u.MapFrom(s => s.IdentityUserHospitalGroupList.Select(t=>t.HospitalGroup)));
|
||||
.ForMember(d => d.HospitalGroupList, u => u.MapFrom(s => s.IdentityUserHospitalGroupList.Select(t => t.HospitalGroup)));
|
||||
|
||||
CreateMap<HospitalGroup, HospitalGroupInfo>();
|
||||
|
||||
|
|
@ -142,7 +142,9 @@ namespace IRaCIS.Core.Application.Service
|
|||
CreateMap<UserCommand, IdentityUser>();
|
||||
|
||||
CreateMap<IdentityUser, UserBasicInfo>()
|
||||
.ForMember(d => d.IdentityUserId, c => c.MapFrom(t => t.Id));
|
||||
.ForMember(d => d.IdentityUserId, c => c.MapFrom(t => t.Id))
|
||||
.ForMember(d => d.HospitalGroupList, c => c.MapFrom(t => t.IdentityUserHospitalGroupList.Select(t => t.HospitalGroup)))
|
||||
;
|
||||
|
||||
CreateMap<UserRole, IdentityUserTypeDTO>()
|
||||
.ForMember(d => d.UserTypeShortName, c => c.MapFrom(t => t.UserTypeRole.UserTypeShortName));
|
||||
|
|
|
|||
|
|
@ -45,14 +45,16 @@ namespace IRaCIS.Core.Application.Service.MinimalApiService
|
|||
//对于json 对象 不能使用count any 操作,但是简单的类型可以的
|
||||
var jobjectList = _testLengthRepository.AsQueryable().ToList();
|
||||
|
||||
var jobjectList1 = _testLengthRepository.AsQueryable().Where(t=>t.TestJsonObjectLsit.Any(c=>c.Name=="name1")).ToList();
|
||||
//var jobjectList1 = _testLengthRepository.AsQueryable().Where(t=>t.TestJsonObjectLsit.Any(c=>c.Name=="name1")).ToList();
|
||||
|
||||
var jobjectList2 = _testLengthRepository.AsQueryable().Where(t => t.TestJsonObjectLsit.Any(c => c.Name == "name1")).SelectMany(t=>t.TestJsonObjectLsit).ToList();
|
||||
//var jobjectList2 = _testLengthRepository.AsQueryable().Where(t => t.TestJsonObjectLsit.Any(c => c.Name == "name1")).SelectMany(t=>t.TestJsonObjectLsit).ToList();
|
||||
|
||||
|
||||
var d1 = _testLengthRepository.Where(t => t.StringList.Any(t => t == "string1")).ToList();
|
||||
var d2 = _testLengthRepository.Where(t => t.StringList.Contains("string1")).ToList();
|
||||
|
||||
var d21 = _testLengthRepository.Where().Select(t=>t.StringList).ToList();
|
||||
|
||||
|
||||
//selectMany 报错 不支持
|
||||
//var d20 = _testLengthRepository.Where(t => t.StringList.Contains("string1")).SelectMany(t => t.StringList).ToList();
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
[HttpPost]
|
||||
public async Task<PageOutput<TrialUserRoleScreeningDto>> GetTrialUserScreeningList(TrialUserQuery inQuery)
|
||||
{
|
||||
var trialType = _trialRepository.Where(t => t.Id == inQuery.TrialId).Select(t => t.TrialType).FirstOrDefault();
|
||||
var hospitalGroupId = _trialRepository.Where(t => t.Id == inQuery.TrialId).Select(t => t.HospitalGroupId).FirstOrDefault();
|
||||
|
||||
var userTypeEnums = new List<UserTypeEnum>() { UserTypeEnum.ClinicalResearchCoordinator, UserTypeEnum.CRA, UserTypeEnum.IQC, UserTypeEnum.APM, UserTypeEnum.MIM, UserTypeEnum.QA, UserTypeEnum.MW, UserTypeEnum.MC };
|
||||
|
||||
|
|
@ -125,7 +125,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
|
||||
//.Where(t => userTypeEnums.Contains(t.UserTypeEnum))
|
||||
|
||||
.Where(t => t.IdentityUser.IdentityUserHospitalGroupList.Any(t => t.HospitalGroupId == hospitalGroupId))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.UserRealName), t => (t.IdentityUser.FullName).Contains(inQuery.UserRealName))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.UserName), t => t.IdentityUser.UserName.Contains(inQuery.UserName))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.OrganizationName), t => t.IdentityUser.OrganizationName.Contains(inQuery.OrganizationName))
|
||||
|
|
@ -146,7 +146,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
UserName = t.IdentityUser.UserName,
|
||||
UserTypeShortName = t.UserTypeRole.UserTypeShortName,
|
||||
IsSelect = t.UserRoleTrials.Any(t => t.TrialId == inQuery.TrialId),
|
||||
});
|
||||
});
|
||||
|
||||
return await query.ToPagedListAsync(inQuery);
|
||||
|
||||
|
|
|
|||
|
|
@ -154,6 +154,8 @@ namespace IRaCIS.Application.Contracts
|
|||
|
||||
public DateTime? AuthorizationDate { get; set; }
|
||||
|
||||
public Guid HospitalGroupId { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class PatientJoinTrialInitQuery : PageInput
|
||||
|
|
@ -269,6 +271,13 @@ namespace IRaCIS.Application.Contracts
|
|||
public int? StudyCount { get; set; }
|
||||
|
||||
public List<PatientTrialStatInfo> TrialList { get; set; }
|
||||
|
||||
public List<string> StudyHospitalGroupList { get; set; }
|
||||
|
||||
public List<string> CurrentUserHospitalGroupList { get; set; } = new List<string>();
|
||||
|
||||
public List<string> ViewHospitalGroupList => StudyHospitalGroupList.Except(CurrentUserHospitalGroupList).ToList();
|
||||
|
||||
}
|
||||
|
||||
public class PatientTrialStatInfo
|
||||
|
|
@ -513,6 +522,14 @@ namespace IRaCIS.Application.Contracts
|
|||
public string? Modalities { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class SCPStudyHospitalGroupCommand
|
||||
{
|
||||
public Guid HospitalGroupId { get; set; }
|
||||
public List<Guid> SCPstudyIdList { get; set; }
|
||||
|
||||
public int AddOrDelete { get; set; }
|
||||
}
|
||||
public class PatientStudyQuery : PageInput
|
||||
{
|
||||
[NotDefault]
|
||||
|
|
@ -1048,9 +1065,19 @@ namespace IRaCIS.Application.Contracts
|
|||
|
||||
public string CallingAE { get; set; } = string.Empty;
|
||||
|
||||
public List<SCPStudyHospitalGroupInfo> HospitalGroupList { get; set; }
|
||||
|
||||
public List<HospitalGroupInfo> CurrentUserHospitalGroupList { get; set; }
|
||||
|
||||
public List<SCPStudyHospitalGroupInfo> ViewHospitalGroupList => HospitalGroupList.Where(t => CurrentUserHospitalGroupList.Any(c => c.Id == t.Id)).ToList();
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class SCPStudyHospitalGroupInfo
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
public class PatientSeriesDTO
|
||||
{
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
[ApiExplorerSettings(GroupName = "HIR")]
|
||||
public class PatientService(IRepository<SCPStudySubjectVisit> _studySubjectVisitRepository,
|
||||
IRepository<SubjectPatient> _subjectPatientRepository,
|
||||
IRepository<SubjectPatient> _subjectPatientRepository, IRepository<SCPStudyHospitalGroup> _SCPStudyHospitalGroupRepository,
|
||||
IRepository<Trial> _trialRepository,
|
||||
IRepository<SCPPatient> _patientRepository,
|
||||
IRepository<SCPStudy> _studyRepository,
|
||||
|
|
@ -505,7 +505,7 @@ namespace IRaCIS.Application.Services
|
|||
else
|
||||
{
|
||||
//"激活码信息有误!"
|
||||
return ResponseOutput.NotOk(_localizer["Trial_ActivationCodeError"] );
|
||||
return ResponseOutput.NotOk(_localizer["Trial_ActivationCodeError"]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -570,13 +570,13 @@ namespace IRaCIS.Application.Services
|
|||
await _trialRepository.BatchUpdateNoTrackingAsync(t => t.Id == trialId, u => new Trial() { AuthorizationEncrypt = newActivationCode, AuthorizationDate = deadLineDate });
|
||||
|
||||
var caheInfo = new TrialCacheInfo() { TrialId = trialInfo.Id, TrialStatusStr = trialInfo.TrialStatusStr, AuthorizationEncrypt = newActivationCode, CriterionTypes = trialInfo.CriterionTypes, AuthorizationDate = trialInfo.AuthorizationDate, CreateUserId = trialInfo.CreateUserId, TrialCode = trialInfo.TrialCode };
|
||||
|
||||
|
||||
await _fusionCache.SetAsync(CacheKeys.Trial(trialInfo.Id.ToString()), caheInfo, TimeSpan.FromDays(7));
|
||||
}
|
||||
else
|
||||
{
|
||||
// 激活信息反序列化错误
|
||||
return ResponseOutput.NotOk(_localizer["Trial_ActivationCodeDeserializeError"] );
|
||||
return ResponseOutput.NotOk(_localizer["Trial_ActivationCodeDeserializeError"]);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -601,8 +601,10 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
var isAdminOrOA = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.Admin || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.OA || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin;
|
||||
|
||||
var currentUserHospitalGroupIdList = _userInfo.HospitalGroupList.Select(t => t.Id).ToList();
|
||||
|
||||
#region new ok
|
||||
var query = _patientRepository
|
||||
var query = _patientRepository.Where(t => isAdminOrOA ? true : t.SCPStudyList.Any(c => c.HospitalGroupList.Any(c => currentUserHospitalGroupIdList.Contains(c.HospitalGroupId))))
|
||||
.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.ExperimentName), t => t.SubjectPatientList.Any(t => t.Subject.Trial.ExperimentName.Contains(inQuery.ExperimentName)))
|
||||
|
|
@ -637,7 +639,7 @@ namespace IRaCIS.Application.Services
|
|||
PatientIdStr = patient.PatientIdStr,
|
||||
PatientSex = patient.PatientSex,
|
||||
|
||||
StudyCount = patient.SCPStudyList.Count(),
|
||||
StudyCount = patient.SCPStudyList.Where(t => isAdminOrOA ? true : t.HospitalGroupList.Any(c => currentUserHospitalGroupIdList.Contains(c.HospitalGroupId))).Count(),
|
||||
|
||||
TrialList = patient.SubjectPatientList.Where(t => isAdminOrOA ? true : t.Subject.Trial.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId)).Select(c => new PatientTrialStatInfo()
|
||||
{
|
||||
|
|
@ -645,12 +647,27 @@ namespace IRaCIS.Application.Services
|
|||
VisitCount = c.Subject.SubjectVisitList.Count()
|
||||
}).ToList(),
|
||||
|
||||
StudyHospitalGroupList = patient.SCPStudyList.SelectMany(t => t.HospitalGroupList).Select(t => t.HospitalGroup.Name).Distinct().ToList()
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var pageList = await resultQuery.ToPagedListAsync(inQuery, nameof(PatientQueryView.PatientIdStr));
|
||||
|
||||
foreach (var item in pageList.CurrentPageData)
|
||||
{
|
||||
if (isAdminOrOA)
|
||||
{
|
||||
//不处理,默认看所有
|
||||
}
|
||||
else
|
||||
{
|
||||
item.CurrentUserHospitalGroupList = _userInfo.HospitalGroupList.Select(t => t.Name).ToList();
|
||||
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
|
@ -731,7 +748,12 @@ namespace IRaCIS.Application.Services
|
|||
[HttpPost]
|
||||
public async Task<PageOutput<PatientStudySimpleView>> GetPatientStudyList(PatientStudyInfoQuery inQuery)
|
||||
{
|
||||
var isAdminOrOA = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.Admin || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.OA || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin;
|
||||
|
||||
var currentUserHospitalGroupIdList = _userInfo.HospitalGroupList.Select(t => t.Id).ToList();
|
||||
|
||||
var query = from scpStudy in _studyRepository.Where(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))
|
||||
|
|
@ -747,14 +769,62 @@ namespace IRaCIS.Application.Services
|
|||
SCPStudyId = scpStudy.Id,
|
||||
SeriesCount = scpStudy.SeriesCount,
|
||||
StudyTime = scpStudy.StudyTime,
|
||||
|
||||
HospitalGroupList = scpStudy.HospitalGroupList.Select(t => new SCPStudyHospitalGroupInfo()
|
||||
{
|
||||
Id = t.HospitalGroupId,
|
||||
Name = t.HospitalGroup.Name
|
||||
}).ToList()
|
||||
};
|
||||
|
||||
var pageList = await query.ToPagedListAsync(inQuery, nameof(PatientStudySimpleView.StudyTime));
|
||||
|
||||
foreach (var item in pageList.CurrentPageData)
|
||||
{
|
||||
if (isAdminOrOA)
|
||||
{
|
||||
//不处理,默认看所有
|
||||
}
|
||||
else
|
||||
{
|
||||
item.CurrentUserHospitalGroupList = _userInfo.HospitalGroupList.Select(t => new HospitalGroupInfo() { Id = t.Id, Code = t.Code, Name = t.Name }).ToList();
|
||||
|
||||
}
|
||||
}
|
||||
return pageList;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改检查课题组 1是添加 2是删除
|
||||
/// </summary>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> ModifySCPStudyHospitalGroup(SCPStudyHospitalGroupCommand incommand)
|
||||
{
|
||||
if (incommand.AddOrDelete == 1)
|
||||
{
|
||||
//添加
|
||||
foreach (var item in incommand.SCPstudyIdList)
|
||||
{
|
||||
await _SCPStudyHospitalGroupRepository.AddAsync(new SCPStudyHospitalGroup() { SCPStudyId = item, HospitalGroupId = incommand.HospitalGroupId });
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//删除
|
||||
foreach (var item in incommand.SCPstudyIdList)
|
||||
{
|
||||
await _SCPStudyHospitalGroupRepository.DeleteFromQueryAsync(t => t.HospitalGroupId == incommand.HospitalGroupId && t.SCPStudyId == item);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
await _SCPStudyHospitalGroupRepository.SaveChangesAsync();
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
public async Task<IResponseOutput<List<PatientSeriesDTO>>> GetPatientSeriesList(Guid scpStudyId,
|
||||
[FromServices] IRepository<SCPSeries> _seriesRepository,
|
||||
|
|
@ -1315,7 +1385,7 @@ namespace IRaCIS.Application.Services
|
|||
}
|
||||
else
|
||||
{
|
||||
var identification = find.Status == SubjectStatus.OnVisit ? "Patient_TrialExistSubjectCodeError1" : "Patient_TrialExistSubjectCodeError2";
|
||||
var identification = find.Status == SubjectStatus.OnVisit ? "Patient_TrialExistSubjectCodeError1" : "Patient_TrialExistSubjectCodeError2";
|
||||
return ResponseOutput.NotOk(_localizer[identification, find.Code]);
|
||||
//subjectId = find.Id;
|
||||
}
|
||||
|
|
@ -1799,7 +1869,7 @@ namespace IRaCIS.Application.Services
|
|||
if (!arraysEqual)
|
||||
{
|
||||
//_localizer[$"{g.Key.SubjectCode}所提交的访视中的检查时间,不符合后续访视的检查时间比前序检查的时间大的要求"]
|
||||
return ResponseOutput.NotOk(_localizer["Patient_SubjectVisitSubmmitTimeVerifyError", g.Key.SubjectCode] );
|
||||
return ResponseOutput.NotOk(_localizer["Patient_SubjectVisitSubmmitTimeVerifyError", g.Key.SubjectCode]);
|
||||
}
|
||||
|
||||
if (DateTime.Now < studyTimeOrderList.Max(t => t.StudyTime))
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ public class SCPStudy : BaseFullDeleteAuditEntity, IEntitySeqId
|
|||
{
|
||||
|
||||
#region 导航属性
|
||||
[JsonIgnore]
|
||||
public List<SCPStudyHospitalGroup> HospitalGroupList { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public List<SCPStudySubjectVisit> SCPStudySubjectVisitList { get; set; }
|
||||
|
|
@ -65,6 +67,7 @@ public class SCPStudy : BaseFullDeleteAuditEntity, IEntitySeqId
|
|||
public bool IsUploadFinished { get; set; }
|
||||
|
||||
|
||||
|
||||
#region HIR 注释
|
||||
//public Guid TrialId { get; set; }
|
||||
//public Guid TrialSiteId { get; set; }
|
||||
|
|
@ -73,3 +76,18 @@ public class SCPStudy : BaseFullDeleteAuditEntity, IEntitySeqId
|
|||
#endregion
|
||||
|
||||
}
|
||||
|
||||
public class SCPStudyHospitalGroup : BaseFullAuditEntity
|
||||
{
|
||||
#region MyRegion
|
||||
[JsonIgnore]
|
||||
public HospitalGroup HospitalGroup { get; set; }
|
||||
[JsonIgnore]
|
||||
public SCPStudy SCPStudy { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
public Guid HospitalGroupId { get; set; }
|
||||
|
||||
public Guid SCPStudyId { get; set; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -175,5 +175,16 @@ namespace IRaCIS.Core.Domain.Models
|
|||
|
||||
|
||||
|
||||
public class CmoveStudy : BaseFullAuditEntity
|
||||
{
|
||||
public List<string> StudyInstanceUID { get; set; }
|
||||
|
||||
public string CallingAE { get; set; }
|
||||
|
||||
public string CalledAE { get; set; }
|
||||
|
||||
public List<Guid> HopitalGroupIdList { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -303,6 +303,10 @@ public partial class Trial : BaseFullDeleteAuditEntity
|
|||
[NotMapped]
|
||||
public List<CriterionType> CriterionTypeList => CriterionTypes.Split('|', StringSplitOptions.RemoveEmptyEntries)
|
||||
.Select(s => Enum.Parse(typeof(CriterionType), s)).Cast<CriterionType>().ToList();
|
||||
|
||||
|
||||
public Guid HospitalGroupId { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
namespace IRaCIS.Core.Domain.Share
|
||||
using static IRaCIS.Core.Domain.Share.UserInfo;
|
||||
|
||||
namespace IRaCIS.Core.Domain.Share
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户信息接口
|
||||
/// </summary>
|
||||
public interface IUserInfo
|
||||
{
|
||||
|
||||
List<HospitalGroupInfo> HospitalGroupList { get; }
|
||||
Guid UserRoleId { get; }
|
||||
|
||||
Guid IdentityUserId { get; }
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using Microsoft.AspNetCore.Http;
|
||||
using IRaCIS.Core.Infrastructure.Extention;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace IRaCIS.Core.Domain.Share
|
||||
{
|
||||
|
|
@ -46,6 +47,19 @@ namespace IRaCIS.Core.Domain.Share
|
|||
}
|
||||
}
|
||||
|
||||
public List<HospitalGroupInfo> HospitalGroupList
|
||||
{
|
||||
get
|
||||
{
|
||||
var hospitalGroupList = _accessor?.HttpContext?.User?.FindFirst(JwtIRaCISClaimType.HospitalGroupList);
|
||||
if (hospitalGroupList != null && !string.IsNullOrEmpty(hospitalGroupList.Value))
|
||||
{
|
||||
return (List<HospitalGroupInfo>) hospitalGroupList.Value.JsonStrToObject(typeof(List<HospitalGroupInfo>));
|
||||
}
|
||||
return new List<HospitalGroupInfo>();
|
||||
}
|
||||
}
|
||||
|
||||
public Guid UserTypeId
|
||||
{
|
||||
get
|
||||
|
|
@ -300,7 +314,13 @@ namespace IRaCIS.Core.Domain.Share
|
|||
}
|
||||
}
|
||||
|
||||
public class HospitalGroupInfo
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
public string Code { get; set; }
|
||||
}
|
||||
public Guid? SignId
|
||||
{
|
||||
|
||||
|
|
@ -369,6 +389,8 @@ namespace IRaCIS.Core.Domain.Share
|
|||
|
||||
public const string PermissionStr = "permissionStr";
|
||||
|
||||
public const string HospitalGroupList = "hospitalGroupList";
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
18820
IRaCIS.Core.Infra.EFCore/Migrations/20250818100243_addGroupField.Designer.cs
generated
Normal file
18820
IRaCIS.Core.Infra.EFCore/Migrations/20250818100243_addGroupField.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,167 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addGroupField : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_IdentityUser_User_CreateUserId",
|
||||
table: "IdentityUser");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_User_User_CreateUserId",
|
||||
table: "User");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_User_CreateUserId",
|
||||
table: "User");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_IdentityUser_CreateUserId",
|
||||
table: "IdentityUser");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "HospitalGroupId",
|
||||
table: "Trial",
|
||||
type: "uniqueidentifier",
|
||||
nullable: false,
|
||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "SCPStudyHospitalGroup",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
HospitalGroupId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
SCPStudyId = table.Column<Guid>(type: "uniqueidentifier", 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_SCPStudyHospitalGroup", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_SCPStudyHospitalGroup_HospitalGroup_HospitalGroupId",
|
||||
column: x => x.HospitalGroupId,
|
||||
principalTable: "HospitalGroup",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_SCPStudyHospitalGroup_SCPStudy_SCPStudyId",
|
||||
column: x => x.SCPStudyId,
|
||||
principalTable: "SCPStudy",
|
||||
principalColumn: "SeqId",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_SCPStudyHospitalGroup_User_CreateUserId",
|
||||
column: x => x.CreateUserId,
|
||||
principalTable: "User",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_HospitalGroupIdentityUser_HospitalGroupId",
|
||||
table: "HospitalGroupIdentityUser",
|
||||
column: "HospitalGroupId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_HospitalGroupIdentityUser_IdentityUserId",
|
||||
table: "HospitalGroupIdentityUser",
|
||||
column: "IdentityUserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_SCPStudyHospitalGroup_CreateUserId",
|
||||
table: "SCPStudyHospitalGroup",
|
||||
column: "CreateUserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_SCPStudyHospitalGroup_HospitalGroupId",
|
||||
table: "SCPStudyHospitalGroup",
|
||||
column: "HospitalGroupId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_SCPStudyHospitalGroup_SCPStudyId",
|
||||
table: "SCPStudyHospitalGroup",
|
||||
column: "SCPStudyId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_HospitalGroupIdentityUser_HospitalGroup_HospitalGroupId",
|
||||
table: "HospitalGroupIdentityUser",
|
||||
column: "HospitalGroupId",
|
||||
principalTable: "HospitalGroup",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_HospitalGroupIdentityUser_IdentityUser_IdentityUserId",
|
||||
table: "HospitalGroupIdentityUser",
|
||||
column: "IdentityUserId",
|
||||
principalTable: "IdentityUser",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_HospitalGroupIdentityUser_HospitalGroup_HospitalGroupId",
|
||||
table: "HospitalGroupIdentityUser");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_HospitalGroupIdentityUser_IdentityUser_IdentityUserId",
|
||||
table: "HospitalGroupIdentityUser");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "SCPStudyHospitalGroup");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_HospitalGroupIdentityUser_HospitalGroupId",
|
||||
table: "HospitalGroupIdentityUser");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_HospitalGroupIdentityUser_IdentityUserId",
|
||||
table: "HospitalGroupIdentityUser");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "HospitalGroupId",
|
||||
table: "Trial");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_User_CreateUserId",
|
||||
table: "User",
|
||||
column: "CreateUserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_IdentityUser_CreateUserId",
|
||||
table: "IdentityUser",
|
||||
column: "CreateUserId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUser_User_CreateUserId",
|
||||
table: "IdentityUser",
|
||||
column: "CreateUserId",
|
||||
principalTable: "User",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_User_User_CreateUserId",
|
||||
table: "User",
|
||||
column: "CreateUserId",
|
||||
principalTable: "User",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -17,7 +17,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "8.0.10")
|
||||
.HasAnnotation("ProductVersion", "8.0.19")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
|
@ -2858,6 +2858,10 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
|
||||
b.HasIndex("CreateUserId");
|
||||
|
||||
b.HasIndex("HospitalGroupId");
|
||||
|
||||
b.HasIndex("IdentityUserId");
|
||||
|
||||
b.ToTable("HospitalGroupIdentityUser", t =>
|
||||
{
|
||||
t.HasComment("用户课题组中间关系表");
|
||||
|
|
@ -2990,8 +2994,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CreateUserId");
|
||||
|
||||
b.HasIndex("TrialId");
|
||||
|
||||
b.ToTable("IdentityUser", t =>
|
||||
|
|
@ -8057,6 +8059,40 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.SCPStudyHospitalGroup", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("CreateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("HospitalGroupId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("SCPStudyId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("UpdateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("UpdateUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CreateUserId");
|
||||
|
||||
b.HasIndex("HospitalGroupId");
|
||||
|
||||
b.HasIndex("SCPStudyId");
|
||||
|
||||
b.ToTable("SCPStudyHospitalGroup");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.SCPStudySubjectVisit", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
|
|
@ -10712,6 +10748,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
.HasColumnType("nvarchar(400)")
|
||||
.HasComment("负责人PI");
|
||||
|
||||
b.Property<Guid>("HospitalGroupId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Indication")
|
||||
.IsRequired()
|
||||
.HasMaxLength(400)
|
||||
|
|
@ -13375,8 +13414,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CreateUserId");
|
||||
|
||||
b.HasIndex("DoctorId")
|
||||
.IsUnique()
|
||||
.HasFilter("[DoctorId] IS NOT NULL");
|
||||
|
|
@ -14983,23 +15020,31 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.HospitalGroup", "HospitalGroup")
|
||||
.WithMany("IdentityUserList")
|
||||
.HasForeignKey("HospitalGroupId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.IdentityUser", "IdentityUser")
|
||||
.WithMany("IdentityUserHospitalGroupList")
|
||||
.HasForeignKey("IdentityUserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("CreateUserRole");
|
||||
|
||||
b.Navigation("HospitalGroup");
|
||||
|
||||
b.Navigation("IdentityUser");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.IdentityUser", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.UserRole", "CreateUserRole")
|
||||
.WithMany()
|
||||
.HasForeignKey("CreateUserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.Trial", "Trial")
|
||||
.WithMany()
|
||||
.HasForeignKey("TrialId");
|
||||
|
||||
b.Navigation("CreateUserRole");
|
||||
|
||||
b.Navigation("Trial");
|
||||
});
|
||||
|
||||
|
|
@ -16334,6 +16379,33 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
b.Navigation("TrialSite");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.SCPStudyHospitalGroup", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.UserRole", "CreateUserRole")
|
||||
.WithMany()
|
||||
.HasForeignKey("CreateUserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.HospitalGroup", "HospitalGroup")
|
||||
.WithMany()
|
||||
.HasForeignKey("HospitalGroupId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.SCPStudy", "SCPStudy")
|
||||
.WithMany("HospitalGroupList")
|
||||
.HasForeignKey("SCPStudyId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("CreateUserRole");
|
||||
|
||||
b.Navigation("HospitalGroup");
|
||||
|
||||
b.Navigation("SCPStudy");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.SCPStudySubjectVisit", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.UserRole", "CreateUserRole")
|
||||
|
|
@ -17883,7 +17955,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.TrialUserRole", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.UserRole", "CreateUserRole")
|
||||
.WithMany("UserTrials")
|
||||
.WithMany()
|
||||
.HasForeignKey("CreateUserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
|
@ -18003,12 +18075,6 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.UserRole", b =>
|
||||
{
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.UserRole", "CreateUserRole")
|
||||
.WithMany()
|
||||
.HasForeignKey("CreateUserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.Doctor", null)
|
||||
.WithOne("User")
|
||||
.HasForeignKey("IRaCIS.Core.Domain.Models.UserRole", "DoctorId");
|
||||
|
|
@ -18020,13 +18086,11 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
.IsRequired();
|
||||
|
||||
b.HasOne("IRaCIS.Core.Domain.Models.UserType", "UserTypeRole")
|
||||
.WithMany("UserList")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserTypeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("CreateUserRole");
|
||||
|
||||
b.Navigation("IdentityUser");
|
||||
|
||||
b.Navigation("UserTypeRole");
|
||||
|
|
@ -18402,8 +18466,15 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
b.Navigation("DoctorList");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.HospitalGroup", b =>
|
||||
{
|
||||
b.Navigation("IdentityUserList");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.IdentityUser", b =>
|
||||
{
|
||||
b.Navigation("IdentityUserHospitalGroupList");
|
||||
|
||||
b.Navigation("UserRoleList");
|
||||
|
||||
b.Navigation("UserTrialList");
|
||||
|
|
@ -18500,6 +18571,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.SCPStudy", b =>
|
||||
{
|
||||
b.Navigation("HospitalGroupList");
|
||||
|
||||
b.Navigation("InstanceList");
|
||||
|
||||
b.Navigation("SCPStudySubjectVisitList");
|
||||
|
|
@ -18703,15 +18776,11 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
{
|
||||
b.Navigation("UserRoleTrials");
|
||||
|
||||
b.Navigation("UserTrials");
|
||||
|
||||
b.Navigation("VisitTaskList");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.UserType", b =>
|
||||
{
|
||||
b.Navigation("UserList");
|
||||
|
||||
b.Navigation("UserTypeGroupList");
|
||||
|
||||
b.Navigation("UserTypeMenuList");
|
||||
|
|
|
|||
Loading…
Reference in New Issue