Uat_Study
he 2023-03-31 13:23:43 +08:00
parent 57257a66ba
commit 032936982d
16 changed files with 206 additions and 88 deletions

View File

@ -140,10 +140,14 @@
// ------------------------------------------------------------Doctor--------------------------------------------------------------------
//DoctorService
"Doctor_DupPhoneOrEmail": "current phone or email number already existed",
"Doctor_DupPhone": "The current phone number already existed!",
"Doctor_DupEmail": "The current email already existed!",
"Doctor_StandardDuplicateFileTypeError": "This type of file has already been added to the current criterion.",
"Doctor_RequiredDocumentsError": "Resume & Consultant Agreement must be upload ",
// ------------------------------------------------------------Document--------------------------------------------------------------------
//SystemDocumentService
"SystemD_DuplicateFile": "A file of the same type and name already exists in the system.",
@ -432,9 +436,11 @@
"TrialSite_ParticipantJoined": "The subjects has been added to this site, and couldn't be disable.",
"TrialSite_CodeDuplicate": "Code is not allowed to be repeated",
"TrialSite_CannotDeleteAssociatedCRC": "The site has been associated with CRC, and couldn't be deleted.",
"TrialSite_CannotDeleteAssociatedSubject": "The subjects has been added to this site, and couldn't be deleted.",
"TrialSite_CannotDeleteUploadedData": "The site has been uploaded study, and couldn't be deleted.",
// ------------------------------------------------------------Visit--------------------------------------------------------------------
//SubjectService
"Subject_NoConfirmedPlan": "The visit plan of the project is not confirmed. Please contact the program Manager to confirm the visit plan before adding subjects.",

View File

@ -131,9 +131,13 @@
"Mail_AccountPasswordResetReminder": "[来自展影IRC] 关于重置账户密码的提醒",
"Mail_InvitationEmail": "[来自展影IRC] [{0}]邀请信",
// ------------------------------------------------------------Doctor--------------------------------------------------------------------
"Doctor_DupPhoneOrEmail": "当前的电话或电子邮件号码已经存在",
"Doctor_DupPhone": "当前的电话号码已经存在!",
"Doctor_DupEmail": "当前的邮箱已经存在!",
"Doctor_StandardDuplicateFileTypeError": "当前标准已添加过此类型文件",
"Doctor_RequiredDocumentsError": "简历及顾问协议必须上传",
// ------------------------------------------------------------Document--------------------------------------------------------------------
//SystemDocumentService
"SystemD_DuplicateFile": "系统中已存在同类型的同名文件。",
@ -410,8 +414,10 @@
"TrialSite_ParticipantJoined": "已有受试者加入中心,无法禁用",
"TrialSite_CodeDuplicate": "代码不能重复",
"TrialSite_CannotDeleteAssociatedCRC": "中心已经和CRC关联不能删除",
"TrialSite_CannotDeleteAssociatedSubject": "受试者已经添加,不能删除",
"TrialSite_CannotDeleteUploadedData": "中心已经上传调研,无法删除",
// ------------------------------------------------------------Visit--------------------------------------------------------------------
//SubjectService
"Subject_NoConfirmedPlan": "项目访视计划没有确认。请联系项目经理确认项目访视计划后,再添加受试者。",

View File

