From cacd825835b6b7efa5a7e4d482ce3dc6a432eef7 Mon Sep 17 00:00:00 2001 From: "{872297557@qq.com}" <872297557@qq.com> Date: Thu, 12 Jan 2023 13:12:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=BB=B4=E6=8A=A4sql=20=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=20=E5=8F=91=E9=80=81=E9=82=AE=E4=BB=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Management/UserTypeService.cs | 5 +++-- IRaCIS.Core.Domain/SQLFile/Test.sql | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Management/UserTypeService.cs b/IRaCIS.Core.Application/Service/Management/UserTypeService.cs index 16645de5..d5583dd7 100644 --- a/IRaCIS.Core.Application/Service/Management/UserTypeService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserTypeService.cs @@ -125,13 +125,14 @@ namespace IRaCIS.Core.Application.Contracts if (userTypeSelectEnum == UserTypeSelectEnum.EnrollOrPD_EMailCopy) { - userTypeEnums = new List() { UserTypeEnum.CRA, UserTypeEnum.ClinicalResearchCoordinator }; + userTypeEnums = new List() { UserTypeEnum.CPM, UserTypeEnum.SPM, UserTypeEnum.SMM, UserTypeEnum.CMM }; + } if (userTypeSelectEnum == UserTypeSelectEnum.EnrollOrPD_EmailReceive) { + userTypeEnums = new List() { UserTypeEnum.CRA, UserTypeEnum.ClinicalResearchCoordinator }; - userTypeEnums = new List() { UserTypeEnum.CPM, UserTypeEnum.SPM, UserTypeEnum.SMM, UserTypeEnum.CMM }; } diff --git a/IRaCIS.Core.Domain/SQLFile/Test.sql b/IRaCIS.Core.Domain/SQLFile/Test.sql index fba8bbea..f8ed0c42 100644 --- a/IRaCIS.Core.Domain/SQLFile/Test.sql +++ b/IRaCIS.Core.Domain/SQLFile/Test.sql @@ -307,4 +307,9 @@ WHERE EXISTS ( SELECT 1 FROM [VisitTask] AS [v1] WHERE [v1].SubjectId=v.SubjectId and V1.TrialReadingCriterionId=V.TrialReadingCriterionId and V1.TrialId=V.TrialId and [v1].[IsNeedClinicalDataSign]=1 and V1.IsClinicalDataSign=0 and V1.VisitTaskNum< [v0].[VisitTaskNum] - ) AND [v0].[Id] = [v].[Id] ) \ No newline at end of file + + ) AND [v0].[Id] = [v].[Id] ) + + + + update ReadingClinicalData set IsVisit=1 from ReadingClinicalData INNER JOIN ClinicalDataTrialSet on ReadingClinicalData.ClinicalDataTrialSetId = ClinicalDataTrialSet.Id where ClinicalDataTrialSet.ClinicalDataLevel in (0,1) and ReadingClinicalData.IsVisit=0 \ No newline at end of file From 7e64174acbe89cb26c53414db27c98cd2ae18888 Mon Sep 17 00:00:00 2001 From: "{872297557@qq.com}" <872297557@qq.com> Date: Thu, 12 Jan 2023 13:47:03 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=B8=B4=E5=BA=8A=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ClinicalData/ReadingClinicalDataService.cs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Reading/ClinicalData/ReadingClinicalDataService.cs b/IRaCIS.Core.Application/Service/Reading/ClinicalData/ReadingClinicalDataService.cs index 41f9a834..2a8180e0 100644 --- a/IRaCIS.Core.Application/Service/Reading/ClinicalData/ReadingClinicalDataService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ClinicalData/ReadingClinicalDataService.cs @@ -77,14 +77,7 @@ namespace IRaCIS.Application.Services .WhereIf(indto.Id != null, x => x.Id != indto.Id) .Where(x => x.ClinicalDataTrialSetId == indto.ClinicalDataTrialSetId && x.ReadingId == indto.ReadingId); - if (await _subjectVisitRepository.AnyAsync(x => x.Id == indto.ReadingId)) - { - indto.IsVisit = true; - } - else - { - indto.IsVisit = false; - } + if (await existsQuery.AnyAsync()) @@ -92,6 +85,10 @@ namespace IRaCIS.Application.Services return ResponseOutput.NotOk("存在同类型的临床数据"); } var clinicalDataTrialSet = (await _clinicalDataTrialSetRepository.Where(x => x.Id == indto.ClinicalDataTrialSetId).FirstOrDefaultAsync()).IfNullThrowException(); + + //subject 或者访视级别的 都是在访视传 + indto.IsVisit = clinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.Subject || clinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.SubjectVisit; + if (indto.Id == null) { var entity = _mapper.Map(indto); @@ -418,7 +415,7 @@ namespace IRaCIS.Application.Services } ReadModule readModule = null; - if (inDto.ReadingId != null) + if (inDto.IsVisit ==false) { readModule = await _readModuleRepository.Where(x => x.Id == inDto.ReadingId).FirstOrDefaultAsync(); } @@ -519,13 +516,14 @@ namespace IRaCIS.Application.Services [HttpPost] public async Task<(List, object)> GetReadingClinicalDataList(GetReadingClinicalDataListIndto inDto) { - GetTrialClinicalDataSelectIndto getTrialClinicalDataSelectIndto = new GetTrialClinicalDataSelectIndto() + var getTrialClinicalDataSelectIndto = new GetTrialClinicalDataSelectIndto() { ReadingId = inDto.ReadingId, TrialId = inDto.TrialId, IsBaseLine = inDto.IsBaseLine, SubjectId = inDto.SubjectId, IsVisit = inDto.IsVisit, + TrialReadingCriterionId=inDto.TrialReadingCriterionId }; var clinicalDataList = await this.GetTrialClinicalDataSelect(getTrialClinicalDataSelectIndto);