Merge branch 'Test.Study' of http://192.168.3.68:2000/XCKJ/irc-netcore-api into Test.Study
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
1b1ac3ee65
|
@ -32,8 +32,10 @@ namespace IRaCIS.Core.Application.Filter
|
|||
|
||||
if (context.Exception.GetType() == typeof(BusinessValidationFailedException))
|
||||
{
|
||||
context.Result = new JsonResult(ResponseOutput.NotOk(context.Exception.Message,ApiResponseCodeEnum.BusinessValidationFailed));
|
||||
}
|
||||
var error = context.Exception as BusinessValidationFailedException;
|
||||
|
||||
context.Result = new JsonResult(ResponseOutput.NotOk(context.Exception.Message, error!.Code));
|
||||
}
|
||||
else if(context.Exception.GetType() == typeof(QueryBusinessObjectNotExistException))
|
||||
{
|
||||
context.Result = new JsonResult(ResponseOutput.NotOk( context.Exception.Message, ApiResponseCodeEnum.DataNotExist));
|
||||
|
|
|
@ -4521,6 +4521,11 @@
|
|||
是否是第一次转化的任务
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.GetRelatedVisitTaskOutDto.IsExistsClinicalData">
|
||||
<summary>
|
||||
是否存在临床数据
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.GetGlobalReadingInfoInDto.UsingOriginalData">
|
||||
<summary>
|
||||
当新答案为空的时候 是否是有原数据
|
||||
|
|
|
@ -364,7 +364,10 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid TrialReadingCriterionId { get; set; }
|
||||
|
||||
public Guid? SubjectId { get; set; }
|
||||
|
||||
public Guid TrialReadingCriterionId { get; set; }
|
||||
|
||||
public string? SubjectCode { get; set; } = null;
|
||||
|
||||
|
|
|
@ -280,12 +280,12 @@ namespace IRaCIS.Core.Application.Service
|
|||
var defaultState = trialReadingCriterionConfig.FollowVisitAutoAssignDefaultState == TaskAllocateDefaultState.InitAllocated ? TaskAllocationState.InitAllocated : TaskAllocationState.Allocated;
|
||||
|
||||
}
|
||||
await _visitTaskRepository.SaveChangesAsync();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
await _visitTaskRepository.SaveChangesAsync();
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ using IRaCIS.Application.Services.BackGroundJob;
|
|||
using Magicodes.ExporterAndImporter.Core.Extension;
|
||||
using Hangfire;
|
||||
using MassTransit;
|
||||
using static IRaCIS.Core.Domain.Models.ReadingQuestionTrial;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service.Allocation
|
||||
{
|
||||
|
@ -226,6 +227,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||
public async Task<IResponseOutput<PageOutput<PIReaingTaskView>>> GetPIReadingAuditList(VisitTaskQuery queryVisitTask)
|
||||
{
|
||||
|
||||
//CriterionType? criterionType = _trialReadingCriterionRepository.Where(t => t.Id == queryVisitTask.TrialReadingCriterionId).Select(t=>t.CriterionType).FirstOrDefault();
|
||||
|
||||
var visitTaskQueryable = GetReadingTaskQueryable(queryVisitTask)
|
||||
.ProjectTo<PIReaingTaskView>(_mapper.ConfigurationProvider);
|
||||
|
||||
|
@ -237,6 +240,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||
|
||||
var questionList = _readingQuestionTrialRepository.Where(t => t.TrialId == queryVisitTask.TrialId && t.ReadingQuestionCriterionTrialId == queryVisitTask.TrialReadingCriterionId)
|
||||
.Where(t => t.IsJudgeQuestion == true)
|
||||
//.WhereIf(criterionType!=null&& criterionType!=CriterionType.SelfDefine,t=>t.IsJudgeQuestion==true)
|
||||
// .WhereIf(criterionType != null && criterionType == CriterionType.SelfDefine, t => t.AssessmentResultEnum == AssessmentResultType.AssessmentResult)
|
||||
.Select(t => new { QuestionId = t.Id, QuestionName = _userInfo.IsEn_Us ? t.QuestionEnName : t.QuestionName ,t.DictionaryCode}).ToList();
|
||||
|
||||
trialTaskConfig!.OtherObj = questionList;
|
||||
|
@ -658,9 +663,9 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||
|
||||
var visitQuery = _visitTaskRepository
|
||||
.Where(x => x.TrialId == inDto.TrialId && x.TaskState == TaskState.Effect)
|
||||
|
||||
//PI 读基线的时候,subject 如果PI基线没阅片完,SR就不能看
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SR && piReadingScopenEnum == PIReadingScopenEnum.AllBaseline && readingDivisionEnum == ReadingDivisionEnum.PIandSR,
|
||||
.WhereIf(inDto.SubjectId!=null,t=>t.SubjectId==inDto.SubjectId)
|
||||
//PI 读基线的时候,subject 如果PI基线没阅片完,SR就不能看
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SR && piReadingScopenEnum == PIReadingScopenEnum.AllBaseline && readingDivisionEnum == ReadingDivisionEnum.PIandSR,
|
||||
t => t.Subject.SubjectVisitTaskList.Any(c => c.SourceSubjectVisit.IsBaseLine == true && c.ReadingTaskState == ReadingTaskState.HaveSigned && c.TaskState == TaskState.Effect && c.TrialReadingCriterionId == trialReadingCriterionId))
|
||||
|
||||
//PI 读随访的时候, subject 如果SR基线没阅片完,PI就不能看
|
||||
|
|
|
@ -4,6 +4,7 @@ using IRaCIS.Core.Application.Contracts;
|
|||
using IRaCIS.Core.Application.ViewModel;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using static IRaCIS.Core.Domain.Models.ReadingQuestionTrial;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
|
@ -85,7 +86,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
CreateMap<VisitTask, ReadingTaskView>().IncludeBase<VisitTask, VisitTaskView>()
|
||||
.ForMember(t=>t.PIReadingResultList,u=>u.MapFrom(c=>c.ReadingTaskQuestionAnswerList
|
||||
.Where(t=>t.ReadingQuestionTrial.IsJudgeQuestion==true ).Select(d=>new PIReadingResult() { QuestionId= d.ReadingQuestionTrialId,Answer=d.Answer})));
|
||||
.Where(t=> /*t.ReadingQuestionCriterionTrial.CriterionType==CriterionType.SelfDefine? t.ReadingQuestionTrial.AssessmentResultEnum == AssessmentResultType.AssessmentResult:*/ t.ReadingQuestionTrial.IsJudgeQuestion==true)
|
||||
.Select(d=>new PIReadingResult() { QuestionId= d.ReadingQuestionTrialId,Answer=d.Answer})));
|
||||
|
||||
CreateMap<VisitTask, PIReaingTaskView>().IncludeBase<VisitTask, ReadingTaskView>()
|
||||
.ForMember(o => o.FirstAuditUserName, t => t.MapFrom(u => u.FirstAuditUser.UserName))
|
||||
|
|
|
@ -144,7 +144,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
await _internationalizationRepository.SaveChangesAsync();
|
||||
|
||||
|
||||
//清理缓存
|
||||
_provider.Set<List<InternationalizationSimpleDto>>(StaticData.InternationalData.Front, new List<InternationalizationSimpleDto>(), TimeSpan.FromDays(1));
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
|
@ -183,6 +184,9 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
}
|
||||
|
||||
//清理缓存
|
||||
_provider.Set<List<InternationalizationSimpleDto>>(StaticData.InternationalData.Front, new List<InternationalizationSimpleDto>(), TimeSpan.FromDays(1));
|
||||
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
|
||||
}
|
||||
|
@ -192,6 +196,9 @@ namespace IRaCIS.Core.Application.Service
|
|||
public async Task<IResponseOutput> DeleteInternationalization(Guid internationalizationId)
|
||||
{
|
||||
var success = await _internationalizationRepository.DeleteFromQueryAsync(t => t.Id == internationalizationId, true);
|
||||
|
||||
//清理缓存
|
||||
_provider.Set<List<InternationalizationSimpleDto>>(StaticData.InternationalData.Front, new List<InternationalizationSimpleDto>(), TimeSpan.FromDays(1));
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
|
|
|
@ -1322,13 +1322,14 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// </summary>
|
||||
/// <param name="queryEmailNoticeConfig"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<TrialSelectEmailNoticeConfigView>> GetSysEmailNoticeConfigList(EmailNoticeConfigQuery queryEmailNoticeConfig)
|
||||
{
|
||||
var emailNoticeConfigQueryable = _emailNoticeConfigRepository
|
||||
.WhereIf(queryEmailNoticeConfig.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == queryEmailNoticeConfig.BusinessScenarioEnum)
|
||||
.WhereIf(queryEmailNoticeConfig.IsReturnRequired != null, t => t.IsReturnRequired == queryEmailNoticeConfig.IsReturnRequired)
|
||||
.WhereIf(queryEmailNoticeConfig.IsEnable != null, t => t.IsEnable == queryEmailNoticeConfig.IsEnable)
|
||||
|
||||
.WhereIf(queryEmailNoticeConfig.CriterionTypeEnum != null, t => t.CriterionTypeEnum == queryEmailNoticeConfig.CriterionTypeEnum)
|
||||
.ProjectTo<TrialSelectEmailNoticeConfigView>(_mapper.ConfigurationProvider, new { trialId = queryEmailNoticeConfig.TrialId });
|
||||
|
||||
return await emailNoticeConfigQueryable.ToPagedListAsync(queryEmailNoticeConfig.PageIndex, queryEmailNoticeConfig.PageSize, queryEmailNoticeConfig.SortField, queryEmailNoticeConfig.Asc);
|
||||
|
|
|
@ -319,9 +319,9 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
continue;
|
||||
}
|
||||
str = await GetInspectionEnumValue(listIdentification, str);
|
||||
str = await SetEnum(dto.TrialId, listIdentification, str);
|
||||
str = await SetDataInspectionDateType(listIdentification, str);
|
||||
str = await GetInspectionEnumValue(listIdentification, item.Identification, str);
|
||||
str = await SetEnum(dto.TrialId, listIdentification, item.Identification, str);
|
||||
str = await SetDataInspectionDateType(listIdentification, item.Identification, str);
|
||||
|
||||
jsonDict[nameof(InspectionJsonDetail.Data)] = JsonConvert.DeserializeObject<object>(str);
|
||||
|
||||
|
@ -331,9 +331,9 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
continue;
|
||||
}
|
||||
str2 = await GetInspectionEnumValue(listIdentification, str2);
|
||||
str2 = await SetEnum(dto.TrialId, listIdentification, str2);
|
||||
str2 = await SetDataInspectionDateType(listIdentification, str2);
|
||||
str2 = await GetInspectionEnumValue(listIdentification, item.Identification, str2);
|
||||
str2 = await SetEnum(dto.TrialId, listIdentification, item.Identification, str2);
|
||||
str2 = await SetDataInspectionDateType(listIdentification, item.Identification, str2);
|
||||
|
||||
jsonDict[nameof(InspectionJsonDetail.CommonData)] = JsonConvert.DeserializeObject<object>(str2);
|
||||
#endregion
|
||||
|
@ -456,20 +456,23 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// <param name="identificationList"></param>
|
||||
/// <param name="jsonStr"></param>
|
||||
/// <returns></returns>
|
||||
private async Task<string> SetDataInspectionDateType(List<string> identificationList, string jsonStr)
|
||||
private async Task<string> SetDataInspectionDateType(List<string> identificationList,string identification, string jsonStr)
|
||||
{
|
||||
var list = await (from parent in _frontAuditConfigRepository.AsQueryable().Where(x => identificationList.Contains(x.Identification))
|
||||
join child in _frontAuditConfigRepository.AsQueryable().Where(x => x.EnumType == "Date" && x.IsEnable) on parent.Id equals child.ParentId
|
||||
select new DateDto()
|
||||
{
|
||||
Code = child.Code,
|
||||
Identification= parent.Identification,
|
||||
|
||||
Code = child.Code,
|
||||
DateType = child.DateType,
|
||||
}).ToListAsync();
|
||||
|
||||
list = list.GroupBy(x => new { x.Code }, (key, lst) => new DateDto()
|
||||
{
|
||||
|
||||
Code = key.Code,
|
||||
DateType = lst.Max(x => x.DateType),
|
||||
DateType = lst.FirstOrDefault(y => y.Identification == identification)?.DateType ?? lst.Max(x => x.DateType),
|
||||
}).ToList();
|
||||
|
||||
var jsonDataDic = JsonConvert.DeserializeObject<IDictionary<string, object>>(jsonStr);
|
||||
|
@ -519,23 +522,25 @@ namespace IRaCIS.Core.Application.Service
|
|||
///// <param name="ForeignKeyValue">外键value</param>
|
||||
///// <param name="ForeignKeyText">要查询的外键值</param>
|
||||
///// <param name="value">传入的纸</param>
|
||||
private async Task<string> GetInspectionEnumValue(List<string> identificationList, string jsonStr)
|
||||
private async Task<string> GetInspectionEnumValue(List<string> identificationList,string identification, string jsonStr)
|
||||
{
|
||||
var list = await (from u in _frontAuditConfigRepository.Where(x => identificationList.Contains(x.Identification))
|
||||
join p in _frontAuditConfigRepository.Where(x => x.EnumType == "Foreign" && x.IsEnable) on u.Id equals p.ParentId
|
||||
select new
|
||||
{
|
||||
Key = p.Code,
|
||||
ForeignKeyValue = p.ForeignKeyValue,
|
||||
Identification=u.Identification,
|
||||
ForeignKeyValue = p.ForeignKeyValue,
|
||||
ForeignKeyText = p.ForeignKeyText,
|
||||
ForeignKeyTable = p.ForeignKeyTableName
|
||||
}).ToListAsync();
|
||||
list = list.GroupBy(x => new { x.Key }, (key, lst) => new
|
||||
{
|
||||
Key = key.Key,
|
||||
ForeignKeyValue = lst.Max(x => x.ForeignKeyValue),
|
||||
ForeignKeyText = lst.Max(x => x.ForeignKeyText),
|
||||
ForeignKeyTable = lst.Max(x => x.ForeignKeyTable),
|
||||
Identification=string.Empty,
|
||||
ForeignKeyValue= lst.FirstOrDefault(y => y.Identification == identification)?.ForeignKeyValue ?? lst.Max(x => x.ForeignKeyValue),
|
||||
ForeignKeyText = lst.FirstOrDefault(y => y.Identification == identification)?.ForeignKeyText ?? lst.Max(x => x.ForeignKeyText),
|
||||
ForeignKeyTable = lst.FirstOrDefault(y => y.Identification == identification)?.ForeignKeyTable ?? lst.Max(x => x.ForeignKeyTable),
|
||||
|
||||
}).ToList();
|
||||
|
||||
|
@ -585,7 +590,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// <param name="identificationList">标识</param>
|
||||
/// <param name="jsonStr">Json对象</param>
|
||||
/// <returns></returns>
|
||||
private async Task<string> SetEnum(Guid trialId, List<string> identificationList, string jsonStr)
|
||||
private async Task<string> SetEnum(Guid trialId, List<string> identificationList, string identification, string jsonStr)
|
||||
{
|
||||
if (jsonStr == null || jsonStr == "null")
|
||||
{
|
||||
|
@ -598,27 +603,41 @@ namespace IRaCIS.Core.Application.Service
|
|||
join p in _frontAuditConfigRepository.Where(x => (x.DictionaryCode != string.Empty && x.EnumType == "Dictionary") || (x.DataType == "Table") && x.IsEnable) on u.Id equals p.ParentId
|
||||
select new
|
||||
{
|
||||
//前端展示类型
|
||||
DataType = p.DataType,
|
||||
TableConfigJsonStr = p.TableConfigJsonStr,
|
||||
Key = p.Code,
|
||||
Key = p.Code,
|
||||
Identification = u.Identification,
|
||||
//前端展示类型
|
||||
DataType = p.DataType,
|
||||
|
||||
TableConfigJsonStr = p.TableConfigJsonStr,
|
||||
|
||||
Code = p.DictionaryCode,
|
||||
Type = p.DictionaryType
|
||||
}).ToListAsync();
|
||||
|
||||
//两条不同的标识 但是里面配置有相同的翻译字典
|
||||
list = list.Distinct().ToList();
|
||||
list = list.GroupBy(x => new { x.Key }, (key, lst) => new
|
||||
{
|
||||
Key = key.Key,
|
||||
Identification = string.Empty,
|
||||
DataType = lst.FirstOrDefault(y => y.Identification == identification)?.DataType ?? lst.Max(x => x.DataType),
|
||||
TableConfigJsonStr = lst.FirstOrDefault(y => y.Identification == identification)?.TableConfigJsonStr ?? lst.Max(x => x.TableConfigJsonStr),
|
||||
Code = lst.FirstOrDefault(y => y.Identification == identification)?.Code ?? lst.Max(x => x.Code),
|
||||
Type = lst.FirstOrDefault(y => y.Identification == identification)?.Type ?? lst.Max(x => x.Type),
|
||||
|
||||
|
||||
// 添加单双审
|
||||
var trialtype = await _trialRepository.AsQueryable().Where(x => x.Id == trialId).Select(x => x.QCProcessEnum).FirstOrDefaultAsync();
|
||||
}).ToList();
|
||||
|
||||
// 添加单双审
|
||||
var trialtype = await _trialRepository.AsQueryable().Where(x => x.Id == trialId).Select(x => x.QCProcessEnum).FirstOrDefaultAsync();
|
||||
|
||||
if (!list.Any(x => x.Key == "AuditState"))
|
||||
{
|
||||
list.Add(new
|
||||
{
|
||||
DataType = string.Empty,
|
||||
TableConfigJsonStr = string.Empty,
|
||||
Key = "AuditState",
|
||||
{
|
||||
Key = "AuditState",
|
||||
Identification = string.Empty,
|
||||
DataType = string.Empty,
|
||||
TableConfigJsonStr = string.Empty,
|
||||
Code = trialtype == TrialQCProcess.SingleAudit ? "AuditStatePE" : "AuditStateRC",
|
||||
Type = "Code",
|
||||
});
|
||||
|
|
|
@ -3,9 +3,9 @@ using IRaCIS.Core.Infrastructure.Extention;
|
|||
|
||||
namespace IRaCIS.Application.Contracts
|
||||
{
|
||||
public class SiteDTO: SiteCommand
|
||||
public class SiteDTO : SiteCommand
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class SiteCommand
|
||||
|
@ -24,7 +24,7 @@ namespace IRaCIS.Application.Contracts
|
|||
public string AliasName { get; set; } = string.Empty;
|
||||
public string City { get; set; } = string.Empty;
|
||||
public string Country { get; set; } = string.Empty;
|
||||
public Guid? HospitalId { get; set; }
|
||||
public Guid? HospitalId { get; set; }
|
||||
public string DirectorName { get; set; } = string.Empty;
|
||||
public string DirectorPhone { get; set; } = string.Empty;
|
||||
public string ContactName { get; set; } = string.Empty;
|
||||
|
@ -35,6 +35,9 @@ namespace IRaCIS.Application.Contracts
|
|||
{
|
||||
public Guid Id { get; set; }
|
||||
public string SiteName { get; set; } = String.Empty;
|
||||
|
||||
public string SiteNameCN { get; set; } = String.Empty;
|
||||
|
||||
public string City { get; set; } = String.Empty;
|
||||
|
||||
public string Province { get; set; } = string.Empty;
|
||||
|
|
|
@ -3,18 +3,20 @@ using IRaCIS.Application.Contracts;
|
|||
using IRaCIS.Core.Infra.EFCore;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using Microsoft.Data.Sqlite;
|
||||
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
[ ApiExplorerSettings(GroupName = "Institution")]
|
||||
[ApiExplorerSettings(GroupName = "Institution")]
|
||||
public class HospitalService : BaseService, IHospitalService
|
||||
{
|
||||
private readonly IRepository<Hospital> _hospitalRepository;
|
||||
private readonly IRepository<Site> _siteRepository;
|
||||
|
||||
public HospitalService(IRepository<Hospital> hospitalRepository )
|
||||
public HospitalService(IRepository<Hospital> hospitalRepository, IRepository<Site> siteRepository)
|
||||
{
|
||||
_hospitalRepository = hospitalRepository;
|
||||
|
||||
_siteRepository = siteRepository;
|
||||
}
|
||||
|
||||
/// <summary> 获取所有医院列表 </summary>
|
||||
|
@ -37,15 +39,26 @@ namespace IRaCIS.Application.Services
|
|||
var exp1 = new EntityVerifyExp<Hospital>()
|
||||
{
|
||||
VerifyExp = x => x.SiteId == hospitalCommand.SiteId && hospitalCommand.SiteId != null,
|
||||
//---已经存在同名的医院,请确认。
|
||||
//---当前中心已经添加到其他医院了。
|
||||
VerifyMsg = _localizer["Hospital_SiteAdded"]
|
||||
};
|
||||
|
||||
|
||||
var hospital = await _hospitalRepository.InsertOrUpdateAsync(hospitalCommand, true, exp,exp1);
|
||||
|
||||
|
||||
var hospital = await _hospitalRepository.InsertOrUpdateAsync(hospitalCommand, true, exp, exp1);
|
||||
|
||||
//手动解绑医院与site的关系
|
||||
if (hospitalCommand.SiteId == null && hospital.SiteId != null)
|
||||
{
|
||||
await _siteRepository.BatchUpdateNoTrackingAsync(t => t.Id == hospital.SiteId, u => new Site() { HospitalId = null });
|
||||
}
|
||||
|
||||
//手动绑
|
||||
if (hospitalCommand.SiteId != null)
|
||||
{
|
||||
await _siteRepository.BatchUpdateNoTrackingAsync(t => t.Id == hospitalCommand.SiteId, u => new Site() { HospitalId = hospital.Id });
|
||||
}
|
||||
return ResponseOutput.Ok(hospital.Id.ToString());
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -54,11 +67,6 @@ namespace IRaCIS.Application.Services
|
|||
[HttpDelete("{hospitalId:guid}")]
|
||||
public async Task<IResponseOutput> DeleteHospital(Guid hospitalId)
|
||||
{
|
||||
|
||||
//if (_userRepository.Find().Any(t => t.OrganizationId == hospitalId))
|
||||
//{
|
||||
// return ResponseOutput.NotOk("该医院下存在用户,暂时无法删除。");
|
||||
//}
|
||||
|
||||
var success = await _hospitalRepository.BatchDeleteNoTrackingAsync(x => x.Id == hospitalId);
|
||||
|
||||
|
@ -67,12 +75,12 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
/// <summary> 分页获取医院列表 </summary>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<HospitalDTO>> GetHospitalPageList(HospitalQueryDTO hospitalSearchModel)
|
||||
public async Task<PageOutput<HospitalDTO>> GetHospitalPageList(HospitalQueryDTO hospitalSearchModel)
|
||||
{
|
||||
|
||||
var hospitalQueryable =
|
||||
_hospitalRepository
|
||||
.WhereIf(hospitalSearchModel.HospitalName!=null, t => t.HospitalName.Contains(hospitalSearchModel.HospitalName!) || t.HospitalNameCN.Contains(hospitalSearchModel.HospitalName!))
|
||||
.WhereIf(hospitalSearchModel.HospitalName != null, t => t.HospitalName.Contains(hospitalSearchModel.HospitalName!) || t.HospitalNameCN.Contains(hospitalSearchModel.HospitalName!))
|
||||
.WhereIf(hospitalSearchModel.City != null, t => t.City.Contains(hospitalSearchModel.City!) || t.HospitalNameCN.Contains(hospitalSearchModel.City!))
|
||||
.WhereIf(hospitalSearchModel.Province != null, t => t.Province.Contains(hospitalSearchModel.Province!) || t.HospitalNameCN.Contains(hospitalSearchModel.Province!))
|
||||
.ProjectTo<HospitalDTO>(_mapper.ConfigurationProvider);
|
||||
|
|
|
@ -4,6 +4,7 @@ using IRaCIS.Core.Infra.EFCore;
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using Medallion.Threading;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
|
@ -13,12 +14,14 @@ namespace IRaCIS.Application.Services
|
|||
private readonly IRepository<Site> _siteRepository;
|
||||
private readonly IRepository<TrialSiteUser> _trialSiteUserRepository;
|
||||
private readonly IDistributedLockProvider _distributedLockProvider;
|
||||
private readonly IRepository<Hospital> _hospitalRepository;
|
||||
|
||||
public SiteService(IRepository<Site> siteRepository, IRepository<TrialSiteUser> trialSiteUserRepository, IDistributedLockProvider distributedLockProvider)
|
||||
public SiteService(IRepository<Site> siteRepository, IRepository<TrialSiteUser> trialSiteUserRepository, IDistributedLockProvider distributedLockProvider, IRepository<Hospital> hospitalRepository)
|
||||
{
|
||||
_siteRepository = siteRepository;
|
||||
_trialSiteUserRepository = trialSiteUserRepository;
|
||||
_distributedLockProvider = distributedLockProvider;
|
||||
_hospitalRepository = hospitalRepository;
|
||||
}
|
||||
|
||||
/// <summary> 分页获取研究中心列表 </summary>
|
||||
|
@ -32,7 +35,7 @@ namespace IRaCIS.Application.Services
|
|||
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.City), t => t.City.Contains(searchModel.City))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.Country), t => t.Country.Contains(searchModel.Country))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.Province), t => t.Province.Contains(searchModel.Province))
|
||||
.ProjectTo<SiteSelectDTO>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us });
|
||||
.ProjectTo<SiteSelectDTO>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us });
|
||||
|
||||
|
||||
return await siteQueryable.ToPagedListAsync(searchModel.PageIndex, searchModel.PageSize, string.IsNullOrWhiteSpace(searchModel.SortField) ? "SiteName" : searchModel.SortField, searchModel.Asc);
|
||||
|
@ -72,6 +75,18 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
var site = await _siteRepository.InsertOrUpdateAsync(siteCommand, true, exp);
|
||||
|
||||
//手动解绑医院与site的关系
|
||||
if (siteCommand.HospitalId == null && site.HospitalId != null)
|
||||
{
|
||||
await _hospitalRepository.BatchUpdateNoTrackingAsync(t => t.Id == site.HospitalId, u => new Hospital() { SiteId = null });
|
||||
}
|
||||
|
||||
//手动绑
|
||||
if (siteCommand.HospitalId != null)
|
||||
{
|
||||
await _hospitalRepository.BatchUpdateNoTrackingAsync(t => t.Id == siteCommand.HospitalId, u => new Hospital() { SiteId = site.Id });
|
||||
}
|
||||
|
||||
return ResponseOutput.Ok(site.Id.ToString());
|
||||
|
||||
}
|
||||
|
|
|
@ -311,7 +311,7 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
|
||||
//检查手机或者邮箱是否有效
|
||||
if (!Regex.IsMatch(email, @"^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$"))
|
||||
if (!Regex.IsMatch(email, @"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"))
|
||||
{
|
||||
|
||||
//---请输入一个正确的邮箱。
|
||||
|
|
|
@ -1355,40 +1355,40 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
//dbSubjectVisit.Subject.IsMissingImages = await _subjectVisitRepository.AnyAsync(t => (t.VisitNum < maxVisitNum && t.SubmitState != SubmitStateEnum.Submitted && t.IsLostVisit == false));
|
||||
|
||||
//项目或者Subject IsUrgent 提交时 访视也设置为紧急
|
||||
if (trialConfig.IsUrgent || dbSubjectVisit.Subject.IsUrgent || (dbSubjectVisit.PDState == PDStateEnum.PDProgress && !dbSubjectVisit.IsBaseLine) || (dbSubjectVisit.IsEnrollmentConfirm && dbSubjectVisit.IsBaseLine))
|
||||
if (trialConfig.IsUrgent || dbSubjectVisit.Subject.IsUrgent || (dbSubjectVisit.IsEnrollmentConfirm && dbSubjectVisit.IsBaseLine))
|
||||
{
|
||||
if (dbSubjectVisit.PDState == PDStateEnum.PDProgress)
|
||||
{
|
||||
await _subjectVisitRepository.BatchUpdateNoTrackingAsync(x => x.SubjectId == dbSubjectVisit.SubjectId && x.VisitNum <= dbSubjectVisit.VisitNum, x => new SubjectVisit()
|
||||
{
|
||||
IsUrgent = true
|
||||
});
|
||||
//if (dbSubjectVisit.PDState == PDStateEnum.PDProgress)
|
||||
//{
|
||||
// await _subjectVisitRepository.BatchUpdateNoTrackingAsync(x => x.SubjectId == dbSubjectVisit.SubjectId && x.VisitNum <= dbSubjectVisit.VisitNum, x => new SubjectVisit()
|
||||
// {
|
||||
// IsUrgent = true
|
||||
// });
|
||||
|
||||
|
||||
// await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => trialInOrderCriterionIdList.Contains(x.TrialReadingCriterionId) && x.SubjectId == dbSubjectVisit.SubjectId &&
|
||||
// dbSubjectVisit.VisitNum <= x.VisitTaskNum && x.VisitTaskNum < Math.Ceiling(dbSubjectVisit.VisitNum + 0.01m) // 当前的访视 全局 裁判 及之前 全都加急
|
||||
// && x.ReadingTaskState != ReadingTaskState.HaveSigned && x.TaskState == TaskState.Effect, x => new VisitTask()
|
||||
// {
|
||||
|
||||
// IsUrgent = true,
|
||||
// TaskUrgentType = TaskUrgentType.PDProgress,
|
||||
// IsCanEditUrgentState = false,
|
||||
// });
|
||||
|
||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => trialInOrderCriterionIdList.Contains(x.TrialReadingCriterionId)&& x.SubjectId == dbSubjectVisit.SubjectId&&
|
||||
dbSubjectVisit.VisitNum<= x.VisitTaskNum && x.VisitTaskNum < Math.Ceiling(dbSubjectVisit.VisitNum+0.01m) // 当前的访视 全局 裁判 及之前 全都加急
|
||||
&& x.ReadingTaskState != ReadingTaskState.HaveSigned && x.TaskState == TaskState.Effect, x => new VisitTask()
|
||||
{
|
||||
// await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => trialInOrderCriterionIdList.Contains(x.TrialReadingCriterionId) && x.SubjectId == dbSubjectVisit.SubjectId
|
||||
// && x.VisitTaskNum < dbSubjectVisit.VisitNum // 当前的访视 全局 裁判 及之前 全都加急
|
||||
// && x.ReadingTaskState != ReadingTaskState.HaveSigned && x.TaskState == TaskState.Effect, x => new VisitTask()
|
||||
// {
|
||||
|
||||
IsUrgent = true,
|
||||
TaskUrgentType = TaskUrgentType.PDProgress,
|
||||
IsCanEditUrgentState=false,
|
||||
});
|
||||
|
||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => trialInOrderCriterionIdList.Contains(x.TrialReadingCriterionId) && x.SubjectId == dbSubjectVisit.SubjectId
|
||||
&& x.VisitTaskNum < dbSubjectVisit.VisitNum // 当前的访视 全局 裁判 及之前 全都加急
|
||||
&& x.ReadingTaskState != ReadingTaskState.HaveSigned && x.TaskState == TaskState.Effect, x => new VisitTask()
|
||||
{
|
||||
|
||||
IsUrgent = true,
|
||||
TaskUrgentType = TaskUrgentType.Other,
|
||||
TaskUrgentRemake= "后续访视设为pd",
|
||||
IsCanEditUrgentState = false,
|
||||
});
|
||||
}
|
||||
else if (dbSubjectVisit.IsEnrollmentConfirm)
|
||||
// IsUrgent = true,
|
||||
// TaskUrgentType = TaskUrgentType.Other,
|
||||
// TaskUrgentRemake = "后续访视设为pd",
|
||||
// IsCanEditUrgentState = false,
|
||||
// });
|
||||
//}
|
||||
//else
|
||||
|
||||
if (dbSubjectVisit.IsEnrollmentConfirm)
|
||||
{
|
||||
await _subjectVisitRepository.BatchUpdateNoTrackingAsync(x => x.Id == dbSubjectVisit.Id, x => new SubjectVisit()
|
||||
{
|
||||
|
@ -1420,14 +1420,14 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
dbSubjectVisit.IsUrgent = true;
|
||||
|
||||
|
||||
//PD确认的紧急会把前面所有未QC完成的访视均标记为紧急
|
||||
////PD确认的紧急会把前面所有未QC完成的访视均标记为紧急
|
||||
|
||||
var previosSVlist = await _subjectVisitRepository.Where(t => t.SubjectId == dbSubjectVisit.SubjectId && t.VisitNum < dbSubjectVisit.VisitNum && t.IsUrgent == false && t.SubmitState == SubmitStateEnum.Submitted, true).ToListAsync();
|
||||
//var previosSVlist = await _subjectVisitRepository.Where(t => t.SubjectId == dbSubjectVisit.SubjectId && t.VisitNum < dbSubjectVisit.VisitNum && t.IsUrgent == false && t.SubmitState == SubmitStateEnum.Submitted, true).ToListAsync();
|
||||
|
||||
previosSVlist.ForEach(t =>
|
||||
{
|
||||
t.IsUrgent = true;
|
||||
});
|
||||
//previosSVlist.ForEach(t =>
|
||||
//{
|
||||
// t.IsUrgent = true;
|
||||
//});
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.ForMember(d => d.SubjectCode, u => u.MapFrom(s => s.Subject.Code))
|
||||
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.TrialSite.TrialSiteCode))
|
||||
|
||||
.ForMember(d => d.CheckDialogStr, u => u.MapFrom(t => string.Join(" | ", t.CheckChallengeDialogList.OrderBy(t => t.CreateTime).Select(c => c.CreateUser.UserName + " " + c.CreateTime.ToString("yyyy-mm-dd hh:mm:ss") + " :" + c.TalkContent))))
|
||||
.ForMember(d => d.CheckDialogStr, u => u.MapFrom(t => string.Join(" | ", t.CheckChallengeDialogList.OrderBy(t => t.CreateTime).Select(c => c.CreateUser.UserName + " " + c.CreateTime.ToString("yyyy-MM-dd HH:mm:ss") + " :" + c.TalkContent))))
|
||||
.ForMember(d => d.ModalityList, c => c.MapFrom(s =>
|
||||
(s.NoneDicomStudyList.Select(t => t.Modality)
|
||||
.Union(s.StudyList.Select(k => k.ModalityForEdit))).Distinct()))
|
||||
|
|
|
@ -190,23 +190,24 @@ namespace IRaCIS.Application.Services
|
|||
.WhereIf(inDto.IsBaseline, x => x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.Subject || x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.SubjectVisit)
|
||||
.WhereIf(!inDto.IsBaseline, x => x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.SubjectVisit)
|
||||
.Where(x => x.ClinicalDataTrialSet.TrialId == inDto.TrialId && x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC)
|
||||
.Include(x=>x.ClinicalDataTrialSet)
|
||||
.OrderBy(x=>x.ClinicalDataTrialSet.CreateTime)
|
||||
.Include(x => x.ClinicalDataTrialSet)
|
||||
.OrderBy(x => x.ClinicalDataTrialSet.CreateTime)
|
||||
.Select(x => new GetCRCClinicalDataOutDto()
|
||||
{
|
||||
Id = x.Id,
|
||||
ClinicalDataSetName = x.ClinicalDataTrialSet.ClinicalDataSetName.LanguageName(x.ClinicalDataTrialSet.ClinicalDataSetEnName, _userInfo.IsEn_Us) ,
|
||||
ClinicalDataSetName = x.ClinicalDataTrialSet.ClinicalDataSetName.LanguageName(x.ClinicalDataTrialSet.ClinicalDataSetEnName, _userInfo.IsEn_Us),
|
||||
ClinicalUploadType = x.ClinicalDataTrialSet.ClinicalUploadType,
|
||||
ClinicalDataSetEnName=x.ClinicalDataTrialSet.ClinicalDataSetEnName,
|
||||
ClinicalDataSetEnName = x.ClinicalDataTrialSet.ClinicalDataSetEnName,
|
||||
ClinicalDataTrialSetId = x.ClinicalDataTrialSet.Id,
|
||||
FileName = x.ClinicalDataTrialSet.FileName,
|
||||
UploadRole = x.ClinicalDataTrialSet.UploadRole,
|
||||
Path = x.ClinicalDataTrialSet.Path,
|
||||
IsBlind = x.IsBlind,
|
||||
IsComplete = x.IsComplete,
|
||||
ClinicalFromList=x.Subject.ClinicalFormList.Where(y=>y.ReadingId==x.ReadingId&&y.ClinicalDataTrialSetId==x.ClinicalDataTrialSetId).Select(y=> new ClinicalFromData() {
|
||||
CheckDate=y.CheckDate,
|
||||
ClinicalFormId=y.Id
|
||||
ClinicalFromList = x.Subject.ClinicalFormList.Where(y => y.ReadingId == x.ReadingId && y.ClinicalDataTrialSetId == x.ClinicalDataTrialSetId).Select(y => new ClinicalFromData()
|
||||
{
|
||||
CheckDate = y.CheckDate,
|
||||
ClinicalFormId = y.Id
|
||||
}).ToList(),
|
||||
PDFFileList = x.ReadingClinicalDataPDFList.Select(y => new GetFileDto()
|
||||
{
|
||||
|
@ -215,7 +216,7 @@ namespace IRaCIS.Application.Services
|
|||
Path = y.Path,
|
||||
CreateTime = y.CreateTime,
|
||||
}).ToList(),
|
||||
|
||||
|
||||
}).ToListAsync();
|
||||
|
||||
var previousHistoryList = await _previousHistoryRepository.Where(x => x.SubjectVisitId == inDto.SubjectVisitId).ProjectTo<PreviousHistoryView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
@ -287,7 +288,7 @@ namespace IRaCIS.Application.Services
|
|||
//}
|
||||
|
||||
data.IsBlind = inDto.IsBlind;
|
||||
data.IsComplete=inDto.IsComplete;
|
||||
data.IsComplete = inDto.IsComplete;
|
||||
data.IsSign = true;
|
||||
data.ReadingClinicalDataState = ReadingClinicalDataStatus.HaveSigned;
|
||||
|
||||
|
@ -304,7 +305,24 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
await this.iServiceProvider.GetService<IReadingImageTaskService>().AddOncologyTask(readingId);
|
||||
|
||||
await DealVisiTaskClinicalDataSignedAsync(data.TrialId, data.SubjectId, data.ReadingId, data.IsVisit, inDto.TrialReadingCriterionId);
|
||||
//如果先生成了任务,再签名subject级别 PM 临床数据,那么会导致其他标准的任务签名状态无法得到维护
|
||||
|
||||
if (await _repository.AnyAsync<ClinicalDataTrialSet>(t => t.Id == data.ClinicalDataTrialSetId && t.UploadRole == UploadRole.PM && t.ClinicalDataLevel == ClinicalLevel.Subject))
|
||||
{
|
||||
var needDealTrialReadingCriterionIdList = _repository.Where<ClinicalDataTrialSet>(t => t.Id == data.ClinicalDataTrialSetId)
|
||||
.SelectMany(t => t.TrialClinicalDataSetCriteriaList)
|
||||
.Select(u => u.TrialReadingCriterionId).Distinct().ToList();
|
||||
|
||||
foreach (var trialReadingCriterionId in needDealTrialReadingCriterionIdList)
|
||||
{
|
||||
await DealVisiTaskClinicalDataSignedAsync(data.TrialId, data.SubjectId, data.ReadingId, data.IsVisit, trialReadingCriterionId);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
await DealVisiTaskClinicalDataSignedAsync(data.TrialId, data.SubjectId, data.ReadingId, data.IsVisit, inDto.TrialReadingCriterionId);
|
||||
|
||||
}
|
||||
|
||||
return ResponseOutput.Result(result);
|
||||
}
|
||||
|
@ -313,7 +331,7 @@ namespace IRaCIS.Application.Services
|
|||
public async Task DealVisiTaskClinicalDataSignedAsync(Guid trialId, Guid subjectId, Guid readingId, bool isVisit, Guid trialReadingCritrialId)
|
||||
{
|
||||
//获取确认的临床数据配置
|
||||
var trialClinicalDataSetList = _clinicalDataTrialSetRepository.Where(t => t.TrialId == trialId && t.IsConfirm).Include(t => t.TrialClinicalDataSetCriteriaList).ToList();
|
||||
var trialClinicalDataSetList = _clinicalDataTrialSetRepository.Where(t => t.TrialId == trialId && t.IsConfirm).Include(t => t.TrialClinicalDataSetCriteriaList).ToList();
|
||||
|
||||
//var criterionType = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == trialReadingCritrialId).Select(t => t.CriterionType).FirstOrDefaultAsync();
|
||||
|
||||
|
@ -328,7 +346,7 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
var isBaseLine = await _subjectVisitRepository.Where(t => t.Id == readingId).Select(t => t.IsBaseLine).FirstOrDefaultAsync();
|
||||
|
||||
|
||||
|
||||
|
||||
//判断是否基线
|
||||
if (isBaseLine)
|
||||
|
@ -414,7 +432,7 @@ namespace IRaCIS.Application.Services
|
|||
}
|
||||
|
||||
//有序阅片才维护 IsFrontTaskNeedSignButNotSign 这个状态
|
||||
if (_readingQuestionCriterionTrialRepository.Any(t=>t.Id==trialReadingCritrialId && t.IsReadingTaskViewInOrder == true))
|
||||
if (_readingQuestionCriterionTrialRepository.Any(t => t.Id == trialReadingCritrialId && t.IsReadingTaskViewInOrder == true))
|
||||
{
|
||||
|
||||
|
||||
|
@ -429,8 +447,8 @@ namespace IRaCIS.Application.Services
|
|||
(t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum)
|
||||
|
||||
// 前序存在 未一致性核查未通过的
|
||||
|| t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum>sv.VisitNum)
|
||||
|
||||
|| t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum)
|
||||
|
||||
))
|
||||
.Select(t => t.Id);
|
||||
|
||||
|
@ -442,7 +460,7 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
|
||||
var visitTaskIdQueryable2 = _visitTaskRepository.Where(visitTaskLambda) //该Subject 该标准的任务
|
||||
|
||||
|
||||
.Where(t => t.IsFrontTaskNeedSignButNotSign == true &&
|
||||
|
||||
//前序任务 不存在需要签名 但是没签名
|
||||
|
@ -461,14 +479,14 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 废弃 接口合并到签名哪里
|
||||
|
||||
|
||||
[HttpPut]
|
||||
public async Task<IResponseOutput> PMClinicalDataConfirm(PMClinicalDataConfirmCommand command)
|
||||
{
|
||||
|
@ -522,7 +540,7 @@ namespace IRaCIS.Application.Services
|
|||
keyValuePairs.Add(ModuleTypeEnum.Oncology, ClinicalLevel.OncologyRead);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var usedIdsQuery = _readingClinicalDataRepository.Where(x => x.ReadingId == inDto.ReadingId && x.Id != inDto.ReadingClinicalDataId).Select(x => x.ClinicalDataTrialSetId);
|
||||
|
@ -537,20 +555,20 @@ namespace IRaCIS.Application.Services
|
|||
.WhereIf(inDto.IsVisit && !inDto.IsBaseLine, x => x.ClinicalDataLevel == ClinicalLevel.SubjectVisit)
|
||||
.WhereIf(!inDto.IsVisit, x => x.ClinicalDataLevel == ClinicalLevel.ImageRead || x.ClinicalDataLevel == ClinicalLevel.OncologyRead)
|
||||
.WhereIf(readModule != null, x => x.ClinicalDataLevel == keyValuePairs[readModule!.ModuleType])
|
||||
.WhereIf(inDto.TrialReadingCriterionId!=null,x=>x.TrialClinicalDataSetCriteriaList.Any(y=>y.TrialReadingCriterionId== inDto.TrialReadingCriterionId))
|
||||
.WhereIf(inDto.TrialReadingCriterionId != null, x => x.TrialClinicalDataSetCriteriaList.Any(y => y.TrialReadingCriterionId == inDto.TrialReadingCriterionId))
|
||||
//.WhereIf(criterion!=null,x=>x.CriterionEnumListStr.Contains($"|{(int)criterion.CriterionType}|"))
|
||||
.Select(x => new GetTrialClinicalDataSelectOutDto()
|
||||
{
|
||||
ClinicalDataLevel = x.ClinicalDataLevel,
|
||||
ClinicalDataSetName = x.ClinicalDataSetName.LanguageName(x.ClinicalDataSetEnName, _userInfo.IsEn_Us),
|
||||
ClinicalDataSetEnName=x.ClinicalDataSetEnName,
|
||||
ClinicalDataSetEnName = x.ClinicalDataSetEnName,
|
||||
ClinicalUploadType = x.ClinicalUploadType,
|
||||
FileName = x.FileName,
|
||||
Path = x.Path,
|
||||
Id = x.Id,
|
||||
CriterionEnumList = x.CriterionEnumList,
|
||||
}).ToListAsync();
|
||||
|
||||
|
||||
return clinicalList;
|
||||
}
|
||||
|
||||
|
@ -699,20 +717,21 @@ namespace IRaCIS.Application.Services
|
|||
Path = y.Path,
|
||||
CreateTime = y.CreateTime,
|
||||
}).ToList(),
|
||||
|
||||
|
||||
});
|
||||
|
||||
var result = new List<GetReadingClinicalDataListOutDto>();
|
||||
if (!inDto.IsOnlyGetCRCReadModule)
|
||||
{
|
||||
result = await resultQuery.ToListAsync();
|
||||
result = await resultQuery.ToListAsync();
|
||||
}
|
||||
|
||||
var readingIds = result.Select(x => x.ReadingId).ToList();
|
||||
var clinical = await _clinicalFormRepository.Where(x => readingIds.Contains(x.ReadingId??default(Guid))).ToListAsync();
|
||||
result.Where(x => x.ClinicalUploadType == ClinicalUploadType.Structuring).ForEach(x => {
|
||||
var clinical = await _clinicalFormRepository.Where(x => readingIds.Contains(x.ReadingId ?? default(Guid))).ToListAsync();
|
||||
result.Where(x => x.ClinicalUploadType == ClinicalUploadType.Structuring).ForEach(x =>
|
||||
{
|
||||
|
||||
x.ClinicalFromList = clinical.Where(y => y.ReadingId == x.ReadingId&&y.ClinicalDataTrialSetId==x.ClinicalDataTrialSetId).Select(y => new ClinicalFromData()
|
||||
x.ClinicalFromList = clinical.Where(y => y.ReadingId == x.ReadingId && y.ClinicalDataTrialSetId == x.ClinicalDataTrialSetId).Select(y => new ClinicalFromData()
|
||||
{
|
||||
CheckDate = y.CheckDate,
|
||||
ClinicalFormId = y.Id
|
||||
|
@ -723,35 +742,36 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
// 这里处理CRC上传 阅片期的临床数据
|
||||
var readModule = await _readModuleRepository.Where(x => x.Id == inDto.ReadingId)
|
||||
.WhereIf(inDto.SelectIsSign,x=>x.IsPMConfirm)
|
||||
.WhereIf(!inDto.SelectIsSign, x => x.IsCRCConfirm)
|
||||
.FirstOrDefaultAsync();
|
||||
.WhereIf(inDto.SelectIsSign, x => x.IsPMConfirm)
|
||||
.WhereIf(!inDto.SelectIsSign, x => x.IsCRCConfirm)
|
||||
.FirstOrDefaultAsync();
|
||||
if (readModule != null)
|
||||
{
|
||||
var moduleCriterionFromList = await _readModuleCriterionFromRepository
|
||||
.WhereIf(inDto.ClinicalDataTrialSetId != null, x => x.ClinicalForm.ClinicalDataTrialSetId == inDto.ClinicalDataTrialSetId)
|
||||
.Where(x => x.ReadModuleId == readModule.Id).Select(x => new{
|
||||
ClinicalFormId= x.ClinicalFormId,
|
||||
CheckDate= x.ClinicalForm.CheckDate,
|
||||
ClinicalDataTrialSetId= x.ClinicalForm.ClinicalDataTrialSetId
|
||||
|
||||
|
||||
}).ToListAsync();
|
||||
.Where(x => x.ReadModuleId == readModule.Id).Select(x => new
|
||||
{
|
||||
ClinicalFormId = x.ClinicalFormId,
|
||||
CheckDate = x.ClinicalForm.CheckDate,
|
||||
ClinicalDataTrialSetId = x.ClinicalForm.ClinicalDataTrialSetId
|
||||
|
||||
|
||||
}).ToListAsync();
|
||||
|
||||
|
||||
var clinicalresult = await _clinicalDataTrialSetRepository.Where(x => x.UploadRole == UploadRole.CRC && x.ClinicalUploadType == ClinicalUploadType.Structuring)
|
||||
.WhereIf(readModule.ReadingSetType == ReadingSetType.ImageReading, x => x.ClinicalDataLevel == ClinicalLevel.ImageRead)
|
||||
.WhereIf(readModule.ReadingSetType == ReadingSetType.TumorReading, x => x.ClinicalDataLevel == ClinicalLevel.OncologyRead)
|
||||
.Where(x=>x.TrialClinicalDataSetCriteriaList.Any(y=>y.TrialReadingCriterionId==readModule.TrialReadingCriterionId))
|
||||
.Where(x => x.TrialClinicalDataSetCriteriaList.Any(y => y.TrialReadingCriterionId == readModule.TrialReadingCriterionId))
|
||||
.Select(x => new GetReadingClinicalDataListOutDto()
|
||||
{
|
||||
|
||||
ClinicalDataLevel = x.ClinicalDataLevel,
|
||||
SubjectId = inDto.SubjectId,
|
||||
ReadingId = default(Guid),
|
||||
IsCRCApplicationRevoke=readModule.IsCRCApplicationRevoke,
|
||||
IsCRCConfirm= readModule.IsCRCConfirm,
|
||||
IsPMConfirm= readModule.IsPMConfirm,
|
||||
IsCRCApplicationRevoke = readModule.IsCRCApplicationRevoke,
|
||||
IsCRCConfirm = readModule.IsCRCConfirm,
|
||||
IsPMConfirm = readModule.IsPMConfirm,
|
||||
ClinicalDataSetName = x.ClinicalDataSetName.LanguageName(x.ClinicalDataSetEnName, _userInfo.IsEn_Us),
|
||||
ClinicalDataSetEnName = x.ClinicalDataSetEnName,
|
||||
ClinicalDataTrialSetId = x.Id,
|
||||
|
@ -762,7 +782,7 @@ namespace IRaCIS.Application.Services
|
|||
IsCRCUpload = x.UploadRole == UploadRole.CRC,
|
||||
IsNeedMerge = true,
|
||||
ReadModuleId = readModule.Id,
|
||||
TrialClinicalDataSetCriteriaList=x.TrialClinicalDataSetCriteriaList,
|
||||
TrialClinicalDataSetCriteriaList = x.TrialClinicalDataSetCriteriaList,
|
||||
//FileCount = x.FileCount,
|
||||
|
||||
//ReadingClinicalDataState = x.ReadingClinicalDataState,
|
||||
|
@ -791,8 +811,8 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
});
|
||||
|
||||
result.AddRange(clinicalresult);
|
||||
}
|
||||
result.AddRange(clinicalresult);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -813,7 +833,7 @@ namespace IRaCIS.Application.Services
|
|||
result = result.Where(x => x.UploadRole == UploadRole.PM).ToList();
|
||||
break;
|
||||
case GetClinicalType.CRCConfirm:
|
||||
result = result.Where(x => x.UploadRole == UploadRole.CRC&&x.IsCRCConfirm&&!x.IsPMConfirm).ToList();
|
||||
result = result.Where(x => x.UploadRole == UploadRole.CRC && x.IsCRCConfirm && !x.IsPMConfirm).ToList();
|
||||
break;
|
||||
case GetClinicalType.HasSign:
|
||||
result = result.Where(x => x.IsSign).ToList();
|
||||
|
@ -849,15 +869,15 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
var resultQuery = _readingClinicalDataRepository.Where(x => x.SubjectId == inDto.SubjectId)
|
||||
.Where(x => x.ReadingId == inDto.ReadingId)
|
||||
.WhereIf(inDto.ClinicalDataTrialSetId!=null, x=>x.ClinicalDataTrialSetId==inDto.TrialReadingCriterionId)
|
||||
.Where(x => x.ClinicalDataTrialSet.TrialClinicalDataSetCriteriaList.Any(t=>t.TrialReadingCriterionId==inDto.TrialReadingCriterionId))
|
||||
.WhereIf(inDto.ClinicalDataTrialSetId != null, x => x.ClinicalDataTrialSetId == inDto.TrialReadingCriterionId)
|
||||
.Where(x => x.ClinicalDataTrialSet.TrialClinicalDataSetCriteriaList.Any(t => t.TrialReadingCriterionId == inDto.TrialReadingCriterionId))
|
||||
.Select(x => new GetReadingClinicalDataListOutDto()
|
||||
{
|
||||
ClinicalDataLevel = x.ClinicalDataTrialSet.ClinicalDataLevel,
|
||||
SubjectId = x.SubjectId,
|
||||
ReadingId = x.ReadingId,
|
||||
ClinicalDataSetName = x.ClinicalDataTrialSet.ClinicalDataSetName.LanguageName(x.ClinicalDataTrialSet.ClinicalDataSetEnName, _userInfo.IsEn_Us),
|
||||
ClinicalDataSetEnName =x.ClinicalDataTrialSet.ClinicalDataSetEnName,
|
||||
ClinicalDataSetEnName = x.ClinicalDataTrialSet.ClinicalDataSetEnName,
|
||||
ClinicalDataTrialSetId = x.ClinicalDataTrialSetId,
|
||||
IsSign = x.IsSign,
|
||||
ClinicalUploadType = x.ClinicalDataTrialSet.ClinicalUploadType,
|
||||
|
@ -884,7 +904,8 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
var readingIds = result.Select(x => x.ReadingId).ToList();
|
||||
var clinical = await _clinicalFormRepository.Where(x => readingIds.Contains(x.ReadingId ?? default(Guid))).ToListAsync();
|
||||
result.Where(x => x.ClinicalUploadType == ClinicalUploadType.Structuring).ForEach(x => {
|
||||
result.Where(x => x.ClinicalUploadType == ClinicalUploadType.Structuring).ForEach(x =>
|
||||
{
|
||||
|
||||
x.ClinicalFromList = clinical.Where(y => y.ReadingId == x.ReadingId && y.ClinicalDataTrialSetId == x.ClinicalDataTrialSetId).Select(y => new ClinicalFromData()
|
||||
{
|
||||
|
@ -895,77 +916,78 @@ namespace IRaCIS.Application.Services
|
|||
});
|
||||
|
||||
// 这里处理CRC上传 阅片期的临床数据
|
||||
var readModule = await _readModuleRepository.Where(x => x.Id == inDto.ReadingId&&x.IsCRCConfirm)
|
||||
var readModule = await _readModuleRepository.Where(x => x.Id == inDto.ReadingId && x.IsCRCConfirm)
|
||||
.FirstOrDefaultAsync();
|
||||
if (readModule != null)
|
||||
{
|
||||
var moduleCriterionFromList = await _readModuleCriterionFromRepository.Where(x => x.ReadModuleId == readModule.Id)
|
||||
var moduleCriterionFromList = await _readModuleCriterionFromRepository.Where(x => x.ReadModuleId == readModule.Id)
|
||||
|
||||
.WhereIf(inDto.ClinicalDataTrialSetId != null, x => x.ClinicalForm.ClinicalDataTrialSetId == inDto.TrialReadingCriterionId)
|
||||
.Select(x => new {
|
||||
ClinicalFormId = x.ClinicalFormId,
|
||||
CheckDate = x.ClinicalForm.CheckDate,
|
||||
ClinicalDataTrialSetId = x.ClinicalForm.ClinicalDataTrialSetId
|
||||
.Select(x => new
|
||||
{
|
||||
ClinicalFormId = x.ClinicalFormId,
|
||||
CheckDate = x.ClinicalForm.CheckDate,
|
||||
ClinicalDataTrialSetId = x.ClinicalForm.ClinicalDataTrialSetId
|
||||
|
||||
|
||||
}).ToListAsync();
|
||||
}).ToListAsync();
|
||||
|
||||
|
||||
var clinicalresult = await _clinicalDataTrialSetRepository.Where(x => x.UploadRole == UploadRole.CRC&&x.ClinicalUploadType== ClinicalUploadType.Structuring)
|
||||
.WhereIf(readModule.ReadingSetType == ReadingSetType.ImageReading,x=>x.ClinicalDataLevel== ClinicalLevel.ImageRead)
|
||||
|
||||
var clinicalresult = await _clinicalDataTrialSetRepository.Where(x => x.UploadRole == UploadRole.CRC && x.ClinicalUploadType == ClinicalUploadType.Structuring)
|
||||
.WhereIf(readModule.ReadingSetType == ReadingSetType.ImageReading, x => x.ClinicalDataLevel == ClinicalLevel.ImageRead)
|
||||
.WhereIf(readModule.ReadingSetType == ReadingSetType.TumorReading, x => x.ClinicalDataLevel == ClinicalLevel.OncologyRead)
|
||||
.Where(x => x.TrialClinicalDataSetCriteriaList.Any(y => y.TrialReadingCriterionId == readModule.TrialReadingCriterionId))
|
||||
.Select(x => new GetReadingClinicalDataListOutDto()
|
||||
{
|
||||
{
|
||||
|
||||
ClinicalDataLevel = x.ClinicalDataLevel,
|
||||
SubjectId = inDto.SubjectId,
|
||||
ReadingId = default(Guid),
|
||||
IsCRCApplicationRevoke= readModule.IsCRCApplicationRevoke,
|
||||
ClinicalDataLevel = x.ClinicalDataLevel,
|
||||
SubjectId = inDto.SubjectId,
|
||||
ReadingId = default(Guid),
|
||||
IsCRCApplicationRevoke = readModule.IsCRCApplicationRevoke,
|
||||
IsCRCConfirm = readModule.IsCRCConfirm,
|
||||
IsPMConfirm=readModule.IsPMConfirm,
|
||||
IsPMConfirm = readModule.IsPMConfirm,
|
||||
|
||||
ClinicalDataSetName = x.ClinicalDataSetName.LanguageName(x.ClinicalDataSetEnName, _userInfo.IsEn_Us),
|
||||
ClinicalDataSetEnName = x.ClinicalDataSetEnName,
|
||||
ClinicalDataTrialSetId = x.Id,
|
||||
IsSign = readModule.IsPMConfirm,
|
||||
ClinicalUploadType = x.ClinicalUploadType,
|
||||
Id = default(Guid),
|
||||
UploadRole = x.UploadRole,
|
||||
IsCRCUpload = x.UploadRole == UploadRole.CRC,
|
||||
IsNeedMerge = true,
|
||||
ReadModuleId = readModule.Id,
|
||||
//FileCount = x.FileCount,
|
||||
ClinicalDataSetEnName = x.ClinicalDataSetEnName,
|
||||
ClinicalDataTrialSetId = x.Id,
|
||||
IsSign = readModule.IsPMConfirm,
|
||||
ClinicalUploadType = x.ClinicalUploadType,
|
||||
Id = default(Guid),
|
||||
UploadRole = x.UploadRole,
|
||||
IsCRCUpload = x.UploadRole == UploadRole.CRC,
|
||||
IsNeedMerge = true,
|
||||
ReadModuleId = readModule.Id,
|
||||
//FileCount = x.FileCount,
|
||||
|
||||
//ReadingClinicalDataState = x.ReadingClinicalDataState,
|
||||
//ReadingClinicalDataState = x.ReadingClinicalDataState,
|
||||
|
||||
//FileList = x.ReadingClinicalDataPDFList.Select(y => new GetFileDto()
|
||||
//{
|
||||
// Id = y.Id,
|
||||
// FileName = y.FileName,
|
||||
// Path = y.Path,
|
||||
// CreateTime = y.CreateTime,
|
||||
//}).ToList()
|
||||
//FileList = x.ReadingClinicalDataPDFList.Select(y => new GetFileDto()
|
||||
//{
|
||||
// Id = y.Id,
|
||||
// FileName = y.FileName,
|
||||
// Path = y.Path,
|
||||
// CreateTime = y.CreateTime,
|
||||
//}).ToList()
|
||||
|
||||
}).ToListAsync();
|
||||
}).ToListAsync();
|
||||
|
||||
clinicalresult.ForEach(x =>
|
||||
{
|
||||
x.FileCount = moduleCriterionFromList.Where(y => y.ClinicalDataTrialSetId == x.ClinicalDataTrialSetId).Count();
|
||||
x.ClinicalFromList = moduleCriterionFromList.Where(y => y.ClinicalDataTrialSetId == x.ClinicalDataTrialSetId).OrderBy(y => y.CheckDate).Select(x => new ClinicalFromData
|
||||
{
|
||||
CheckDate = x.CheckDate,
|
||||
ClinicalFormId = x.ClinicalFormId
|
||||
clinicalresult.ForEach(x =>
|
||||
{
|
||||
x.FileCount = moduleCriterionFromList.Where(y => y.ClinicalDataTrialSetId == x.ClinicalDataTrialSetId).Count();
|
||||
x.ClinicalFromList = moduleCriterionFromList.Where(y => y.ClinicalDataTrialSetId == x.ClinicalDataTrialSetId).OrderBy(y => y.CheckDate).Select(x => new ClinicalFromData
|
||||
{
|
||||
CheckDate = x.CheckDate,
|
||||
ClinicalFormId = x.ClinicalFormId
|
||||
|
||||
}).ToList();
|
||||
}).ToList();
|
||||
|
||||
x.IsSign = readModule.IsPMConfirm ?true : false;
|
||||
x.IsSign = readModule.IsPMConfirm ? true : false;
|
||||
x.ReadingClinicalDataState = readModule.IsPMConfirm ? ReadingClinicalDataStatus.HaveSigned : ReadingClinicalDataStatus.HaveChecked;
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
result.AddRange(clinicalresult);
|
||||
}
|
||||
result.AddRange(clinicalresult);
|
||||
}
|
||||
|
||||
|
||||
if (inDto.GetClinicalType != null)
|
||||
|
@ -976,7 +998,7 @@ namespace IRaCIS.Application.Services
|
|||
result = result.Where(x => x.UploadRole == UploadRole.PM).ToList();
|
||||
break;
|
||||
case GetClinicalType.CRCConfirm:
|
||||
result = result.Where(x => x.UploadRole == UploadRole.CRC&&x.IsCRCConfirm&&!x.IsPMConfirm).ToList();
|
||||
result = result.Where(x => x.UploadRole == UploadRole.CRC && x.IsCRCConfirm && !x.IsPMConfirm).ToList();
|
||||
break;
|
||||
case GetClinicalType.HasSign:
|
||||
result = result.Where(x => x.IsSign).ToList();
|
||||
|
@ -984,7 +1006,7 @@ namespace IRaCIS.Application.Services
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -1162,7 +1162,13 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
/// 是否是第一次转化的任务
|
||||
/// </summary>
|
||||
public bool IsFirstChangeTask { get; set; } = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否存在临床数据
|
||||
/// </summary>
|
||||
public bool IsExistsClinicalData { get; set; } = false;
|
||||
|
||||
}
|
||||
|
||||
public class GetVisitReadingQuestionOutDto
|
||||
{
|
||||
|
|
|
@ -5,6 +5,7 @@ using System.ComponentModel.DataAnnotations;
|
|||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static IRaCIS.Core.Domain.Models.ReadingQuestionTrial;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
{
|
||||
|
@ -1044,7 +1045,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
public List<string> RelevanceValueList { get; set; }
|
||||
public List<CalculateInfo> CalculateQuestionList { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class ReadingQuestionSystemView
|
||||
{
|
||||
|
@ -1983,8 +1985,10 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
|
||||
public List<string> ParentTriggerValueList { get; set; }
|
||||
public List<string> RelevanceValueList { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class GetSystemCriterionSelectDto
|
||||
{
|
||||
|
|
|
@ -539,7 +539,21 @@ namespace IRaCIS.Application.Services
|
|||
}).ToListAsync();
|
||||
|
||||
|
||||
if (!taskInfo.TrialReadingCriterion.IsReadingTaskViewInOrder)
|
||||
foreach (var item in result)
|
||||
{
|
||||
var clinicalDataList = await _readingClinicalDataService.GetClinicalDataList(new GetReadingOrTaskClinicalDataListInDto()
|
||||
{
|
||||
|
||||
SubjectId = taskInfo.SubjectId,
|
||||
TrialId = taskInfo.TrialId,
|
||||
VisitTaskId = item.VisitTaskId,
|
||||
});
|
||||
|
||||
item.IsExistsClinicalData = clinicalDataList.Count > 0;
|
||||
}
|
||||
|
||||
|
||||
if (!taskInfo.TrialReadingCriterion.IsReadingTaskViewInOrder)
|
||||
{
|
||||
result = result.Where(x => x.VisitTaskId == inDto.VisitTaskId).ToList();
|
||||
}
|
||||
|
@ -2315,6 +2329,7 @@ namespace IRaCIS.Application.Services
|
|||
var subjectTaskList = (await _visitTaskService.GetOrderReadingIQueryable(new GetOrderReadingIQueryableInDto()
|
||||
{
|
||||
TrialId = inDto.TrialId,
|
||||
SubjectId=inDto.SubjectId,
|
||||
TrialReadingCriterionId = trialReadingCriterionId!.Value,
|
||||
Page = new PageInput()
|
||||
{
|
||||
|
@ -2336,7 +2351,7 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
if (currentSubject == null)
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"]);
|
||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows);
|
||||
}
|
||||
|
||||
task = currentSubject.UnReadCanReadTaskList.Select(x => new GetReadingTaskDto()
|
||||
|
@ -2409,7 +2424,7 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
if (task == null)
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"]);
|
||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows);
|
||||
}
|
||||
|
||||
if (task.SubjectCode.IsNullOrEmpty())
|
||||
|
|
|
@ -54,7 +54,7 @@ namespace IRaCIS.Core.Application.Triggers
|
|||
t.TrialId = subject.TrialId;
|
||||
t.SiteId = subject.SiteId;
|
||||
t.IsEnrollmentConfirm = t.IsBaseLine ? triconfig.IsEnrollementQualificationConfirm : false;
|
||||
t.PDState = PDStateEnum.None;
|
||||
t.PDState = t.IsBaseLine == false && triconfig.IsPDProgressView ? PDStateEnum.PDProgress : PDStateEnum.None;
|
||||
t.Id = NewId.NextGuid();
|
||||
|
||||
});
|
||||
|
|
|
@ -191,6 +191,8 @@ namespace IRaCIS.Core.Application.MediatR.Handlers
|
|||
dbSV.CheckState = CheckStateEnum.CVPassed;
|
||||
dbSV.CheckUserId = _userInfo.Id;
|
||||
dbSV.CheckPassedTime = DateTime.Now;
|
||||
dbSV.CheckChallengeState = CheckChanllengeTypeEnum.Closed;
|
||||
|
||||
//---核对EDC数据,完全一致
|
||||
dbSV.CheckResult = _localizer["ConsistencyVerification_EDCB"];
|
||||
//---自动核查通过
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||
///</summary>
|
||||
[Table("TrialDocument")]
|
||||
public class TrialDocument : Entity, IAuditUpdate, IAuditAdd
|
||||
{
|
||||
{
|
||||
|
||||
//需要确认的项目用户 通过TrialId 关联 用中间表过滤
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||
|
||||
[JsonIgnore]
|
||||
public List<TrialEmailNoticeUser> TrialEmailNoticeUserList { get; set; } = new List<TrialEmailNoticeUser>();
|
||||
|
||||
[JsonIgnore]
|
||||
public List<TrialEmailBlackUser> TrialEmailBlackUserList { get; set; } = new List<TrialEmailBlackUser>();
|
||||
|
||||
|
||||
|
|
|
@ -266,7 +266,11 @@ namespace IRaCIS.Core.Domain.Models
|
|||
/// </summary>
|
||||
public Guid? GroupId { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
|
||||
|
||||
//
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("GroupId")]
|
||||
public ReadingQuestionTrial GroupInfo { get; set; }
|
||||
|
||||
|
@ -289,8 +293,18 @@ namespace IRaCIS.Core.Domain.Models
|
|||
[JsonIgnore]
|
||||
public List<ReadingTableQuestionTrial> ReadingTableQuestionTrialList { get; set; }
|
||||
|
||||
|
||||
[NotMapped]
|
||||
|
||||
public enum AssessmentResultType
|
||||
{
|
||||
//没有特殊标记
|
||||
None=0,
|
||||
|
||||
//评估结果
|
||||
AssessmentResult = 1,
|
||||
}
|
||||
|
||||
|
||||
[NotMapped]
|
||||
public List<string> ParentTriggerValueList
|
||||
{
|
||||
get
|
||||
|
|
|
@ -74,7 +74,9 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public ReadingQuestionTrial ReadingQuestionTrial { get; set; }
|
||||
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("ReadingQuestionCriterionTrialId")]
|
||||
public ReadingQuestionCriterionTrial ReadingQuestionCriterionTrial { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -69,18 +69,40 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
typeof(TrialSiteSurvey),
|
||||
typeof(TrialSiteUser),
|
||||
typeof(VisitStage),
|
||||
typeof(TrialSite)
|
||||
};
|
||||
typeof(TrialSite),
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// 修改为删除
|
||||
private List<Type> UpdateIsDelete
|
||||
{
|
||||
get
|
||||
{
|
||||
return new List<Type>()
|
||||
{
|
||||
typeof(TrialDocument)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public string GetEntityAuditOpt(EntityEntry entityEntry)
|
||||
|
||||
public string GetEntityAuditOpt(EntityEntry entityEntry)
|
||||
{
|
||||
if (entityEntry.State == EntityState.Added)
|
||||
{
|
||||
return AuditOpt.Add;
|
||||
}
|
||||
else if (
|
||||
UpdateIsDelete.Contains(entityEntry.Entity.GetType())
|
||||
&& entityEntry.State == EntityState.Modified
|
||||
&& (bool)entityEntry.Entity.GetType().GetProperty(nameof(ISoftDelete.IsDeleted)).GetValue(entityEntry.Entity)
|
||||
|
||||
)
|
||||
{
|
||||
return AuditOpt.Deleted;
|
||||
}
|
||||
|
||||
else if (entityEntry.State == EntityState.Deleted ||
|
||||
(entityEntry.State == EntityState.Modified
|
||||
|
@ -1272,6 +1294,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
var entity = item.Entity as QCChallenge;
|
||||
|
||||
var challengeState= await _dbContext.SubjectVisit.Where(x => x.Id == entity.SubjectVisitId).Select(x => x.ChallengeState).FirstOrDefaultAsync();
|
||||
|
||||
await InsertInspection<QCChallenge>(entity, type, x => new InspectionConvertDTO()
|
||||
{
|
||||
SubjectVisitId = x.SubjectVisitId,
|
||||
|
@ -1281,7 +1305,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
{
|
||||
|
||||
IsOverTime = entity.IsClosed ? entity.ClosedTime > entity.DeadlineTime : DateTime.Now > entity.DeadlineTime,
|
||||
});
|
||||
ChallengeState= challengeState,
|
||||
});
|
||||
}
|
||||
|
||||
// 质疑 对话
|
||||
|
@ -1394,19 +1419,25 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
var trialSiteId = entity.TrialSite?.Id;
|
||||
|
||||
await InsertInspection<TrialSiteSurvey>(item.Entity as TrialSiteSurvey, type, x => new InspectionConvertDTO()
|
||||
var equipmentTypeList = await _dbContext.TrialSiteEquipmentSurvey.Where(x => x.TrialSiteSurveyId == entity.Id).Select(x => x.EquipmentType.ValueCN).ToListAsync();
|
||||
|
||||
|
||||
var siteUserList = await _dbContext.TrialSiteUserSurvey.Where(x => x.TrialSiteSurveyId == entity.Id).Select(x => x.LastName + "/" + x.FirstName).ToListAsync();
|
||||
|
||||
await InsertInspection<TrialSiteSurvey>(item.Entity as TrialSiteSurvey, type, x => new InspectionConvertDTO()
|
||||
{
|
||||
ObjectRelationParentId = trialSiteId,
|
||||
}, new
|
||||
{
|
||||
|
||||
//TrialSiteCode = entity.TrialSite.TrialSiteCode,
|
||||
//TrialSiteAliasName = entity.TrialSite.TrialSiteAliasName,
|
||||
//Phone = entity.Phone,
|
||||
//Email = entity.Email,
|
||||
//TrialSiteCode = entity.TrialSite.TrialSiteCode,
|
||||
//TrialSiteAliasName = entity.TrialSite.TrialSiteAliasName,
|
||||
//Phone = entity.Phone,
|
||||
//Email = entity.Email,
|
||||
|
||||
|
||||
PreliminaryUser = entity.PreliminaryUser == null ? "" : entity.PreliminaryUser.FullName,
|
||||
EquipmentTypeList=string.Join(",", equipmentTypeList),
|
||||
SiteUserList= string.Join(",", siteUserList),
|
||||
PreliminaryUser = entity.PreliminaryUser == null ? "" : entity.PreliminaryUser.FullName,
|
||||
ReviewerUser = entity.ReviewerUser == null ? "" : entity.ReviewerUser.FullName,
|
||||
|
||||
});
|
||||
|
|
|
@ -10,7 +10,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common.Dto
|
|||
{
|
||||
public string Code { get; set; }
|
||||
|
||||
public string DateType { get; set; }
|
||||
public string Identification { get; set; }
|
||||
public string DateType { get; set; }
|
||||
}
|
||||
|
||||
public class TypeNameDto
|
||||
|
|
|
@ -1,17 +1,22 @@
|
|||
using System;
|
||||
using IRaCIS.Core.Infrastructure.Extention;
|
||||
using System;
|
||||
|
||||
namespace IRaCIS.Core.Infrastructure
|
||||
{
|
||||
public class BusinessValidationFailedException : Exception
|
||||
{
|
||||
public ApiResponseCodeEnum Code { get; set; }
|
||||
|
||||
public BusinessValidationFailedException()
|
||||
public BusinessValidationFailedException()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public BusinessValidationFailedException( string message) : base(message)
|
||||
{
|
||||
}
|
||||
public BusinessValidationFailedException(string message, ApiResponseCodeEnum code = ApiResponseCodeEnum.BusinessValidationFailed) : base(message)
|
||||
{
|
||||
Code = code;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,11 +24,15 @@ namespace IRaCIS.Core.Infrastructure.Extention
|
|||
ProgramException = 4,
|
||||
|
||||
//需要提示 ,需要提示 从Result 取数据 ( 0 可以继续处理提交 ,1 不能进行继续处理提交 ,2 刷新列表 )
|
||||
NeedTips = 5,
|
||||
NeedTips = 5,
|
||||
|
||||
/// <summary>
|
||||
/// 关闭当前页面
|
||||
/// </summary>
|
||||
CloseCurrentWindows=6,
|
||||
|
||||
//在其他地方登陆,被迫下线
|
||||
LoginInOtherPlace = -1,
|
||||
//在其他地方登陆,被迫下线
|
||||
LoginInOtherPlace = -1,
|
||||
|
||||
//没有带token访问(未登陆)
|
||||
NoToken=10,
|
||||
|
|
Loading…
Reference in New Issue