@ -60,7 +60,8 @@ namespace IRaCIS.Application.Services
{
Expression<Func<Doctor, bool>> verifyExp = t => t.Phone == basicInfoModel.Phone || t.EMail == basicInfoModel.EMail;
var verifyPair = new KeyValuePair<Expression<Func<Doctor, bool>>, string>(verifyExp, "current phone or email number already existed");
//---current phone or email number already existed
var verifyPair = new KeyValuePair<Expression<Func<Doctor, bool>>, string>(verifyExp, _localizer["Doctor_DupPhoneOrEmail"]);
if (basicInfoModel.Id == Guid.Empty || basicInfoModel.Id == null)
{
@ -70,12 +71,14 @@ namespace IRaCIS.Application.Services
//验证用户手机号
if (await _doctorRepository.AnyAsync(t => t.Phone == doctor.Phone))
{
return ResponseOutput.NotOk("The current phone number already existed!", new DoctorBasicInfoCommand());
//---The current phone number already existed!
return ResponseOutput.NotOk(_localizer["Doctor_DupPhone"], new DoctorBasicInfoCommand());
}
if (await _doctorRepository.AnyAsync(t => t.EMail == doctor.EMail))
{
return ResponseOutput.NotOk("The current email already existed!", new DoctorBasicInfoCommand());
//---The current email already existed!
return ResponseOutput.NotOk(_localizer["Doctor_DupEmail"], new DoctorBasicInfoCommand());
}
doctor.Code = (await _doctorRepository.MaxAsync(t => t.Code)) + 1;
@ -105,12 +108,14 @@ namespace IRaCIS.Application.Services
var phone = updateModel.Phone.Trim();
if ((await _doctorRepository.FirstOrDefaultAsync(t => t.Phone == phone && t.Id != updateModel.Id)) != null)
{
return ResponseOutput.NotOk("The current phone number already existed!", new DoctorBasicInfoCommand());
//---The current phone number already existed!
return ResponseOutput.NotOk(_localizer["Doctor_DupPhone"], new DoctorBasicInfoCommand());
}
var email = updateModel.EMail.Trim();
if (await _doctorRepository.AnyAsync(t => t.EMail == email && t.Id != updateModel.Id))
{
return ResponseOutput.NotOk("The current email already existed!", new DoctorBasicInfoCommand());
//---The current email already existed!
return ResponseOutput.NotOk(_localizer["Doctor_DupEmail"], new DoctorBasicInfoCommand());
}
var doctor = await _doctorRepository.FirstOrDefaultAsync(t => t.Id == updateModel.Id).IfNullThrowException();

View File

@ -1,4 +1,4 @@
//--------------------------------------------------------------------
//--------------------------------------------------------------------
// 此代码由T4模板自动生成 byzhouhang 20210918
// 生成时间 2022-03-04 13:33:56
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
@ -81,7 +81,8 @@ namespace IRaCIS.Core.Application.Service
{
if (existSysUser.LastName != addOrEditTrialExternalUser.LastName || existSysUser.FirstName != addOrEditTrialExternalUser.FirstName)
{
return ResponseOutput.NotOk($"该用户在系统中的用户名为:{existSysUser.LastName + " / " + existSysUser.FirstName} 电话:{existSysUser.Phone},与填写信息存在不一致项, 请将界面信息修改为与系统一致,再进行保存", new { existSysUser.LastName, existSysUser.FirstName, existSysUser.Phone, existSysUser.IsZhiZhun, existSysUser.IsTestUser }, ApiResponseCodeEnum.NeedTips);
//$"该用户在系统中的用户名为:{existSysUser.LastName + " / " + existSysUser.FirstName} 电话:{existSysUser.Phone},与填写信息存在不一致项, 请将界面信息修改为与系统一致,再进行保存",
return ResponseOutput.NotOk(_localizer["TrialExternalUser_Inconsistency", existSysUser.LastName + " / " + existSysUser.FirstName, existSysUser.Phone], new { existSysUser.LastName, existSysUser.FirstName, existSysUser.Phone, existSysUser.IsZhiZhun, existSysUser.IsTestUser }, ApiResponseCodeEnum.NeedTips);
}
}
@ -92,7 +93,8 @@ namespace IRaCIS.Core.Application.Service
t.Email == addOrEditTrialExternalUser.Email &&
t.UserTypeId == addOrEditTrialExternalUser.UserTypeId && t.TrialId == addOrEditTrialExternalUser.TrialId))
{
return ResponseOutput.NotOk("系统已经存在与列表中填写的邮箱和用户类型相同的账户,请确认。");
//---系统已经存在与列表中填写的邮箱和用户类型相同的账户,请确认。
return ResponseOutput.NotOk(_localizer["TrialExternalUser_EmailTypeDuplicate"]);
}
@ -157,7 +159,8 @@ namespace IRaCIS.Core.Application.Service
if (existUser.IsTestUser)
{
throw new BusinessValidationFailedException("正式类型 、培训类型的项目 不允许加入测试用户 ");
//---正式类型 、培训类型的项目 不允许加入测试用户
throw new BusinessValidationFailedException(_localizer["TrialExternalUser_TestUserNotAllowed"]);
}
}
@ -167,7 +170,8 @@ namespace IRaCIS.Core.Application.Service
if (existUser.IsTestUser == false )
{
throw new BusinessValidationFailedException("测试项目 不允许加入正式用户 ");
//---测试项目 不允许加入正式用户
throw new BusinessValidationFailedException(_localizer["TrialExternalUser_FormalUserNotAllowed"]);
}
}
@ -204,7 +208,8 @@ namespace IRaCIS.Core.Application.Service
}
else
{
return ResponseOutput.NotOk("人员信息不支持编辑,请删除后重新添加。");
//---人员信息不支持编辑,请删除后重新添加。
return ResponseOutput.NotOk(_localizer["TrialExternalUser_NotEditable"]);
}
}
@ -220,7 +225,8 @@ namespace IRaCIS.Core.Application.Service
if (await _trialUserRepository.AnyAsync(t => t.TrialId == trialExternalUser.TrialId && t.UserId == trialExternalUser.SystemUserId))
{
return ResponseOutput.NotOk("当前用户已参与到项目,不允许删除");
//---当前用户已参与到项目,不允许删除
return ResponseOutput.NotOk(_localizer["TrialExternalUser_CannotDelete"]);
}
@ -314,7 +320,11 @@ namespace IRaCIS.Core.Application.Service
{sysUserInfo.LastName + "/" + sysUserInfo.FirstName}:
</div>
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
{trialInfo.ResearchProgramNo} IRCIRC
{
//您好,展影医疗作为 实验方案号:{trialInfo.ResearchProgramNo} 项目的IRC供应商诚邀您参加该项目IRC相关工作欢迎您提供指导和建议非常感谢
_localizer["TrialExternalUser_IRCInvitation", trialInfo.ResearchProgramNo]
}
</div>
@ -377,7 +387,8 @@ namespace IRaCIS.Core.Application.Service
if (DateTime.Now > needUpdate.ExpireTime)
{
return ResponseOutput.NotOk("邀请加入时间已过期,重新被邀请后才可以进行确认操作");
//---邀请加入时间已过期,重新被邀请后才可以进行确认操作
return ResponseOutput.NotOk(_localizer["TrialExternalUser_InvitationExpired"]);
}
_mapper.Map(editTrialUserPreparation, needUpdate);
@ -409,7 +420,8 @@ namespace IRaCIS.Core.Application.Service
//收件地址
messageToSend.To.Add(new MailboxAddress(String.Empty, needUpdate.Email));
//主题
messageToSend.Subject = $"[来自展影IRC] [{trialInfo.ResearchProgramNo}] 账户信息";
//$"[来自展影IRC] [{trialInfo.ResearchProgramNo}] 账户信息";
messageToSend.Subject = _localizer["TrialExternalUser_AccountInfo", trialInfo.ResearchProgramNo];
var builder = new BodyBuilder();
@ -430,30 +442,63 @@ namespace IRaCIS.Core.Application.Service
<div style='line-height: 40px;font-size: 18px'>
{sysUserInfo.LastName + "/" + sysUserInfo.FirstName}:
</div>
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
{trialInfo.ResearchProgramNo}IRC
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
{
// 您好,欢迎您参加项目 实验方案号:{trialInfo.ResearchProgramNo}IRC相关工作。该项目采用电子化工作流系统及您的账号信息如下
_localizer["TrialExternalUser_Welcome", trialInfo.ResearchProgramNo]
}
</div>
<div style='border: 1px solid #eee;box-sizing:border-box;width: 80%;background: #fff;padding: 20px;line-height: 40px;font-size: 14px;border-radius: 5px;margin-left: 60px;margin-bottom: 30px;'>
<div>
: {trialInfo.TrialCode}
{
// 项目编号: {trialInfo.TrialCode}
_localizer["TrialExternalUser_ProjectNumber", trialInfo.TrialCode]
}
</div>
<div>
: {trialInfo.ResearchProgramNo}
{
// 试验方案号: {trialInfo.ResearchProgramNo}
_localizer["TrialExternalUser_ExperimentPlanNumber", trialInfo.ResearchProgramNo]
}
</div>
<div>
: {trialInfo.ExperimentName}
{
// 试验名称: {trialInfo.ExperimentName}
_localizer["TrialExternalUser_ExperimentName", trialInfo.ExperimentName]
}
</div>
<div>
: {sysUserInfo.UserName}
{
// 用户名: {sysUserInfo.UserName}
_localizer["TrialExternalUser_Username", sysUserInfo.UserName]
}
</div>
<div>
: {(sysUserInfo.IsFirstAdd ? verificationCode.ToString() + "(请在登录后进行修改)" : "***(您已有账号, 若忘记密码, 请通过邮箱找回)")}
</div>
{
// 密码: {(sysUserInfo.IsFirstAdd ? verificationCode.ToString() + "(请在登录后进行修改)" : "***(您已有账号, 若忘记密码, 请通过邮箱找回)")}
_localizer["TrialExternalUser_Password", verificationCode.ToString()]
}
</div>
<div>
: {sysUserInfo.UserTypeRole.UserTypeShortName}
{
// 角色: {sysUserInfo.UserTypeRole.UserTypeShortName}
_localizer["TrialExternalUser_Role", sysUserInfo.UserTypeRole.UserTypeShortName]
}
</div>
<div>
: {editTrialUserPreparation.BaseUrl}
{
// 系统登录地址: {editTrialUserPreparation.BaseUrl}
_localizer["TrialExternalUser_LoginUrl", editTrialUserPreparation.BaseUrl]
}
</div>
</div>
@ -539,7 +584,8 @@ namespace IRaCIS.Core.Application.Service
if (DateTime.Now > needUpdate.ExpireTime)
{
return ResponseOutput.NotOk("邀请加入时间已过期,重新被邀请后才可以进行确认操作");
//---邀请加入时间已过期,重新被邀请后才可以进行确认操作
return ResponseOutput.NotOk(_localizer["TrialExternalUser_InvitationExpired"]);
}
_mapper.Map(editInfo, needUpdate);
@ -549,7 +595,8 @@ namespace IRaCIS.Core.Application.Service
if (needUpdate.SystemUserId == null)
{
return ResponseOutput.NotOk("调研表系统用户Id 存储有问题");
//---调研表系统用户Id 存储有问题
return ResponseOutput.NotOk(_localizer["TrialExternalUser_UserIdStorageProblem"]);
}
var trialId = needUpdate.TrialSiteSurvey.TrialId;
@ -579,7 +626,8 @@ namespace IRaCIS.Core.Application.Service
//收件地址
messageToSend.To.Add(new MailboxAddress(String.Empty, editInfo.IsJoin == true ? needUpdate.Email : revieweUser.EMail));
//主题
messageToSend.Subject = $"[来自展影IRC] [{trialInfo.ResearchProgramNo}] 账户信息";
// $"[来自展影IRC] [{trialInfo.ResearchProgramNo}] 账户信息";
messageToSend.Subject = _localizer["TrialExternalUser_IRCAccountInfo", trialInfo.ResearchProgramNo];
var builder = new BodyBuilder();

