修改项目属性 单选变为多选
parent
bcad91dc18
commit
76965111fe
|
@ -67,9 +67,9 @@ namespace IRaCIS.Application.Services
|
|||
ReviewerSelectionQueryDTO selectionQuery)
|
||||
{
|
||||
//项目配置需要的医生过滤 2表示混合
|
||||
var trialConfig = await _repository.Where<Trial>(s => s.Id == selectionQuery.TrialId).Select(t=>new { t.AttendedReviewerType ,t.TrialType} ).FirstOrDefaultAsync().IfNullThrowException();
|
||||
var trialConfig = await _repository.Where<Trial>(s => s.Id == selectionQuery.TrialId).Select(t=>new { t.AttendedReviewerTypeEnumList ,t.TrialType} ).FirstOrDefaultAsync().IfNullThrowException();
|
||||
|
||||
var nation = trialConfig.AttendedReviewerType;
|
||||
//var nation = trialConfig.AttendedReviewerType;
|
||||
// 临床项目经验 多选
|
||||
var evaluationCriteriaCount = selectionQuery.EvaluationCriteriaIdList.Count();
|
||||
|
||||
|
@ -78,7 +78,8 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
var guidList = selectionQuery.ReadingTypeIdList.Concat(selectionQuery.SubspecialityIdList).Concat(selectionQuery.TitleIdList);
|
||||
|
||||
var query = _doctorRepository.WhereIf(nation != AttendedReviewerType.USAndCN, t => t.Nation ==(int) nation)
|
||||
var query = _doctorRepository/*.WhereIf(nation != AttendedReviewerType.USAndCN, t => t.Nation ==(int) nation)*/
|
||||
|
||||
.WhereIf(selectionQuery.DepartmentId != null, t => t.DepartmentId == selectionQuery.DepartmentId)
|
||||
.WhereIf(selectionQuery.SpecialityId != null, t => t.SpecialityId == selectionQuery.SpecialityId)
|
||||
.WhereIf(trialConfig.TrialType == TrialType.NoneOfficial, t => t.IsVirtual ==true)
|
||||
|
|
|
@ -174,6 +174,6 @@ namespace IRaCIS.Application.Contracts
|
|||
public DateTime BeginDate { get; set; }
|
||||
public DateTime EndDate { get; set; }
|
||||
|
||||
public AttendedReviewerType? AttendedReviewerType { get; set; }
|
||||
//public AttendedReviewerType? AttendedReviewerType { get; set; }
|
||||
}
|
||||
}
|
|
@ -552,10 +552,12 @@ namespace IRaCIS.Application.Services
|
|||
trialLambda = trialLambda.And(u => u.TrialCode.Contains(trialCode));
|
||||
}
|
||||
|
||||
if (queryParam.AttendedReviewerType != null)
|
||||
{
|
||||
trialLambda = trialLambda.And(u => u.AttendedReviewerType == queryParam.AttendedReviewerType);
|
||||
}
|
||||
//if (queryParam.AttendedReviewerType != null)
|
||||
//{
|
||||
// trialLambda = trialLambda.And(u => u.AttendedReviewerType == queryParam.AttendedReviewerType);
|
||||
//}
|
||||
|
||||
|
||||
|
||||
Expression<Func<Doctor, bool>> doctorLambda = x => true;
|
||||
|
||||
|
@ -936,15 +938,17 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
trialLambda = trialLambda.And(u => u.CROId == param.CroId);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(param.TrialCode))
|
||||
{
|
||||
var trialCode = param.TrialCode.Trim();
|
||||
trialLambda = trialLambda.And(u => u.TrialCode.Contains(trialCode));
|
||||
}
|
||||
if (param.AttendedReviewerType != null)
|
||||
{
|
||||
trialLambda = trialLambda.And(u => u.AttendedReviewerType == param.AttendedReviewerType);
|
||||
}
|
||||
|
||||
//if (param.AttendedReviewerType != null)
|
||||
//{
|
||||
// trialLambda = trialLambda.And(u => u.AttendedReviewerType == param.AttendedReviewerType);
|
||||
//}
|
||||
|
||||
var lockedPaymentIdAndYearMonth = _paymentRepository.Where(t => t.IsLock && t.YearMonthDate >= bDate && t.YearMonthDate <= eDate).Select(t => new { PaymentId = t.Id, t.YearMonth, t.DoctorId });
|
||||
|
||||
|
|
|
@ -148,7 +148,8 @@ namespace IRaCIS.Application.Contracts
|
|||
|
||||
//医生付费类型 CN US
|
||||
public int? Nation { get; set; }
|
||||
public AttendedReviewerType? AttendedReviewerType { get; set; }
|
||||
|
||||
//public AttendedReviewerType? AttendedReviewerType { get; set; }
|
||||
}
|
||||
|
||||
public class StatisticsWorkloadQueryParam : PageInput
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using IRaCIS.Core.Infrastructure.Extention;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using Newtonsoft.Json;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace IRaCIS.Application.Contracts
|
||||
{
|
||||
|
@ -30,7 +31,7 @@ namespace IRaCIS.Application.Contracts
|
|||
public int? GRRReviewers { get; set; }
|
||||
public int TotalReviewers { get; set; }
|
||||
public int? Expedited { get; set; }
|
||||
public int? AttendedReviewerType { get; set; }
|
||||
|
||||
|
||||
//研究方案号
|
||||
public string ResearchProgramNo { get; set; } = string.Empty;
|
||||
|
@ -44,12 +45,22 @@ namespace IRaCIS.Application.Contracts
|
|||
// 负责人PI
|
||||
public string HeadPI { get; set; } = string.Empty;
|
||||
|
||||
public Guid DeclarationTypeId { get; set; }
|
||||
//public Guid DeclarationTypeId { get; set; }
|
||||
//public int? AttendedReviewerType { get; set; }
|
||||
|
||||
public Guid IndicationTypeId { get; set; }
|
||||
public Guid? PhaseId { get; set; }
|
||||
|
||||
|
||||
public string DeclarationTypeOther { get; set; }
|
||||
public List<DeclarationType> DeclarationTypeEnumList { get; set; }
|
||||
|
||||
public List<AttendedReviewerType> AttendedReviewerTypeEnumList { get; set; }
|
||||
public string DeclarationTypes { get; set; }
|
||||
public string AttendedReviewerTypes { get; set; }
|
||||
public string AttendedReviewerTypeOther { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -116,7 +127,7 @@ namespace IRaCIS.Application.Contracts
|
|||
//统计字段
|
||||
public string Phase { get; set; } = string.Empty;
|
||||
|
||||
public string DeclarationType { get; set; } = string.Empty;
|
||||
|
||||
|
||||
public string IndicationType { get; set; } = string.Empty;
|
||||
|
||||
|
@ -140,6 +151,9 @@ namespace IRaCIS.Application.Contracts
|
|||
public bool IsDeleted { get; set; }
|
||||
|
||||
public bool IsLocked { get; set; }
|
||||
|
||||
|
||||
//public string DeclarationType { get; set; } = string.Empty;
|
||||
//public int? SubjectCount { get; set; }
|
||||
|
||||
//public int? StudyCount { get; set; } = 0;
|
||||
|
@ -174,7 +188,11 @@ namespace IRaCIS.Application.Contracts
|
|||
|
||||
public class TrialQueryDTO : PageInput
|
||||
{
|
||||
public Guid? DeclarationTypeId { get; set; }
|
||||
//public Guid? DeclarationTypeId { get; set; }
|
||||
|
||||
public List<DeclarationType> DeclarationTypeEnumList { get; set; }=new List<DeclarationType>();
|
||||
|
||||
public List<AttendedReviewerType> AttendedReviewerTypeEnumList { get; set; } = new List<AttendedReviewerType>();
|
||||
|
||||
public Guid? IndicationTypeId { get; set; }
|
||||
public Guid? SponsorId { get; set; }
|
||||
|
@ -200,7 +218,7 @@ namespace IRaCIS.Application.Contracts
|
|||
public DateTime? BeginDate { get; set; }
|
||||
public DateTime? EndDate { get; set; }
|
||||
public int? Expedited { get; set; }
|
||||
public AttendedReviewerType? AttendedReviewerType { get; set; }
|
||||
//public AttendedReviewerType? AttendedReviewerType { get; set; }
|
||||
}
|
||||
|
||||
public class ReviewerTrialQueryDTO : PageInput
|
||||
|
|
|
@ -9,6 +9,8 @@ using IRaCIS.Core.Infrastructure;
|
|||
using Microsoft.Extensions.Options;
|
||||
using static IRaCIS.Core.Domain.Share.StaticData;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using System.Linq.Expressions;
|
||||
using System.Linq;
|
||||
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
|
@ -49,6 +51,23 @@ namespace IRaCIS.Application.Services
|
|||
var multiCriteriaSelectCount = searchParam.CriterionIds.Count;
|
||||
var multiReviewTypeSelectCount = searchParam.ReviewTypeIds.Count;
|
||||
|
||||
Expression<Func<Trial, bool>> trialDeclarationTypeExpression = x => true;
|
||||
|
||||
|
||||
|
||||
foreach (var item in searchParam.DeclarationTypeEnumList)
|
||||
{
|
||||
trialDeclarationTypeExpression = trialDeclarationTypeExpression.And(t => t.DeclarationTypes.Contains($"|{item}|"));
|
||||
}
|
||||
|
||||
Expression<Func<Trial, bool>> trialAttendedReviewerTypeExpression = x => true;
|
||||
|
||||
foreach (var item in searchParam.AttendedReviewerTypeEnumList)
|
||||
{
|
||||
trialAttendedReviewerTypeExpression = trialAttendedReviewerTypeExpression.And(t => t.AttendedReviewerTypes.Contains($"|{item}|"));
|
||||
}
|
||||
|
||||
|
||||
var query = _trialRepository.AsQueryable().IgnoreQueryFilters()
|
||||
.WhereIf(!string.IsNullOrEmpty(searchParam.TrialStatusStr), o => o.TrialStatusStr.Contains(searchParam.TrialStatusStr))
|
||||
.WhereIf(searchParam.SponsorId != null, o => o.SponsorId == searchParam.SponsorId)
|
||||
|
@ -58,12 +77,17 @@ namespace IRaCIS.Application.Services
|
|||
.WhereIf(!string.IsNullOrEmpty(searchParam.ResearchProgramNo), o => o.ResearchProgramNo.Contains(searchParam.ResearchProgramNo))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(searchParam.ExperimentName), o => o.ExperimentName.Contains(searchParam.ExperimentName))
|
||||
.WhereIf(searchParam.PhaseId != null, o => o.PhaseId == searchParam.PhaseId)
|
||||
.WhereIf(searchParam.DeclarationTypeId != null, o => o.DeclarationTypeId == searchParam.DeclarationTypeId)
|
||||
|
||||
.WhereIf(searchParam.DeclarationTypeEnumList.Count>0 , trialDeclarationTypeExpression)
|
||||
.WhereIf(searchParam.AttendedReviewerTypeEnumList.Count > 0, trialAttendedReviewerTypeExpression)
|
||||
|
||||
//.WhereIf(searchParam.AttendedReviewerType != null, o => o.AttendedReviewerType == searchParam.AttendedReviewerType)
|
||||
|
||||
.WhereIf(searchParam.IndicationTypeId != null, o => o.IndicationTypeId == searchParam.IndicationTypeId)
|
||||
.WhereIf(searchParam.CROId != null, o => o.CROId == searchParam.CROId)
|
||||
.WhereIf(searchParam.BeginDate != null, o => o.CreateTime >= searchParam.BeginDate)
|
||||
.WhereIf(searchParam.EndDate != null, o => o.CreateTime <= searchParam.EndDate)
|
||||
.WhereIf(searchParam.AttendedReviewerType != null, o => o.AttendedReviewerType == searchParam.AttendedReviewerType)
|
||||
|
||||
.WhereIf(multiModalityIdSelectCount > 0, t => t.TrialDicList.Count(t => t.KeyName == StaticData.Modality) == multiModalityIdSelectCount)
|
||||
.WhereIf(multiCriteriaSelectCount > 0, t => t.TrialDicList.Count(t => t.KeyName == StaticData.Criterion) == multiCriteriaSelectCount)
|
||||
.WhereIf(multiReviewTypeSelectCount > 0, t => t.TrialDicList.Count(t => t.KeyName == StaticData.ReviewType) == multiReviewTypeSelectCount)
|
||||
|
@ -171,6 +195,9 @@ namespace IRaCIS.Application.Services
|
|||
trial.TrialCode = (trial.TrialType == TrialType.NoneOfficial ? "T0" : yearStr.Substring(yearStr.Length - 2)) + trial.TrialCode + currentYearMaxCodeNext.ToString("D3");
|
||||
|
||||
|
||||
trial.DeclarationTypes = $"|{string.Join('|', trialAddModel.DeclarationTypeEnumList)}|";
|
||||
trial.AttendedReviewerTypes = $"|{string.Join('|', trialAddModel.AttendedReviewerTypes)}|";
|
||||
|
||||
//多选信息
|
||||
trialAddModel.ModalityIds.ForEach(modalityId => trial.TrialDicList.Add(new TrialDictionary() { DictionaryId = modalityId, KeyName = StaticData.Modality, TrialId = trial.Id }));
|
||||
trialAddModel.CriterionIds.ForEach(criterionId => trial.TrialDicList.Add(new TrialDictionary() { DictionaryId = criterionId, KeyName = StaticData.Criterion, TrialId = trial.Id }));
|
||||
|
|
|
@ -70,7 +70,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
//.ForMember(d => d.Code, u => u.MapFrom(s => s.TrialCode))
|
||||
.ForMember(d => d.Sponsor, u => u.MapFrom(s => s.Sponsor.SponsorName))
|
||||
.ForMember(d => d.Phase, u => u.MapFrom(s => s.Phase.MappedValue))
|
||||
.ForMember(d => d.DeclarationType, u => u.MapFrom(s => s.DeclarationType.MappedValue))
|
||||
//.ForMember(d => d.DeclarationType, u => u.MapFrom(s => s.DeclarationType.MappedValue))
|
||||
.ForMember(d => d.IndicationType, u => u.MapFrom(s => s.IndicationType.MappedValue))
|
||||
.ForMember(d => d.CRO, u => u.MapFrom(s => s.CRO.CROName))
|
||||
.ForMember(d => d.ReviewMode, u => u.MapFrom(s => s.ReviewMode.MappedValue))
|
||||
|
|
|
@ -35,4 +35,15 @@
|
|||
|
||||
USAndCN=2,
|
||||
}
|
||||
|
||||
public enum DeclarationType
|
||||
{
|
||||
Other=-1,
|
||||
|
||||
US=0,
|
||||
|
||||
CN=1,
|
||||
EU=2,
|
||||
JP=3
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
|
||||
--新增字段
|
||||
ALTER TABLE [dbo].[Trial] ADD [AttendedReviewerTypeOther] varchar(255) COLLATE Chinese_PRC_CI_AS DEFAULT '' NOT NULL
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[Trial] ADD [AttendedReviewerTypes] varchar(255) COLLATE Chinese_PRC_CI_AS DEFAULT '' NOT NULL
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[Trial] ADD [DeclarationTypeOther] varchar(255) COLLATE Chinese_PRC_CI_AS DEFAULT '' NOT NULL
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[Trial] ADD [DeclarationTypes] varchar(255) COLLATE Chinese_PRC_CI_AS DEFAULT '' NOT NULL
|
||||
GO
|
||||
|
||||
|
||||
--维护sql
|
||||
UPDATE Trial SET AttendedReviewerTypes = '|' + CAST(AttendedReviewerType AS VARCHAR(10)) + '|'
|
||||
|
||||
update Trial set DeclarationTypes ='|' + (select Code from Dictionary where Id= Trial.DeclarationTypeId) + '|'
|
||||
|
||||
|
||||
|
||||
--验证sql
|
||||
select DISTINCT AttendedReviewerType ,AttendedReviewerTypes, DeclarationTypeId, Dictionary.Code,DeclarationTypes,Dictionary.[Value] from Trial inner join Dictionary on Trial.DeclarationTypeId=Dictionary.Id
|
||||
|
||||
|
||||
|
||||
--删除多余字段
|
||||
ALTER TABLE [dbo].[Trial] DROP COLUMN [DeclarationTypeId];
|
||||
ALTER TABLE [dbo].[Trial] DROP COLUMN [AttendedReviewerType];
|
|
@ -45,11 +45,6 @@ namespace IRaCIS.Core.Domain.Models
|
|||
[JsonIgnore]
|
||||
public List<TrialSiteUser> TrialSiteUserList { get; set; } = new List<TrialSiteUser>();
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("DeclarationTypeId")]
|
||||
public Dictionary DeclarationType { get; set; }
|
||||
|
||||
public Guid DeclarationTypeId { get; set; } = Guid.Empty;
|
||||
|
||||
public Guid IndicationTypeId { get; set; } = Guid.Empty;
|
||||
public Guid? PhaseId { get; set; } = Guid.Empty;
|
||||
|
@ -142,13 +137,39 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public DateTime UpdateTime { get; set; }
|
||||
|
||||
public Guid UpdateUserId { get; set; }
|
||||
public AttendedReviewerType AttendedReviewerType { get; set; } = AttendedReviewerType.CN;//0全部中国医生 1美国医生 2既有中国医生,也有美国医生
|
||||
|
||||
|
||||
|
||||
//废弃
|
||||
//public AttendedReviewerType AttendedReviewerType { get; set; } = AttendedReviewerType.CN;//0全部中国医生 1美国医生 2既有中国医生,也有美国医生
|
||||
|
||||
////废弃
|
||||
//[JsonIgnore]
|
||||
//[ForeignKey("DeclarationTypeId")]
|
||||
//public Dictionary DeclarationType { get; set; }
|
||||
|
||||
//废弃
|
||||
//public Guid DeclarationTypeId { get; set; } = Guid.Empty;
|
||||
|
||||
|
||||
public string DeclarationTypeOther { get; set; }
|
||||
public string DeclarationTypes { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public List<DeclarationType> DeclarationTypeEnumList => AttendedReviewerTypes.Split('|', StringSplitOptions.RemoveEmptyEntries)
|
||||
.Select(s => Enum.Parse(typeof(DeclarationType), s)).Cast<DeclarationType>().ToList();
|
||||
|
||||
[NotMapped]
|
||||
public List<AttendedReviewerType> AttendedReviewerTypeEnumList=> AttendedReviewerTypes.Split('|',StringSplitOptions.RemoveEmptyEntries)
|
||||
.Select(s => Enum.Parse(typeof(AttendedReviewerType), s)).Cast<AttendedReviewerType>().ToList();
|
||||
|
||||
public string AttendedReviewerTypes { get; set; }
|
||||
public string AttendedReviewerTypeOther { get; set; }
|
||||
|
||||
|
||||
|
||||
public bool VisitPlanConfirmed { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 受试者编号具体规则
|
||||
/// </summary>
|
||||
|
@ -359,6 +380,9 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public bool IsConfigureEmail { get; set; } = false;
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
///// <summary>
|
||||
///// 图像是否有标注
|
||||
///// </summary>
|
||||
|
|
Loading…
Reference in New Issue