diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteSurveyViewModel.cs b/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteSurveyViewModel.cs index 12929ea52..dcec4d69e 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteSurveyViewModel.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteSurveyViewModel.cs @@ -228,6 +228,8 @@ namespace IRaCIS.Core.Application.Contracts public string VerificationCode { get; set; } public string EmailOrPhone { get; set; } + + public Guid? TrialId { get; set; } } /// diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs index db167c0c4..71a851038 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs @@ -155,9 +155,21 @@ namespace IRaCIS.Core.Application.Contracts } else { + var isVirtual = true; + + if (inDto.TrialId != null) + { + isVirtual = await _trialRepository.Where(x => x.Id == inDto.TrialId).Select(x => x.TrialType != TrialType.OfficialTrial).FirstNotNullAsync(); + } Doctor doctor = new Doctor() { - EMail = inDto.EmailOrPhone + EMail = inDto.EmailOrPhone, + IsVirtual = isVirtual, + AcceptingNewTrial=false, + ActivelyReading=false, + CooperateStatus= ContractorStatusEnum.Noncooperation, + + ReviewStatus= ReviewerInformationConfirmStatus.ConfirmRefuse }; var info=await _doctorRepository.AddAsync(doctor,true);