View File

@ -219,7 +219,8 @@ namespace IRaCIS.Application.Services
if (await _repository.AnyAsync<TrialSiteUser>(t => t.UserId == trialUser.UserId && t.TrialId == trialUser.TrialId))
{
return ResponseOutput.NotOk("Participant has participated in site maintenance");
//---人员已加入现场维护
return ResponseOutput.NotOk(_localizer["TrialMaint_PersonnelJoined"]);
}
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.IQC && isDelete)

View File

@ -137,20 +137,23 @@ namespace IRaCIS.Application.Services
// 到时候 策略授权 统一改 归类
if (!(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin))
{
throw new BusinessValidationFailedException("只有PM/APM拥有操作权限!");
//---只有PM/APM拥有操作权限!
throw new BusinessValidationFailedException(_localizer["Trial_PMApmPermission"]);
}
//测试用户 只能创建非正式项目
if (_userInfo.IsTestUser && trialAddModel.TrialType != TrialType.NoneOfficial)
{
throw new BusinessValidationFailedException("测试用户 只能创建非正式项目");
//---测试用户 只能创建非正式项目
throw new BusinessValidationFailedException(_localizer["Trial_TestUserCreateOnlyNonFormal"]);
}
if (trialAddModel.Id == Guid.Empty || trialAddModel.Id == null)
{
if (await _trialRepository.AnyAsync(u => u.TrialCode == trialAddModel.TrialCode))
{
throw new BusinessValidationFailedException("已经存在相同的项目编号。");
//---已经存在相同的项目编号。
throw new BusinessValidationFailedException(_localizer["Trial_DuplicateProjectNumber"]);
}
var dbMaxCode = await _trialRepository.Where(t => t.CreateTime.Year == DateTime.Now.Year && t.TrialType == trialAddModel.TrialType).Select(t => t.Code).DefaultIfEmpty().MaxAsync();
@ -205,13 +208,15 @@ namespace IRaCIS.Application.Services
if (!await _repository.AnyAsync<Trial>(u => u.Id == trialAddModel.Id && (u.TrialStatusStr == StaticData.TrialState.TrialInitializing || u.TrialStatusStr == StaticData.TrialState.TrialOngoing)))
{
throw new BusinessValidationFailedException("项目状态只有处于:初始化或者进行中时,才允许操作。");
//---项目状态只有处于:初始化或者进行中时,才允许操作。
throw new BusinessValidationFailedException(_localizer["Trial_InvalidProjectStatus"]);
}
// 判断项目Id 是否已经存在
if (await _repository.AnyAsync<Trial>(u => u.TrialCode == updateModel.TrialCode && u.Id != updateModel.Id))
{
throw new BusinessValidationFailedException("已经存在相同的项目编号。");
//---已经存在相同的项目编号。
throw new BusinessValidationFailedException(_localizer["Trial_DuplicateProjectNumber"]);
}
@ -539,7 +544,8 @@ namespace IRaCIS.Application.Services
else
{
return ResponseOutput.NotOk("当前运行环境下,不允许删除项目数据。");
//---当前运行环境下,不允许删除项目数据。
return ResponseOutput.NotOk(_localizer["Trial_CannotDeleteProject"]);
}
@ -668,4 +674,4 @@ namespace IRaCIS.Application.Services
}
}
}

View File

@ -250,17 +250,20 @@ namespace IRaCIS.Core.Application.Services
//if (await _repository.AnyAsync<TrialSiteUser>(t => t.TrialId == trialId && t.SiteId == siteId))
//{
// return ResponseOutput.NotOk("The site has been associated with CRC, and couldn't be deleted.");
//---The site has been associated with CRC, and couldn't be deleted.
// return ResponseOutput.NotOk(_localizer["TrialSite_CannotDeleteAssociatedCRC"]);
//}
if (await _repository.AnyAsync<Subject>(t => t.SiteId == siteId && t.TrialId == trialId))
{
return ResponseOutput.NotOk("The subjects has been added to this site, and couldn't be disable.");
//---The subjects has been added to this site, and couldn't be disable.
return ResponseOutput.NotOk(_localizer["TrialSite_ParticipantJoined"]);
}
//if (await _repository.AnyAsync<DicomStudy>(t => t.SiteId == siteId && t.TrialId == trialId))
//{
// return ResponseOutput.NotOk("The site has been uploaded study, and couldn't be deleted.");
//---The site has been uploaded study, and couldn't be deleted.
// return ResponseOutput.NotOk(_localizer["TrialSite_CannotDeleteUploadedData"]);
//}
@ -269,7 +272,8 @@ namespace IRaCIS.Core.Application.Services
{
if (await _trialSiteRepository.AnyAsync(t => t.Id != editTrialSiteCommand.Id && t.TrialSiteCode == editTrialSiteCommand.TrialSiteCode && t.TrialId == editTrialSiteCommand.TrialId))
{
return ResponseOutput.NotOk("Code is not allowed to be repeated");
//---Code is not allowed to be repeated
return ResponseOutput.NotOk(_localizer["TrialSite_CodeDuplicate"]);
}
}
@ -360,16 +364,19 @@ namespace IRaCIS.Core.Application.Services
if (await _repository.AnyAsync<TrialSiteUser>(t => t.TrialId == trialId && t.SiteId == siteId))
{
return ResponseOutput.NotOk("The site has been associated with CRC, and couldn't be deleted.");
//---The site has been associated with CRC, and couldn't be deleted.
return ResponseOutput.NotOk(_localizer["TrialSite_CannotDeleteAssociatedCRC"]);
}
if (await _repository.AnyAsync<Subject>(t => t.SiteId == siteId && t.TrialId == trialId))
{
return ResponseOutput.NotOk("The subjects has been added to this site, and couldn't be deleted.");
//---The subjects has been added to this site, and couldn't be deleted.
return ResponseOutput.NotOk(_localizer["TrialSite_CannotDeleteAssociatedSubject"]);
}
if (await _repository.AnyAsync<DicomStudy>(t => t.SiteId == siteId && t.TrialId == trialId))
{
return ResponseOutput.NotOk("The site has been uploaded study, and couldn't be deleted.");
//---The site has been uploaded study, and couldn't be deleted.
return ResponseOutput.NotOk(_localizer["TrialSite_CannotDeleteUploadedData"]);
}
await _repository.DeleteAsync(relation);
@ -379,4 +386,4 @@ namespace IRaCIS.Core.Application.Services
}
}
}

View File

@ -34,13 +34,15 @@ namespace IRaCIS.Application.Services
var svlist = new List<SubjectVisit>();
if (await _repository.AnyAsync<Trial>(t => t.Id == subjectCommand.TrialId && !t.VisitPlanConfirmed))
{
return ResponseOutput.NotOk("项目访视计划没有确认。请联系项目经理确认项目访视计划后,再添加受试者。");
//---项目访视计划没有确认。请联系项目经理确认项目访视计划后,再添加受试者。
return ResponseOutput.NotOk(_localizer["Subject_NoConfirmedPlan"]);
}
var verifyExp1 = new EntityVerifyExp<Subject>()
{
VerifyExp = u => u.Code == subjectCommand.Code && u.TrialId == subjectCommand.TrialId,
VerifyMsg = "已存在具有相关受试者编号的受试者。"
//---已存在具有相关受试者编号的受试者。
VerifyMsg = _localizer["Subject_DuplicateSubjectNum"]
};
@ -91,7 +93,8 @@ namespace IRaCIS.Application.Services
if (await _subjectVisitRepository.AnyAsync(u => u.SubjectId == id && u.VisitExecuted == VisitExecutedEnum.Executed))
{
return ResponseOutput.NotOk("该受试者已经有访视已经上传影像,不允许删除。");
//---该受试者已经有访视已经上传影像,不允许删除。
return ResponseOutput.NotOk(_localizer["Subject_UploadedVisitNoDelete"]);
}
await _subjectRepository.UpdatePartialFromQueryAsync(id, x => new Subject

View File

@ -80,20 +80,23 @@ namespace IRaCIS.Core.Application.Services
var verifyExp1 = new EntityVerifyExp<SubjectVisit>()
{
VerifyExp = t => t.VisitNum == svCommand.VisitNum && t.SubjectId == svCommand.SubjectId,
VerifyMsg = "该受试者的访视计划中已经包含一个具有相同访视号的访视。"
//---该受试者的访视计划中已经包含一个具有相同访视号的访视。
VerifyMsg = _localizer["Visit_DuplicateVisitNo"]
};
var verifyExp2 = new EntityVerifyExp<SubjectVisit>()
{
VerifyExp = t => t.SubjectId == svCommand.SubjectId && t.IsFinalVisit,
VerifyMsg = "该受试者已经有访视设置为末次访视,不允许将当前访视设置为末次访视。",
//---该受试者已经有访视设置为末次访视,不允许将当前访视设置为末次访视。
VerifyMsg = _localizer["Visit_LastVisitNoChange"],
IsVerify = svCommand.IsFinalVisit
};
var verifyExp3 = new EntityVerifyExp<SubjectVisit>()
{
VerifyExp = t => t.SubjectId == svCommand.SubjectId && t.VisitName == svCommand.VisitName,
VerifyMsg = "该受试者的访视计划中已经包含一个具有相同访视名称的访视。"
//---该受试者的访视计划中已经包含一个具有相同访视名称的访视。
VerifyMsg = _localizer["Visit_DuplicateVisitName"]
};
@ -113,12 +116,14 @@ namespace IRaCIS.Core.Application.Services
{
if (await _subjectVisitRepository.AnyAsync(t => t.SubjectId == svCommand.SubjectId && t.IsFinalVisit))
{
throw new BusinessValidationFailedException("设置末次评估后,不允许添加计划外访视。");
//---设置末次评估后,不允许添加计划外访视。
throw new BusinessValidationFailedException(_localizer["Visit_NoExtraVisitAfterLast"]);
}
if (await _repository.AnyAsync<VisitTask>(t => t.SubjectId == svCommand.SubjectId && t.TaskState == TaskState.Effect && t.VisitTaskNum > svCommand.VisitNum && t.SignTime != null && t.TrialReadingCriterion.IsReadingTaskViewInOrder))
{
throw new BusinessValidationFailedException("该受试者后续访视已有任务完成阅片(有序阅片标准),不允许在此添加,如果确实需要,请回退");
//---该受试者后续访视已有任务完成阅片(有序阅片标准),不允许在此添加,如果确实需要,请回退
throw new BusinessValidationFailedException(_localizer["Visit_FinishedTasksNoAdd"]);
}
}
@ -150,19 +155,22 @@ namespace IRaCIS.Core.Application.Services
if (svCommand.PDState != dbBeforeEntity.PDState && dbBeforeEntity.SubmitState == SubmitStateEnum.Submitted)
{
throw new BusinessValidationFailedException("当前访视影像提交后不允许修改PD确认状态。");
//---当前访视影像提交后不允许修改PD确认状态。
throw new BusinessValidationFailedException(_localizer["Visit_NoPDStatusChangeAfterSubmission"]);
}
if (svCommand.PDState != dbBeforeEntity.PDState && dbBeforeEntity.RequestBackState == RequestBackStateEnum.PM_AgressBack)
{
throw new BusinessValidationFailedException("当前访视为回退的访视不允许修改PD确认状态。");
//---当前访视影像提交后不允许修改PD确认状态。
throw new BusinessValidationFailedException(_localizer["Visit_NoPDStatusChangeAfterSubmission"]);
}
if (svCommand.IsLostVisit)
{
if (await _subjectVisitRepository.AnyAsync(t => t.Id == svCommand.Id && t.SubmitState == SubmitStateEnum.ToSubmit))
{
throw new BusinessValidationFailedException("当前访视已经有有影像上传,不允许设置为失访。");
//---当前访视已经有影像上传,不允许设置为失访。
throw new BusinessValidationFailedException(_localizer["Visit_UploadedNoLost"]);
}
}
@ -211,15 +219,18 @@ namespace IRaCIS.Core.Application.Services
{
if (await _repository.AnyAsync<DicomStudy>(t => t.SubjectVisitId == id))
{
return ResponseOutput.NotOk("当前访视已经有影像上传,不允许删除。");
//---当前访视已经有影像上传,不允许删除。
return ResponseOutput.NotOk(_localizer["Visit_UploadedNoDelete"]);
}
if (await _subjectVisitRepository.AnyAsync(t => t.Id == id && t.InPlan))
{
return ResponseOutput.NotOk("计划内的访视不允许删除。");
//---计划内的访视不允许删除。
return ResponseOutput.NotOk(_localizer["Visit_PlanVisitNoDelete"]);
}
if (await _subjectVisitRepository.AnyAsync(t => t.OutPlanPreviousVisitId == id))
{
return ResponseOutput.NotOk("当前访视已经被设置为另一访视的上一访视,不允许删除。");
//---当前访视已经被设置为另一访视的上一访视,不允许删除。
return ResponseOutput.NotOk(_localizer["Visit_PreviousVisitNoDelete"]);
}
await _subjectVisitRepository.DeleteFromQueryAsync(s => s.Id == id, true);

View File

@ -128,7 +128,8 @@ namespace IRaCIS.Application.Services
//比当前 visitNum小的 visitDay的最大值 还小 不允许添加
if (visitPlan.VisitDay <= visitPlanList.Where(t => t.VisitNum < visitPlan.VisitNum).Select(t => t.VisitDay).Max())
{
throw new BusinessValidationFailedException("访视计划中,访视号大的访视,其访视间隔也应该比访视号小的访视大。");
//---访视计划中,访视号大的访视,其访视间隔也应该比访视号小的访视大。
throw new BusinessValidationFailedException(_localizer["VisitPlan_LargerVisitNumLargerInterval"]);
}
}
@ -137,7 +138,8 @@ namespace IRaCIS.Application.Services
{
if (visitPlan.VisitDay >= visitPlanList.Where(t => t.VisitNum > visitPlan.VisitNum).Select(t => t.VisitDay).Min())
{
throw new BusinessValidationFailedException("访视计划中,访视号大的计划访视,其访视间隔也应该比访视号小的计划访视大。");
//---访视计划中,访视号大的计划访视,其访视间隔也应该比访视号小的计划访视大。
throw new BusinessValidationFailedException(_localizer["VisitPlan_LargerPlanNumLargerInterval"]);
}
}
@ -148,12 +150,14 @@ namespace IRaCIS.Application.Services
if (await _visitStageRepository.AnyAsync(t => t.TrialId == visitPlan.TrialId && (t.VisitName == visitPlan.VisitName || t.VisitNum == visitPlan.VisitNum), true))
{
throw new BusinessValidationFailedException("访视计划中已经存在具有项目访视名称或者访视号的计划访视模板。");
//---访视计划中已经存在具有项目访视名称或者访视号的计划访视模板。
throw new BusinessValidationFailedException(_localizer["VisitPlan_ExistNameOrNumTemplate"]);
}
if (await _visitStageRepository.AnyAsync(t => t.TrialId == visitPlan.TrialId && t.IsBaseLine, true) && visitPlan.IsBaseLine)
{
throw new BusinessValidationFailedException("访视计划中已经存在基线。");
//---访视计划中已经存在基线。
throw new BusinessValidationFailedException(_localizer["VisitPlan_ExistBaseline"]);
}
//不用前端传递的值
@ -171,12 +175,14 @@ namespace IRaCIS.Application.Services
if (await _visitStageRepository.AnyAsync(t => t.TrialId == visitPlan.TrialId && (t.VisitName == visitPlan.VisitName || t.VisitNum == visitPlan.VisitNum) && t.Id != visitPlan.Id, true))
{
throw new BusinessValidationFailedException("访视计划中已经存在具有项目访视名称或者访视号的计划访视模板。");
//---访视计划中已经存在具有项目访视名称或者访视号的计划访视模板。
throw new BusinessValidationFailedException(_localizer["VisitPlan_ExistNameOrNumTemplate"]);
}
if (await _visitStageRepository.AnyAsync(t => t.TrialId == visitPlan.TrialId && t.IsBaseLine && t.Id != visitPlan.Id, true) && visitPlan.IsBaseLine)
{
throw new BusinessValidationFailedException("访视计划中已经存在基线。");
//---访视计划中已经存在基线。
throw new BusinessValidationFailedException(_localizer["VisitPlan_ExistBaseline"]);
}
visitPlan.IsConfirmed = false;
@ -189,7 +195,8 @@ namespace IRaCIS.Application.Services
{
if (await _repository.Where<SubjectVisit>(t => t.TrialId == visitPlan.TrialId).AnyAsync(v => v.IsBaseLine && v.SubmitState >= SubmitStateEnum.ToSubmit))
{
throw new BusinessValidationFailedException("有受试者的基线已经上传了影像数据,不允许修改基线访视。");
//---有受试者的基线已经上传了影像数据,不允许修改基线访视。
throw new BusinessValidationFailedException(_localizer["VisitPlan_ExistBaselineImgNoModify"]);
}
}
@ -213,24 +220,28 @@ namespace IRaCIS.Application.Services
{
if (!await _trialRepository.AnyAsync(t => t.Id == trialId && (t.TrialStatusStr == StaticData.TrialState.TrialInitializing || t.TrialStatusStr == StaticData.TrialState.TrialOngoing)))
{
return ResponseOutput.NotOk("仅仅在项目初始化或者进行中时,才允许修改确认");
//---仅仅在项目初始化或者进行中时,才允许修改确认
return ResponseOutput.NotOk(_localizer["VisitPlan_OnlyInitOrOngoingModifyConfirm"]);
}
if (!await _visitStageRepository.AnyAsync(t => t.TrialId == trialId && t.IsBaseLine))
{
return ResponseOutput.NotOk("没有基线,不允许确认");
//---没有基线,不允许确认
return ResponseOutput.NotOk(_localizer["VisitPlan_NoBaselineNotConfirm"]);
}
if (!await _trialRepository.AnyAsync(t => t.Id == trialId && t.IsTrialBasicLogicConfirmed && t.IsTrialProcessConfirmed && t.IsTrialUrgentConfirmed))
{
return ResponseOutput.NotOk("项目配置未确认,不允许确认访视计划");
//---项目配置未确认,不允许确认访视计划
return ResponseOutput.NotOk(_localizer["VisitPlan_ConfigNotConfirmNotConfirm"]);
}
var svList = await _visitStageRepository.Where(t => t.TrialId == trialId).Select(u => new { u.VisitDay, u.IsBaseLine }).ToListAsync();
if (svList.Min(t => t.VisitDay) != svList.Where(t => t.IsBaseLine).FirstOrDefault()?.VisitDay)
{
return ResponseOutput.NotOk("基线VisitDay 不是最小的, 不允许确认");
//---基线VisitDay 不是最小的, 不允许确认
return ResponseOutput.NotOk(_localizer["VisitPlan_BaselineNotMinDayNotConfirm"]);
}
@ -480,7 +491,8 @@ namespace IRaCIS.Application.Services
var result = await exporter.ExportAsByteArray(list);
return new XlsxFileResult(bytes: result, fileDownloadName: $"检查导出_{DateTime.Now.ToString("yyyy-MM-dd:hh:mm:ss")}.xlsx");
//$"检查导出_{DateTime.Now.ToString("yyyy-MM-dd:hh:mm:ss")}.xlsx"
return new XlsxFileResult(bytes: result, fileDownloadName: _localizer["VisitPlan_CheckExport", DateTime.Now.ToString("yyyy-MM-dd:hh:mm:ss")]);
}
@ -498,7 +510,8 @@ namespace IRaCIS.Application.Services
if (visitPlan == null) return Null404NotFound(visitPlan);
if (await _repository.AnyAsync<SubjectVisit>(t => t.VisitName == visitPlan.VisitName && t.TrialId == visitPlan.TrialId && t.VisitExecuted == VisitExecutedEnum.Executed))
{
return ResponseOutput.NotOk("The visit plan has been assigned to the subjects and executed.");
//---The visit plan has been assigned to the subjects and executed.
return ResponseOutput.NotOk(_localizer["VisitPlan_Assigned"]);
}
await _repository.BatchDeleteAsync<SubjectVisit>(t => t.TrialId == visitPlan.TrialId && t.VisitName == visitPlan.VisitName);
@ -510,4 +523,4 @@ namespace IRaCIS.Application.Services
}
}
}

View File

@ -128,7 +128,8 @@ namespace IRaCIS.Application.Services
if (readingCategoryList.Except(inDto.ReadingCategorys).Count() > 0)
{
return ResponseOutput.NotOk("已分配任务,不允许减少阅片类型");
//---已分配任务,不允许减少阅片类型
return ResponseOutput.NotOk(_localizer["DoctorWorkload_AssignType"]);
}
@ -658,7 +659,8 @@ namespace IRaCIS.Application.Services
if (await _doctorWorkloadRepository.AnyAsync(workloadLambda))
{
return ResponseOutput.NotOk("This type of data can only have one");
//---This type of data can only have one
return ResponseOutput.NotOk(_localizer["DoctorWorkload_Unique"]);
}
}
@ -669,7 +671,8 @@ namespace IRaCIS.Application.Services
doctorworkloadLambda = doctorworkloadLambda.And(t => t.DataFrom == (int)WorkLoadFromStatus.Doctor);
if (await _doctorWorkloadRepository.AnyAsync(doctorworkloadLambda))
{
return ResponseOutput.NotOk("This type of data can only have one");
//---This type of data can only have one
return ResponseOutput.NotOk(_localizer["DoctorWorkload_Unique"]);
}
}
@ -698,7 +701,8 @@ namespace IRaCIS.Application.Services
if (isLocked)
{
return ResponseOutput.NotOk("Expenses have been settled and workload cannot be modified.");
//---Expenses have been settled and workload cannot be modified.
return ResponseOutput.NotOk(_localizer["DoctorWorkload_FeeSettled"]);
}

View File

@ -259,7 +259,8 @@ namespace IRaCIS.Application.Services
}
return ResponseOutput.Result(await _enrollRepository.SaveChangesAsync());
}
return ResponseOutput.NotOk($"Cannot find trial {trialId}");
//$"Cannot find trial {trialId}"
return ResponseOutput.NotOk(_localizer["Enroll_NotFound", trialId]);
}
/// <summary>
@ -387,7 +388,8 @@ namespace IRaCIS.Application.Services
if (errorList.Count() > 0)
{
return ResponseOutput.NotOk(string.Join(',', errorList.Select(c => c.LastName+" / "+c.FirstName)) +"邮箱格式存在问题") ;
// errorList.Select(c => c.LastName+" / "+c.FirstName)) +"邮箱格式存在问题"
return ResponseOutput.NotOk(string.Join(',', _localizer["Enroll_EmailFormat"], errorList.Select(c => c.LastName + " / " + c.FirstName))) ;
}
if (confirmReviewerCommand.ConfirmState == 1) //确认入组
@ -489,7 +491,8 @@ namespace IRaCIS.Application.Services
u.Downtime);
if (sum != 0)
{
return ResponseOutput.NotOk("Reviewers with workload cannot go back");
//---Reviewers with workload cannot go back
return ResponseOutput.NotOk(_localizer["Enroll_CannotRollback"]);
}
intoGroupItem.EnrollStatus = EnrollStatus.InviteIntoGroup;

View File

@ -11,7 +11,7 @@ namespace IRaCIS.Core.Application.Triggers
{
// 统一处理 外部用户、中心调研(先添加 再发送邮件)、参与医生加入到项目 ----废弃
public class AddlTrialUserTrigger : IBeforeSaveTrigger<TrialUser>
public class AddlTrialUserTrigger :BaseService, IBeforeSaveTrigger<TrialUser>
{
private readonly IRepository<Trial> _trialRepository;
@ -41,7 +41,8 @@ namespace IRaCIS.Core.Application.Triggers
if (user.IsTestUser)
{
throw new BusinessValidationFailedException("正式类型 、培训类型的项目 不允许加入测试用户 ");
//---正式类型 、培训类型的项目 不允许加入测试用户
throw new BusinessValidationFailedException(_localizer["AddlTrialUser_NoTestUser"]);
}
}
@ -51,7 +52,8 @@ namespace IRaCIS.Core.Application.Triggers
if (user.IsTestUser == false )
{
throw new BusinessValidationFailedException("测试项目 不允许加入正式用户 ");
//---测试项目 不允许加入正式用户
throw new BusinessValidationFailedException(_localizer["AddlTrialUser_NoFormalUser"]);
}
}
@ -60,4 +62,4 @@ namespace IRaCIS.Core.Application.Triggers
}
}
}

View File

@ -9,7 +9,7 @@ namespace IRaCIS.Core.Application.Triggers
/// <summary>
///
/// </summary>
public class SubjectStateTrigger : IAfterSaveTrigger<Subject>
public class SubjectStateTrigger :BaseService, IAfterSaveTrigger<Subject>
{
private readonly IRepository<SubjectVisit> _subjectVisitRepository;
private readonly IRepository _repository;
@ -67,7 +67,8 @@ namespace IRaCIS.Core.Application.Triggers
{
throw new BusinessValidationFailedException(
"该受试者已经有访视被设置为末次访视,不允许将当前访视设置为末次访视。");
//---该受试者已经有访视被设置为末次访视,不允许将当前访视设置为末次访视。
_localizer["SubjectState_CannotSetCurrentAsLastVisit"]);
}
var sv = await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == dbSubject.FinalSubjectVisitId).IfNullThrowException();
@ -76,7 +77,8 @@ namespace IRaCIS.Core.Application.Triggers
{
throw new BusinessValidationFailedException(
"该受试者当前访视后有访视的影像已上传,当前访视不允许设置为末次访视。");
//---该受试者当前访视后有访视的影像已上传,当前访视不允许设置为末次访视。
_localizer["SubjectState_CannotSetAsLastVisitWithImage"]);
}
@ -95,4 +97,4 @@ namespace IRaCIS.Core.Application.Triggers
}
}
}
}

View File

@ -10,7 +10,7 @@ namespace IRaCIS.Core.Application.Triggers
/// <summary>
/// 处理 访视 末次评估 会影响Subject 状态
/// </summary>
public class SubjectVisitFinalVisitTrigger : IAfterSaveTrigger<SubjectVisit>
public class SubjectVisitFinalVisitTrigger :BaseService, IAfterSaveTrigger<SubjectVisit>
{
private readonly IRepository<SubjectVisit> _subjectVisitRepository;
private readonly IRepository<ReadingPeriodSet> _readingPeriodSetRepository;
@ -180,7 +180,8 @@ namespace IRaCIS.Core.Application.Triggers
if (await _subjectVisitRepository.AnyAsync(t => t.SubjectId == subjectVisit.SubjectId && t.VisitNum > subjectVisit.VisitNum &&
(t.SubmitState == SubmitStateEnum.ToSubmit || t.SubmitState == SubmitStateEnum.Submitted)))
{
throw new BusinessValidationFailedException("该受试者已有后续访视已上传影像或已提交,当前访视不允许设置为末次访视。");
//---该受试者已有后续访视已上传影像或已提交,当前访视不允许设置为末次访视。
throw new BusinessValidationFailedException(_localizer["SubjectVisit_CannotSetAsLastVisit"]);
}
}

Binary file not shown.